/ start vertex ' /outputan array 'dof distances as explained above /we begin by buiding the distance overestimates [ /the shortest path from to itself has length zero for each vertex of the graph if is not the start vertex [zinfinity /this is certainly an overestimate /then we set up priority queue based on the overestimates create priority queue containing all the vertices of the graphwith the entries of as the priorities /then we implicitly build the path tree discussed above while priority queue is not empty /the next vertex of the path tree is called remove vertex with smallest priority from queue for each vertex in the queue which is adjacent to if [uweight[ ][zd[zd[zd[uweight[ ][ /lower overestimate exists change the priority of vertex in queue to [ /at this pointall entries of array 'dhold tight estimates if the priority queue is implemented as binary or binomial heapinitializing and creating the priority queue both have complexity ( )where is the number of vertices of the graphand that is negligible compared to the rest of the algorithm then removing vertices and changing the priorities of elements in the priority queue require some rearrangement of the heap tree by "bubbling up"and that takes (log nstepsbecause that is the maximum height of the tree removals happen (ntimesand priority changes happen (etimeswhere is the number of edges in the graphso the cost of maintaining the queue and updating is (( )log nthusthe total time complexity of this form of dijkstra' algorithm is (( )log nusing fibonacci heap for the priority queue allows priority updates of ( complexityimproving the overall complexity to ( nlog nin fully connected graphthe number of edges will be ( )and hence the time complexity of this algorithm is ( log nor ( depending on which kind of priority queue is used soin that casethe time complexity is actually greater than or equal to the previous simpler ( algorithm howeverin practicemany graphs tend to be much more