### MINIMUM SPANNING TREES STUDY GUIDE

Definition of edge-weighted graph and MST.

• What is a spanning tree?
• What is a minimum spanning tree?
• How many edges are in a (minimum) spanning tree of a graph with V vertices?
• Why do we make the simplifying assumptions that the graph is connected and the edge weights are distinct?

Cuts.

• What is a cut?
• How many cuts are there for a graph with V vertices?
• Cut property: given a cut, the crossing edge of minimum weight belongs to the MST. This is the most important point of this lecture, and you should be very familiar with the proof.

Manually performing Kruskal's and Prim's algorithms. These are easy and you should be able to do them even under the influence of powerful sedatives.

Why Kruskal's and Prim's algorithms work.

• Kruskal's algorithm is a special case of the generic greedy algorithm.
• Prim's algorithm is a special case of the generic greedy algorithm.

Implementing Kruskal's and Prim's algorithms.

• What sort of data do we track in Kruskal's algorithm, and what data structures do we use to track this data?
• What is the running time for typical implementations of these data structures?
• What sort of data do we track in Lazy Prim's algorithm, and what data structures do we use to track this data?
• What is the running time for typical implementations of these data structures?
• For Eager Prim's, why do we track vertices instead of edges? What does this do to our space requirements?
• What is the special data structure that we use to track vertices and their best known distance?
• How do we change the priority of a vertex using this special data structure (you should be able to give an example of a method call)?

### Recommended Problems

#### C level

1. Spring 08 Final, #2a, #2b
2. Fall 08 Final, #2a, #2b
3. Fall 09 Final, #1b
4. Fall 09 Final, #3a, #3c
5. Fall 10 Final, #4a, #4b
6. Fall 10 Final, #3a, #3b
7. Spring 12 Final, #4a, #4b
8. Would Kruskal's or Prim's algorithm work with edge-weighted digraphs?

#### B level

1. Fall 09 Final, #3b
2. Fall 12 Final, #4a, #4b, #4c, #4d
3. Textbook 4.3.8 - this is a particularly handy concept!
4. Textbook 4.3.12
5. Textbook 4.3.13
6. Textbook 4.3.20
7. True or False: Given any two components that are generated as Kruskal's algorithm is running (but before it has completed), the smallest edge connecting those two components is part of the MST.
8. Textbook 4.3.19 - to be clear, for each vertex v, we maintain edgeTo[v] and distTo[v] and to find the nontree vertex with the smallest distTo[], we scan through the entire distTo[] array.

#### A level

1. Spring 08 Final, #3
2. Fall 09 Final, #3d
3. Textbook 4.3.26

#### Just for fun

1. Figure out if Kruskal's, Prim's Lazy, or Prim's Eager algorithm are faster on "typical" graphs. Use the code from the booksite.