next up previous
Next: Up: Previous:

Growing a Minimal Spanning Tree

Greedy approach

Given A $\subseteq$ T = MST(G), determine a safe edge (u,v) to add to A such that A $\cup$ {(u,v)} $\subseteq$ T

Greedy-MST(G,w)
$\;\;\;\;\;$A = {}
$\;\;\;\;\;$while A is not a spanning tree $\;\;\;\;\;$ $\;\;\;\;\;$; includes all vertices of G
$\;\;\;\;\;$ $\;\;\;\;\;$find a safe edge (u,v) for A
$\;\;\;\;\;$ $\;\;\;\;\;$A = A $\cup$ {(u,v)}
$\;\;\;\;\;$return A



What is a ``safe'' edge?

A safe edge is an edge connecting a vertex in A $\subseteq$ T to a vertex in G that is not in A such that A $\cup$ safe edge $\subseteq$ MST.


next up previous
Next: Up: Previous: