notes finallyadd to the predecessor list now defines the shortest path from each node to dijkstra' algorithm initialise and pifor each vertex in vg [ :infinity pi[ :nil [ : set to empty : : (gwhile ( -sis not nullwhile not empty( sort the vertices in - according to the current best estimate of their distance from the source :extract-min ) add vertex uthe closest vertex in -sto saddnodesu ) relax all the vertices still in - connected to relaxnode unode vdouble [][if [vd[uw[ ]vthen [ : [uw[ ][vpi[ : in summarythis algorithm starts by assigning weight of infinity to all verticesand then selecting source and assigning weight of zero to it vertices are added to the set for which shortest paths are known when vertex is selectedthe weights of its adjacent vertices are relaxed once all vertices are relaxedtheir predecessor' vertices are updated (pithe cycle of selectionweight relaxation and predecessor update is repeated until the shortest path to all vertices has been found summary heap is partially sorted binary tree although heap is not completely in orderit conforms to sorting principleevery node has value less (for the sake of simplicityi will assume that all orderings are from least to greatestthan either of its children lovely professional university