Minimum Spanning Tree
Minimum Spanning Tree
Spanning
Tree
Tyler Bert N. Baring
BSCS - IV
Table of
Definition
01 What is Minimum Spanning
Tree (MST)?
Contents
History
02 A brief history of MST
Algorithm Illustration
03 Actual Algorithm Illustration
of MST
Design Technique
04 Algorithm Design Technique
used
Table of
Running Time
05 Time complexity Contents
Application
06 Where this algorithm is used
References
07 Sources
Brief History
Czech scientist Otakar Borůvka
developed the first known algorithm for Edsger Wybe Dijkstra rediscovered it
finding a minimum spanning tree, in in 1959, and called it Prim's algorithm.
1926. He wanted to solve the problem of The other algorithm is called Kruskal's
finding an efficient coverage of Moravia algorithm, and was pulbished by
with electricity. Today, this algorithm is Joseph Kruskal in 1956. All three
known as Borůvka's algorithm. algorithms are greedy, and run in
polynomial time.
1 2 3 4
Reference
Step 2
Reference
Step 3
Reference
Step 4
Reference
Step 5
Reference
Step 6
Reference
Step 7
Reference
Weight of the MST
= Sum of all edge weights
= 10 + 25 + 22 + 12 + 16 + 14
= 99 units
Algorithm Design Technique
01 02
Time Complexity-
Worst case time complexity of • The edges are maintained as min
Kruskal’s Algorithm heap.
= O(ElogV) or O(ElogE) • The next edge can be obtained in
O(logE) time if graph has E edges.
• Reconstruction of heap takes O(E)
time.
Special Case • So, Kruskal’s Algorithm takes
• E is at most and
• Each isolated vertex is a separate component of the minimum spanning forest. If we ignore isolated
vertices we obtain V ≤ 2E, so log V is
We can achieve this bound as follows: first sort the edges by weight using a comparison sort in O(E log E)
time; this allows the step "remove an edge with minimum weight from S" to operate in constant time. Next,
we use a disjoint-set data structure to keep track of which vertices are in which components. We place each
vertex into its own disjoint set, which takes O(V) operations. Finally, in worst case, we need to iterate
through all edges, and for each edge we need to do two 'find' operations and possibly one union. Even a
simple disjoint-set data structure such as disjoint-set forests with union by rank can perform O(E) operations
in O(E log V) time. Thus the total time is O(E log E) = O(E log V).
For a detailed explanation of the example, click here
https://bit.ly/3VjFJWR
Application
Minimum spanning trees have direct applications in the design of networks, including computer networks,
telecommunications networks, transportation networks, water supply networks, and electrical grids. They are
invoked as subroutines in algorithms for other problems, including the Christofides algorithm for
approximating the traveling salesman problem, approximating the multi-terminal minimum cut problem (which
is equivalent in the single-terminal case to the maximum flow problem),[19] and approximating the minimum-
cost weighted perfect matching.
● Running Time –
https://en.wikipedia.org/wiki/Kruskal's_algorithm#Complexity
● Application – https://bit.ly/3giYY3e