Question: ( 2 0 points ) Graph Search Write down the distance and parent for all nodes of the function call DIJKSTRA ( G , a

(20 points) Graph Search Write down the distance and parent for all nodes of the function call DIJKSTRA(G,a), given the source program and the input graph. Write down d and for each node in each iteration in the bottom table.
INITIALIZE-SINGLE-SOURCE (G,s)
for each vertex vinG.V
v.d=
u.= NIL
s.d=0
DijKstRa(G,w,s
INITIALIZE-SINOLE-SOURCE (G,s)
S=O?
Q=G.V
while Q0
u=ExTRACT-MIN(Q)
S=S{u}
for each vertex vinG.Adj[u]
RELAx(u,v,w)
RELAx(u,v,w)
1ifv.d>u.d+w(u,v)
2,v.d=u.d+w(u,v)
3,v.=u
\table[[,a,b,c,d,e
( 2 0 points ) Graph Search Write down the

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!