enter the source the edges of the minimum spanning tree are the total cost of the minimum spanning tree is dijkstra' algorithm dijkstra' algorithmgiven by dutch scientist edsger dijkstra in is used to find the shortest path tree this algorithm is widely used in network routing protocolsmost notably is-is and ospf (open shortest path firstgiven graph and source node athe algorithm is used to find the shortest path (one having the lowest costbetween (source nodeand every other node moreoverdijkstra' algorithm is also used for finding the costs of the shortest paths from source node to destination node for exampleif we draw graph in which nodes represent the cities and weighted edges represent the driving distances between pairs of cities connected by direct roadthen dijkstra' algorithm when applied gives the shortest route between one city and all other cities algorithm dijkstra' algorithm is used to find the length of an optimal path between two nodes in graph the term optimal can mean anythingshortestcheapestor fastest if we start the algorithm with an initial nodethen the distance of node can be given as the distance from the initial node to that node figure explains the dijkstra' algorithm select the source node also called the initial node define an empty set that will be used to hold nodes to which shortest path has been found label the initial node with and insert it into repeat steps to until the destination node is in or there are no more labelled nodes in consider each node that is not in and is connected by an edge from the newly inserted node (aif the node that is not in has no label then set the label of the node the label of the newly inserted node the length of the edge (belse if the node that is not in was already labelledthen set its new label minimum (label of newly inserted vertex length of edgeold label pick node not in that has the smallest label assigned to it and add it to figure dijkstra' algorithm dijkstra' algorithm labels every node in the graph where the labels represent the distance (costfrom the source node to that node there are two kinds of labelstemporary and permanent temporary labels are assigned to nodes that have not been reachedwhile permanent labels are given to nodes that have been reached and their distance (costto the source node is known node must be permanent label or temporary labelbut not both the execution of this algorithm will produce either of the following two results if the destination node is labelledthen the label will in turn represent the distance from the source node to the destination node if the destination node is not labelledthen there is no path from the source to the destination node