Graph Theory: The Diagram Of Kruskal's Algorithth Theory

1900 Words4 Pages

0.1 abstract
In a graph theory the shortest path problem is nding a minimum path and distance between two vertices.The ap- plication in many areas of shortest path algorithms are such as geographical rout- ing, transportation, computer vision and
VLSI design involve solving optimiza- tion problems on large planar graphs.
To calculate the shortest path we need to know some algorithms like Kruskal's algorithm,Prim's algorithm,Dijkstra's algorithm,BellmanFord's algorithm.
These algorithms have some advantages and limitations.Kruskal algorthm uses simpler data structures and so performs better in typical situations. If the edges are sorted in linear time, or are already sorted, Kruskal can have better perfor- mance.Prim's algorithm is signi cantly …show more content…

S(7)+A(3)+C(3)+D(2)+T(0)=15
Figure 1: Diagram of Kruskal's Algo- rithm and Prim's Algorithm
Dijkstra's Algorithm: Dijkstras al- gorithm is very similar to Prims al-
3
gorithm for minimum spanning tree.
Like Prims MST, we generate a SPT
(shortest path tree) with given source as root. We maintain two sets, one set contains vertices included in shortest path tree, other set includes vertices not yet included in shortest path tree.
At every step of the algorithm, we nd a vertex which is in the other set (set of not yet included) and has minimum distance from source.[5] It cannt per- form with negative edge
1(2)+3(2)+2(3)+4(2)+5(5)+
7(2)+8(3)+6(4)+9(0)=23
Figure 2: Diagram of Dijkstra's Algo- rithm Bellman-Ford Algorithm: Like Di- jkstra's shortest path algorithm, the
Bellman-Ford algorithm is guaranteed to nd the shortest path in a graph.
Though it is slower than Dijkstra's al- gorithm, Bellman-Ford is capable of handling graphs that contain negative edge weights, so it is more versatile. It is worth noting that if there exists a negative cycle in the graph, then there is no shortest path. Going around the negative cycle an in nite number of times would continue to decrease …show more content…

Because of this,
Bellman-Ford can also detect negative cycles which is a useful feature. This algorithm can be used on both weighted and unweighted

More about Graph Theory: The Diagram Of Kruskal's Algorithth Theory

Open Document