Solution:Prim's Algorithm :-It is used to find the minimum spanning tree for a weighted undirected graph. It uses greedy approach to find the MST for a graph. Unlike the Kruskal's algorithm, we add vertex to growing spanning tree in this. It there are v vertices and E edges in the graph. Then time complexity to for MST is O(E log V)
Dijkstra's Algorithm :-
It is used to find the shortest path from source vertex to all other vertices in a graph. Initially, distance from source to source is considered as O and to all other vertices is infinity. It uses the condition "current vertex distance edge weight < next vertex distance" to find shortest distance. Time complexity for this is O(v² )
Faster all pair shortest path : It finds shortest the distance from a vertex to all other vertices in a graph. It there are E edges and V vertices in a graph, then it takes
O (v² log v) time to find the shortest path.
Edmonds-Karp algorithm :- It is used to find the maximum flow in a network. It uses BFS in ford fulkerson method. It time complexity is O(V.E² )