0 Abstract

This is a very simple and naive survey on M(Minimum) S(Spanning) T(Tree) problem. This problem is a widely researched and extremely important combinatorial problem, which has significant influences on all kinds of fields such as computer architecture allocation, transportation, express logistics, to name but a few. Also, a MST can also provide bounds (lower bound and 2-approximation upper bound if given triangle inequality) for Travelling Salesman Problem. Here I will introduce some classical algorithms and several modern and asymptotically better algorithms as well as parallel algorithms.

1 Introduction

In a network composed of nodes and arcs with costs, a spanning tree is a acyclic subgraph connecting all the nodes together. A minimum spanning tree is the spanning tree with minimum cost on the network. That is it is the spanning tree with the least sum of the costs of all the edges.
Finding the minimum spanning tree is useful is several different applications. Perhaps the most direct application is designing physical systems like road system. For example, consider isolated villages that need to be connected with roads. We need to ensure that each village has at least one way to go to any other villages. Obviously, we also want the total construction cost to be minimum, and this forms a MST problem. We can easily come up with other ideas and situations needing the aid of MST.
Another application of the minimum spanning tree problem is cluster analysis. Suppose that we have a network and want to split the network into k different clusters such that the total cost of all the clusters is minimized. We can take the minimum spanning tree and delete the k−1 arcs with the highest cost. The result is a forest of k trees with minimal cost.
We can see that the above two examples respectively correspond to adding edges and deleting edges. We will then show that both adding and deleting edges are important with respect to MST problem. They are important in finding a MST and using MST to solve a practical problem.

2 Basic Principle

:::info [Definition 1] Fundamental Cutset
For a graphSimple and Naive Survey on MST - 图1two distinct vertices saySimple and Naive Survey on MST - 图2andSimple and Naive Survey on MST - 图3, letSimple and Naive Survey on MST - 图4be any subset of vertices that contains
Simple and Naive Survey on MST - 图5but notSimple and Naive Survey on MST - 图6and letSimple and Naive Survey on MST - 图7be its complement, then setSimple and Naive Survey on MST - 图8is aSimple and Naive Survey on MST - 图9and the set of edgesSimple and Naive Survey on MST - 图10is called a Simple and Naive Survey on MST - 图11. The removal of the arcs in a Simple and Naive Survey on MST - 图12leaves a disconnected subgraph ofSimple and Naive Survey on MST - 图13. Corresponding to each edgeSimple and Naive Survey on MST - 图14of a spanning treeSimple and Naive Survey on MST - 图15of a connected graphSimple and Naive Survey on MST - 图16, there is a unique cutset called thefundamental cutsetof the treeSimple and Naive Survey on MST - 图17with respect to edgeSimple and Naive Survey on MST - 图18. ::: We will then show that this definition has much to do with adding edges. :::info [Definition 2] Fundamental Circle
Given a graphSimple and Naive Survey on MST - 图19, a spanning treeSimple and Naive Survey on MST - 图20and a co-tree edge Simple and Naive Survey on MST - 图21, the unique cycle inSimple and Naive Survey on MST - 图22 consisting of the edgeSimple and Naive Survey on MST - 图23and the edges of the unique chain inSimple and Naive Survey on MST - 图24betweenSimple and Naive Survey on MST - 图25andSimple and Naive Survey on MST - 图26is called
afundamental cycleofSimple and Naive Survey on MST - 图27relative toSimple and Naive Survey on MST - 图28with respect toSimple and Naive Survey on MST - 图29. ::: We will then show that this definition has much to do with deleting edges.

[Theorem 1] Fundamental Cut Optimality A spanning treeSimple and Naive Survey on MST - 图30in a weighted graph is a MST if and only if every edge in the tree is a minimum weight edge in thefundamental cutsetdefined by that edge.

Proof:
the weight of edgeSimple and Naive Survey on MST - 图31is noted asSimple and Naive Survey on MST - 图32.
1’ MST==>Cut Opt: This can be proved by contradiction. SupposeSimple and Naive Survey on MST - 图33is a minimum spanning tree violating Cut Opt, then there are two edgesSimple and Naive Survey on MST - 图34andSimple and Naive Survey on MST - 图35 such thatSimple and Naive Survey on MST - 图36. Then replacing Simple and Naive Survey on MST - 图37withSimple and Naive Survey on MST - 图38would yield a lower cost spanning tree.
2’ Cut Opt==>MST: Contradiction again. SupposeSimple and Naive Survey on MST - 图39satisfies the cut optimality conditions, butSimple and Naive Survey on MST - 图40is not a minimum spanning tree. That is, there exists a treeSimple and Naive Survey on MST - 图41that is a minimum spanning tree. Then, sinceSimple and Naive Survey on MST - 图42is not a minimum spanning tree, it must have an edgeSimple and Naive Survey on MST - 图43not contained inSimple and Naive Survey on MST - 图44. Deleting edgeSimple and Naive Survey on MST - 图45fromSimple and Naive Survey on MST - 图46 creates a cutSimple and Naive Survey on MST - 图47. Adding one edge to a tree will form and only form one circle. Assume we addSimple and Naive Survey on MST - 图48to Simple and Naive Survey on MST - 图49then we will get a circleSimple and Naive Survey on MST - 图50. SinceSimple and Naive Survey on MST - 图51, there must be an edgeSimple and Naive Survey on MST - 图52in circleSimple and Naive Survey on MST - 图53such thatSimple and Naive Survey on MST - 图54. According to Cut Opt we know thatSimple and Naive Survey on MST - 图55 , and also we haveSimple and Naive Survey on MST - 图56becauseSimple and Naive Survey on MST - 图57is a MST, which means that ifSimple and Naive Survey on MST - 图58then we can replaceSimple and Naive Survey on MST - 图59withSimple and Naive Survey on MST - 图60yielding a less cost tree. Having the both inequalities, we know thatSimple and Naive Survey on MST - 图61. Then we just replaceSimple and Naive Survey on MST - 图62freely withSimple and Naive Survey on MST - 图63making a new MST (the total cost doesn’t change, so it’s still a MST) . Following this process, we can gradually changeSimple and Naive Survey on MST - 图64intoSimple and Naive Survey on MST - 图65, which means thatSimple and Naive Survey on MST - 图66is already a MST.

[Theorem 2] Fundamental Circle Optimality A spanning treeSimple and Naive Survey on MST - 图67in a graphSimple and Naive Survey on MST - 图68is a MST if and only if every edgeSimple and Naive Survey on MST - 图69is a maximum weight edge in the uniquefundamental cycledefined by that edge.

Proof:
1’ MST==>Circle Opt: This can also be proved by contradiction. Assume that there exists a MSTSimple and Naive Survey on MST - 图70violating Fundamental Circle Optimality, which means that there is an edgeSimple and Naive Survey on MST - 图71weighing less than one edgeSimple and Naive Survey on MST - 图72in the fundamental cycledefined bySimple and Naive Survey on MST - 图73. Then we could delete edgeSimple and Naive Survey on MST - 图74and add edgeSimple and Naive Survey on MST - 图75, then we can get a new treeSimple and Naive Survey on MST - 图76with less cost. This conflictst with the assumption thatSimple and Naive Survey on MST - 图77is a MST.
2’ Circle Opt==>MST: This can be proved with the help of Theorem 1. It’s obvious that if a tree doesn’t hold Cut Opt, then it will not hold Circle Opt either. So we know that: Circle Opt==>Cut Opt. Then we have: Circle Opt==>Cut Opt==>MST using Theorem 1.
This is my personal proof, and here is an another much more elegant proof in [1].

Blue Rule: Select a cutset that does not contain a blue edge. Among the uncoloured edges in the cutset, select one of minimum weight and colour it blue.

Red Rule: Select a simple cycle containing no red edges. Among the uncoloured edges on the cycle, select one of maximum weight and colour it red.

These two rules are proposed in Tarjan’s book[3], and elaborately illustrated by tutorial slides[2]. Since we already proved these two optimality conditions, these two rules can be immediately derived.
Both red rules and blue rules can be used for the construction of MST, but in practice, we usually use blue rule. The most well known algorithms including Prim, Kruskal and Sollin’s algorithm are all using blue rule.

3 Details of Classical Algorithm

3.1 Sollin’s (Boruvka’s) Algorithm

More commonly known as Boruvka’s algorithm, Sollin’s algorithm was the first algorithm for the minimum spanning tree problem. Borukva first published his algorithm in 1926 which he designed as a way of constructing an efficient electricity network in Moravia, a region of the Czech Republic. He published two papers in the same year with this algorithm. One was 22 pages and has been viewed as unnecessarily complicated. The other was a one page paper that has been regarded as the key paper showing Boruvka’s understanding and knowledge of the problem.
It was then independently rediscovered in 1938 by French mathematician Gustave Choquet, and finally rediscovered in 1962 by Georges Sollin.
We have introduced this algorithm in our lectures, so here I will not elaborately illustrate it. Each time we choose an edge with lowest cost from all edges incident to a component. We then add these edges into the graph and form a new graph with less components. It’s obvious that this algorithm is using blue rules to add edges.
The time complexity isSimple and Naive Survey on MST - 图78.

3.2 Prim Algorithm

This algorithm is so classical that almost everyone will be taught with this algo when learning MST for the first time. It use an arbitrary starting vertexSimple and Naive Survey on MST - 图79and apply the color stepSimple and Naive Survey on MST - 图80times. The color step is that: LetSimple and Naive Survey on MST - 图81be the blue tree containing the vertexSimple and Naive Survey on MST - 图82. Select a minimum weight edge incident toSimple and Naive Survey on MST - 图83and colour it blue.
There are many ways to implement Prim algorithm, with different time complexity. The difference lies in the way we select the minimum-weight edge. If we simply go through all the edges, then the time complexity would beSimple and Naive Survey on MST - 图84. If we use binary heap and adjacent list, the time complexity would beSimple and Naive Survey on MST - 图85. If we use Fibonacci heap, the time complexity would beSimple and Naive Survey on MST - 图86. If we use d-heap, which is a general case of binary heap and an implementation of priority queue, the time complexity would beSimple and Naive Survey on MST - 图87. If we properly chooseSimple and Naive Survey on MST - 图88, we can always get a satisfying algorithm for both dense graph and sparse graph (if dense, use a large d; if sparse, use a small d).

3.3 Kruskal Algorithm

This algorithm is easy to implement and very suitable for competitive programming contests, so many competitors are very familiar with this algorithm. And its algorithm process can be a proof to many properties. The time complexity isSimple and Naive Survey on MST - 图89. This algorithm is also using blue rule, each time picking up the minimum-weight edge. If the edges are already sorted for us, then the time complexity could beSimple and Naive Survey on MST - 图90, whereSimple and Naive Survey on MST - 图91is the inverse Ackermann’s function. This is because we are using union-and-find. To be honest, I didn’t understand the proof of the time complextiy of union-and-find, here I’m just using the result provided by Wikipedia.

4 Not That Well-Known Algorithm

We learned two not that well-known algorithms in this class: Yao algorithm and Cheriton-Tarjan algorithm. They are adapted from Sollin’s algorithm, using smarter way to select the minimum-weight edge.

4.1 Yao Algorithm

This is an algorithm proposed by Qizhi Yao. It is on the basis of another algorithm finding the median with deterministic linear time[8]. Assume that we already know how to find the median in linear time, then we can refine Sollin’s algorithm by grouping edges. In Sollin’s, we need to go through every edge to find the one with minimum weight. However, we know that some edges with large weight should not be considered in the early stages.
Consider dividing all the edges intoSimple and Naive Survey on MST - 图92groups, then we each time only need to go through the edges within the group. Then the time complexity isSimple and Naive Survey on MST - 图93. Then what is the time complexity of dividing edges intoSimple and Naive Survey on MST - 图94groups such that edges inSimple and Naive Survey on MST - 图95group have larger weight than these inSimple and Naive Survey on MST - 图96group? We each time find the median and divide the set into two parts, and then recurssively go down in these two smaller subset. It’s obvious that the dividing time isSimple and Naive Survey on MST - 图97. Then using simple calculus knowledge we can that whenSimple and Naive Survey on MST - 图98the formulaSimple and Naive Survey on MST - 图99gets its minimum:Simple and Naive Survey on MST - 图100.

4.2 Cheriton-Tarjan Algorithm

The full algorithm[5] is very complex, here is the key point: A heap is kept for each blue tree. Each heap holds the edges with at least one endpoint in the tree and which are candidates for becoming blue. Similar to Kruskal’s algorithm, it grows a spanning forest, beginning with a forest ofSimple and Naive Survey on MST - 图101components each consisting of a single node. Since, every componentSimple and Naive Survey on MST - 图102must eventually be connected to another component, this algorithm keeps a separate heapSimple and Naive Survey on MST - 图103for each componentSimple and Naive Survey on MST - 图104, so, that initiallySimple and Naive Survey on MST - 图105smaller heaps are used. Initially,Simple and Naive Survey on MST - 图106will contain onlySimple and Naive Survey on MST - 图107edges, sinceSimple and Naive Survey on MST - 图108consists only of vertexSimple and Naive Survey on MST - 图109. WhenSimple and Naive Survey on MST - 图110andSimple and Naive Survey on MST - 图111 are merged,Simple and Naive Survey on MST - 图112andSimple and Naive Survey on MST - 图113must also be merged. This requires a modification of the data structures, since heaps cannot be merged efficiently. This is essentially because merging heaps reduces to building a new heap. It’s difficult to work out the precise time complexity, I still need some time to understand the original paper. Here I just use the result provided by the paper, that the time complexity isSimple and Naive Survey on MST - 图114.
In Cheriton and Tarjan’s paper, they also proposed an algorithm for planar graph with time complexitySimple and Naive Survey on MST - 图115, and an algorithm for sparse graph with time complexitySimple and Naive Survey on MST - 图116.

5 Randomized Algorithm

5.1 Tarjan’s Expected Linear Time Algorithm

It was developed by David Karger, Philip Klein, and Robert Tarjan. So it is also known as Karger’s algorithm. The algorithm relies on techniques from Boruvka’s algorithm along with an algorithm for verifying a minimum spanning tree in linear time. It combines the design paradigms of divide and conquer algorithms, greedy algorithms, and randomized algorithms to achieve expected linear performance.
The key insight to the algorithm is a random sampling step which partitions a graph into two subgraphs by randomly selecting edges to include in each subgraph. The algorithm recursively finds the minimum spanning forest of the first subproblem and uses the solution in conjunction with a linear time verification algorithm to discard edges in the graph that cannot be in the minimum spanning tree. A procedure taken from Borůvka’s algorithm is also used to reduce the size of the graph at each recursion.
In more details, there are three steps in total: Boruvka step, random sampling step, and verification step.

  • Boruvka Step: Given a graphSimple and Naive Survey on MST - 图117, apply the Boruvka algorithm to carry out one coloring step only. And then contract the graphSimple and Naive Survey on MST - 图118and getSimple and Naive Survey on MST - 图119.
  • Random sampling step: Given a contracted graphSimple and Naive Survey on MST - 图120, choose a subgraphSimple and Naive Survey on MST - 图121by selecting each edge

inSimple and Naive Survey on MST - 图122independently with a probabilitySimple and Naive Survey on MST - 图123.

  • Verification step: Given any minimum spanning forestSimple and Naive Survey on MST - 图124ofSimple and Naive Survey on MST - 图125, find theSimple and Naive Survey on MST - 图126edges and delete them fromSimple and Naive Survey on MST - 图127to reduce the graph further. HereSimple and Naive Survey on MST - 图128means that the weight of an edgeSimple and Naive Survey on MST - 图129is larger than the weight of the path fromSimple and Naive Survey on MST - 图130toSimple and Naive Survey on MST - 图131in a forestSimple and Naive Survey on MST - 图132. It’s obvious that all theSimple and Naive Survey on MST - 图133edges will not appear in the final MST, so we can delete them.

The complete algorithm process is shown below:

  1. GivenSimple and Naive Survey on MST - 图134, apply two successive Boruvka steps to the graph to contractSimple and Naive Survey on MST - 图135.
  2. Apply the random sampling step to the contracted graph to selectSimple and Naive Survey on MST - 图136.
  3. Apply the algorithm recursively producing a minimum spanning forestSimple and Naive Survey on MST - 图137of theSimple and Naive Survey on MST - 图138formed in step 1
  4. GivenSimple and Naive Survey on MST - 图139ofSimple and Naive Survey on MST - 图140, apply the verification step to the subgraphSimple and Naive Survey on MST - 图141, which was chosen, and obtain

a graphSimple and Naive Survey on MST - 图142which is reduced further.

  1. Apply the algorithm recursively toSimple and Naive Survey on MST - 图143to compute the minimum spanning forestSimple and Naive Survey on MST - 图144ofSimple and Naive Survey on MST - 图145.
  2. Return those edges contracted in step 1 together with the edges ofSimple and Naive Survey on MST - 图146.

The time complexity relies on two properties:

Property 1 LetSimple and Naive Survey on MST - 图147be a subgraph obtained fromSimple and Naive Survey on MST - 图148by including each edge independently with probabilitySimple and Naive Survey on MST - 图149, and letSimple and Naive Survey on MST - 图150be the minimum spanning forest ofSimple and Naive Survey on MST - 图151. The expected number ofSimple and Naive Survey on MST - 图152edges inSimple and Naive Survey on MST - 图153is at mosSimple and Naive Survey on MST - 图154whereSimple and Naive Survey on MST - 图155is the number of vertices.

Property 2 We can do the verification step in deterministic linear time with the algorithm[9] proposed by V. King.

Both properties need further research and more time, I will get it through soon.
The expected running time isSimple and Naive Survey on MST - 图156and it runs inSimple and Naive Survey on MST - 图157time with probabilitySimple and Naive Survey on MST - 图158.
In the worst case, it will be equivalent to Boruvka’s algorithm, so the worst time complexity isSimple and Naive Survey on MST - 图159.

6 Parallel Algorithms

The performance comparison of these sequencial algorithms is basically of no use, because in reality, we will never use one processer to handle a large-scale problem. And this is also the reason why parallel algorithms are getting more and more popular. All the classical algorithms illustrated above can be adapted into parallel version.

6.1 Prim Parallel Version

Prim algorithm has the least parallelism possiblity. Because each time we need to update the distance vecter, which can’t be paralleled, since each element can’t be changed by two processes. What we can do is that: we can use paralleled priority queue with insert time complexity ofSimple and Naive Survey on MST - 图160.

6.2 Kruskal Parallel Version

There are two ways to parallelize the Kruskal algorithm. The first is to parallelize the sorting stage. We know that in Kruskal algorithm, we need to sort all the edges by their weight, which could be parallelized. We can sortSimple and Naive Survey on MST - 图161elements inSimple and Naive Survey on MST - 图162time withSimple and Naive Survey on MST - 图163processors. So the total time would beSimple and Naive Survey on MST - 图164. The second way is to parallelize an adaptation of Kruskal algorithm, which is named Filter-Kruskal algorithm[10].

6.3 Sollin Parallel Version

In Sollin’s process, we have three stages. The first stage is finding the lightest edge, which can be parallelized; the second stage is to go through each subgraph, which can be parallelized; the third stage is to contract the graph, which can be parallelized. The respective time complexity isSimple and Naive Survey on MST - 图165.

7 Other Applicatioins and Properties

There are so many different variations about MST, coming up with different graceful properties. We can impose some edges, which means that these edges must be in MST, and then construct the MST; We can add a new vertex and the incident edges and find the new MST based on the previous MST, which is one of our homework problems; We can delete one vertex and find the new MST; We can change the weight of one edge and find the MST; We can get linear time approxiamations on MST, to name but a few.
Here I will introduce some simple properties:

  1. Given a graph with its MST, and a new vertex with its incident edges, we can find the new MST inSimple and Naive Survey on MST - 图166time. This is based the observation: the new MST will only contain the newly added edges and the edges in the original MST.
  2. Given a graph with its MST, and a deleted vertex, we can also ensure that the new MST will consist all the edges in the previous MST except for these deleted ones.
  3. Add a constant to the weight of every vertex will not change the MST.
  4. Change the weight of an edge, there are four cases in total. If we decrease the edge in MST, remains the same; If we increase the edge not in MST, remains the same; If we increase the edge in MST, we just needSimple and Naive Survey on MST - 图167time to find the new edge connecting the two components; If we decrease the edge not in MST, we just need to find the circle inSimple and Naive Survey on MST - 图168, if the decreased weight is smaller than any edge in that circle, we can do a substitution.
  5. There might be many MSTs in a graph, but all the MSTs have the same edges-weight-set, which means that: if we only focus on the weight of the edges in MST, then the sorted array of the weights of the edges in any MST is the same.

    8 Reference

    [1] Slides about MST and cut optimality and path optimality conditions https://copland.udel.edu/~amotong/teaching/algorithm%20design/lectures/(Lec%2012)%20Greedy%20Strategy%20-%20Minimum%20Spanning%20Tree%20-%20Optimality%20Condition.pdf%20Greedy%20Strategy%20-%20Minimum%20Spanning%20Tree%20-%20Optimality%20Condition.pdf)

[2] Slides about MST and blue rule and red rule
https://www.cs.princeton.edu/~wayne/cs423/lectures/mst.pdf

[3] Tarjan RE. Data structures and network algorithms. In CBMS-NFS Regional Conference Series in Applied Mathematics. Philadelphia: Society for Industrial and Applied Mathematics, 1983. p. 44.
https://www.amazon.com/Structures-Algorithms-CBMS-NSF-Conference-Mathematics/dp/0898711878
(This is a book, so it’s the link of the book on Amazon)

[4] Johnson DB. Priority queues with update and “finding minimum spanning trees. Information Processing Letters 1975;4:53}7.
https://www.sciencedirect.com/science/article/abs/pii/0020019075900010
ZJU didn’t subscribe to this journel, pity.

[5] FINDING MINIMUM SPANNING TREES, DAVID CHERITON AND ROBERT ENDRE TARJAN
https://epubs.siam.org/doi/pdf/10.1137/0205051

[6] Improved Multiple Constant Multiplication Using a Minimum Spanning Tree
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1399088

[7] Imposing edges in Minimum Spanning Tree
https://arxiv.org/pdf/1912.09360.pdf

[8] Linear Time Median Finding: https://rcoh.me/posts/linear-time-median-finding/

[9] A Simpler Minimum Spanning Tree Verification Algorithm
https://www.cs.princeton.edu/courses/archive/fall03/cs528/handouts/A%20Simpler%20Minimum%20Spanning.pdf

[10] The Filter-Kruskal Minimum Spanning Tree Algorithm
http://algo2.iti.kit.edu/documents/fkruskal.pdf