algorithm shortestpath(gs)inputa weighted graph with nonnegative edge weightsand distinguished vertex of outputthe length of shortest path from to for each vertex of initialize [ and [vfor each vertex  let priority queue contain all the vertices of using the labels as keys while is not empty do {pull new vertex into the cloudu value returned by remove min(for each vertex adjacent to such that is in do {perform the relaxation procedure on edge (uv)if [uw(uvd[vthen [vd[uw(uvchange to [vthe key of vertex in return the label [vof each vertex code fragment pseudo-code for dijkstra' algorithmsolving the singlesource shortest-path problem bwi pvd jfk dfw lax sfo ord dfw lax pvd jfk sfo bos ord bos bwi mia mia ( (bfigure an execution of dijkstra' algorithm on weighted graph the start vertex is bwi box next to each vertex stores the label [vthe edges of the shortest-path tree are drawn as thick arrowsand for each vertex outside the "cloudwe show the current best edge for pulling in with thick line (continues in figure