Question: It's a problem about Breath-First Search. I only need help for b and c also, only pseudocode or description of the algorithm is needed. Thank

 It's a problem about Breath-First Search. I only need help forb and c also, only pseudocode or description of the algorithm isneeded. Thank you ! You have an undirected graph G (V,E) and

It's a problem about Breath-First Search.

I only need help for b and c

also, only pseudocode or description of the algorithm is needed. Thank you !

You have an undirected graph G (V,E) and two special nodes r, d V. At time 0, node r is red, node b is blue, while all the other nodes u {r are initially "undecided. For every i = 1,2,3, .. ., the following 2-stage "conversion" process is performed at time time i. At the first stage, all reds at time (i -1) look at all their neighboring nodes v which are still undecided, and convert those undecided nodes to become red Similarly, at the second stage, all blue nodes at time (i -1) look at all their neighboring nodes v which are still undecided by the end of the first stage above, and convert those undecided nodes to become blue. The process is repeated until no new conversions can be made. For example, if G is a 5-cycle 1,2,3, 4,5 where r 1, b 5, after time 1 node 2 becomes red and node 4 becomes blue, and after time 2 the last remaining node 3 becomes red (as reds move first) at the start after time 1 after time 2 On the other hand, if the initial blue node was b 3 instead, then already after time 1 red, and node 4 becomes blue, and no time 2 is needed nodes 2 and 5 become at the start after time1 You have an undirected graph G (V,E) and two special nodes r, d V. At time 0, node r is red, node b is blue, while all the other nodes u {r are initially "undecided. For every i = 1,2,3, .. ., the following 2-stage "conversion" process is performed at time time i. At the first stage, all reds at time (i -1) look at all their neighboring nodes v which are still undecided, and convert those undecided nodes to become red Similarly, at the second stage, all blue nodes at time (i -1) look at all their neighboring nodes v which are still undecided by the end of the first stage above, and convert those undecided nodes to become blue. The process is repeated until no new conversions can be made. For example, if G is a 5-cycle 1,2,3, 4,5 where r 1, b 5, after time 1 node 2 becomes red and node 4 becomes blue, and after time 2 the last remaining node 3 becomes red (as reds move first) at the start after time 1 after time 2 On the other hand, if the initial blue node was b 3 instead, then already after time 1 red, and node 4 becomes blue, and no time 2 is needed nodes 2 and 5 become at the start after time1

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 Databases Questions!