Académique Documents
Professionnel Documents
Culture Documents
A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest
possible sum of weights of its edges.
Prim’s Algorithm
• Begin by choosing any edge with smallest weight, putting it into the spanning tree.
• Successively add to the tree edges of minimum weight that are incident to a vertex already
in the tree, never forming a simple circuit with those edges already in the tree.
Kruskal’s Algorithm
• Successively add edges with minimum weight that do not form a simple circuit with those
edges already chosen.
1
ICS 241: Discrete Mathematics II (Spring 2015)
Use Prim’s algorithm to find a minimum spanning tree for the given weighted graph.
Use Kruskal’s algorithm to find a minimum spanning tree for the weighted graph in Exercise 3.