Dijkstra's algorithm Initialize:dist(x)=oo for allxs,and dist(s)=0. Let Q contain all of V //Q=V-R Q=V-R โ while 0โ 0 R find a u with min dist(u) uEQ S delete u from Q for each yโN(u) /update N(u) if dist(y)>dist(u)+l(u,y) dist(y)dist(u)+l(u,y) /update the estimated upper bound 29Dijkstraโs algorithm โผ Initialize: ๐๐๐ ๐ก(๐ฅ) = โ for all ๐ฅ โ ๐ , and ๐๐๐ ๐ก(๐ ) = 0. โผ Let ๐ contain all of ๐ // ๐ = ๐ โ ๐
โผ while ๐ โ โ
find a ๐ข with min ๐ขโ๐ ๐๐๐ ๐ก ๐ข delete ๐ข from ๐ for each ๐ฆ โ ๐(๐ข) // update ๐(๐ข) if ๐๐๐ ๐ก(๐ฆ) > ๐๐๐ ๐ก(๐ข) + ๐(๐ข, ๐ฆ) ๐๐๐ ๐ก(๐ฆ) = ๐๐๐ ๐ก(๐ข) + ๐(๐ข, ๐ฆ) // update the estimated upper bound ๐ ๐ข ๐น ๐ธ = ๐ฝ โ ๐น 29