With VV as the number of vertices in our graph, the time complexity for Dijkstra's algorithm isO(V2)O(V2)The reason why we get this time complexity is that the vertex with the lowest distance must to be search for to choose the next current vertex, and that takes O(V)O(V) time....
Noshita K,Masuda E,Machida H.On the expected behaviors of the Dijkstra’s shortest path algorithm for complete graphs.Information Processing Letters. 1978NOSHITA K,MASUDA E,MACHIDA H. On the ex- pected behaviors of the Dijkstra's shortest paths algo- rithm for complete graph [J]. ...
// Implementation of Dijkstra's algorithm for graph (adjacency matrix) void algo_dijkstra(int graph[][], int src_node) { int path_array[] = new int[num_Vertices]; // The output array. dist[i] will hold // the shortest distance from src to i // spt (shortest path set) contains ...