Graph Theory37 sections · 1633 units
Open in CourseQuiz: Multi-Source BFS
Knowledge check
Check Your Understanding
In the Rotting Oranges problem, you push all rotten oranges into the queue before starting BFS. What would go wrong if you ran a separate BFS from each rotten orange instead?
- A.The answer would be wrong because BFS cannot run multiple times
- B.Nothing. Both approaches give the same result with the same speed
- C.Separate BFS runs would miss some fresh oranges
- D.Separate BFS runs give the correct answer but take time instead of , where is the number of sources