MINIMUM SPANNING TREES STUDY GUIDE


Definition of edge-weighted graph and MST.

Cuts.

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.

Implementing Kruskal's and Prim's algorithms.

Recommended Problems

C level

  1. Consider the following weighted graph.

    Give the list of edges in the MST in the order that Kruskal's algorithm includes them.
    Give the list of edges in the MST in the order that Prim's algorithm includes them. Start Prim's algorithm from vertex A. Answers
  2. Consider the following undirected weighted graph.

    Give the list of edges in the MST in the order that Kruskal's algorithm includes them.
    Give the list of edges in the MST in the order that Prim's algorithm includes them. Start Prim's algorithm from vertex F. Answers
  3. Consider the following undirected weighted graph.

    Give the list of edges in the MST in the order that Kruskal's algorithm includes them.
    Give the list of edges in the MST in the order that Prim's algorithm includes them. Start Prim's algorithm from vertex A. Answers
  4. Spring 12 Final, #4a, #4b
  5. Would Kruskal's or Prim's algorithm work with edge-weighted digraphs?

B level

  1. Using the weighted undirected graph from C level #3, suppose that the edge D - I of weight w is added to the graph. For which values of w is the edge D - I in a MST? Answers
  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. You are given an edge-weighted undirected graph, using the adjacency list representation, together with the list of edges in its minimum spanning tree (MST). Describe an efficient algorithm for updating the MST, when each of the following operations is performed on the graph. Assume that common graph operations (e.g., DFS, BFS, finding a cycle, etc.) are available to you, and don't describe how to re-implement them.
    1. Update the MST when the weight of an edge that was not part of the MST is decreased. Give the order-of-growth running time of your algorithm as a function of V and/or E.
    2. Update the MST when the weight of an edge that was part of the MST is decreased. Give the order-of-growth running time of your algorithm as a function of V and/or E.
    3. Update the MST when the weight of an edge that was not part of the MST is increased. Give the order-of-growth running time of your algorithm as a function of V and/or E.
    4. Update the MST when the weight of an edge that was part of the MST is increased. Give the order-of-growth running time of your algorithm as a function of V and/or E.
    Answers
  2. Given a minimum spanning tree T of a weighted graph G , describe an O ( V ) algorithm for determining whether or not T remains a MST after an edge x - y of weight w is added Answers
  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.