Graph Analysis - Minimum spanning forest


Minimum spanning forest



Application: Design hot-water delivery network for the university campus:

  • Network must achieve same connectivity as input graph.
  • An edge represents a possible pipe.
  • Weight of edge is cost of installing the pipe.
  • Goal: minimize total cost.


def Grow(G)
   S := 0; 
   consider the edges in increasing order # Increasing order: 2, 3, 4, 5, 6, 7, 8, 9.
   for each edge e:
      if e’s endpoints are not yet connected
           add e to S.


def Shrink(G)
   S = {all edges} consider the edges in order, from highest-weight to lowest-weight # Decreasing order: 9, 8, 7, 6, 5, 4, 3, 2.
   for each edge e:
   if every pair of nodes are connected via S -{e}:
       remove e from S.

Powered by ComboStrap