Skip to main content

Chapter 28 Minimum Spanning Trees

Exercises Practice Problems

1. Prim's Algorithm.

Prim's Algorithm "grows a minimum edge into a MST." Given weighted graph \(G=(V,E)\text{:}\)

  • Initialize \(T\) to be a vertex \(v\)

  • At each step, grow the tree:

    • Add the minimum weight edge adjacent to \(T\) that doesn't create a cycle.

  • Stop when you can't add more edges.

Use Prim's Algorithm to find the MST of the following weighted graph.

2. Kruskal's Algorithm.

Kruskal's Algorithm grows a minimum forest until it is a MST. Given weighted graph \(G=(V,E)\text{:}\)

  • Initialize \(T\) to contain all the vertices of \(G\text{,}\) but no edges.

  • At each step, grow the forest:

    • Add the minimum weight edge to \(T\) that doesn't create a cycle.

  • Stop when you can't add more edges.

3. MST Examples.

Give an example of a weighted graph on 6 vertices that \(\ldots\)

  1. has a unique minimum spanning tree.

  2. has exactly 2 minimum spanning trees.

  3. has more than 2 minimum spanning trees.

4. A Minimum Edge.

Let \(G=(V,E)\) be a weighted graph.

  1. Suppose that \(G\) contains a unique edge \(e\) of minimum weight in \(G\text{.}\) Prove that \(e\) is contained in every minimum spanning tree of \(G\text{.}\)

  2. Suppose that \(G\) contains an edge \(e\) such that for every cycle \(C\) containing \(e\text{,}\) the weight \(w(e)\) is smaller than all the other edge weights in \(C-e\text{.}\) Prove that \(e\) is contained in every minimum spanning tree of \(G\text{.}\)

5. Minimum Spanning Forest.

Extend the concept of a minimum spanning tree to a disconnected, weighted graph. Define a "minimum spanning forest" and describe how you would find it.