Question: Graph Search This algorithm is modified from the one given in the text for breadth-first search. In particular, instead of a plain queue implementation of



Graph Search This algorithm is modified from the one given in the text for breadth-first search. In particular, instead of a plain queue implementation of Q we use a max priority queue GraphSearch(G, w, s) for each vertex uEG.V- s 2. ucolor = WHITE 4 5. s.color GRAY sd = 0 s, ? = NIL Q = // Q is a max heap priority queue using V.d as the key 7. 9. Enqueue(Q, s) 10. while OB u = Dequeue(Q) for each vEG.Adji[u] 13 if v.color_WHITE 14 16. 18. V. Color GRAY Enqueue(Q,v) ucolor = BLACK
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
