Question: If F = { b , c , g } then we need to report { a , b , c , d , g

If F ={b, c, g} then we need to report {a, b, c, d, g}: {b, c, g} are initially on fire
and together set d on fire, and in turn {b, c, d} set a on fire as well. Note that
e and f dont catch fire, since fewer than 3 of their neighbours are on fire. If
F ={d,e, f }, we report {d,e, f , g} since {d,e, f } make g catch fire and no other
vertex has 3 burning neighbours after that.
Design an algorithm that given an initial set of burning vertices F, computes
all burning vertices of V. For full marks, your algorithm should run in O(n + m)
time. Remember to:
a) describe your algorithm in plain English,
b) argue its correctness, and
c) analyze its time complexity

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!