# MST - MST Many of the slides are from Prof. Plaisteds...

This preview shows pages 1–10. Sign up to view the full content.

MST Many of the slides are from Prof. Plaisted’s resources at University of North Carolina at Chapel Hill

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Motivation: Minimum Spanning Trees To minimize the length of a connecting network, it never pays to have cycles. The resulting connection graph is connected, undirected, and acyclic, i.e., a free tree (sometimes called simply a tree ). This is the minimum spanning tree or MST problem.
Formal Definition of MST Given a connected, undirected, graph G = ( V, E ) , a spanning tree is an acyclic subset of edges T E that connects all the vertices together. Assuming G is weighted, we define the cost of a spanning tree T to be the sum of edge weights in the spanning tree w ( T ) = ( u,v ) T w ( u,v ) A minimum spanning tree (MST) is a spanning tree of minimum weight.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Figure1 : Examples of MST Not only do the edges sum to the same value, but the same set of edge weights appear in the two MSTs. NOTE: An MST may not be unique.
Steiner Minimum Trees (SMT) Given a undirected graph G = ( V, E ) with edge weights and a subset of vertices V’ V, called terminals . We wish to compute a connected acyclic subgraph of G that includes all terminals. MST is just a SMT with V’ = V. Figure 2: Steiner Minimum Tree

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Generic Approaches Two greedy algorithms for computing MSTs: » Kruskal’s Algorithm » Prim’s Algorithm
Facts about (Free) Trees A tree with n vertices has exactly n -1 edges (| E | = | V | - 1) There exists a unique path between any two vertices of a tree Adding any edge to a tree creates a unique cycle; breaking any edge on this cycle restores a tree For details see CLRS Appendix B.5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Intuition Behind Greedy MST We maintain in a subset of edges A , which will initially be empty, and we will add edges one at a time, until equals the MST. We say that a subset A E is viable if A is a subset of edges in some MST. We say that an edge ( u,v ) E - A is safe if A {( u,v )} is viable. Basically, the choice ( u,v ) is a safe choice to add so that A can still be extended to form an MST. Note that if A is viable it cannot contain a cycle. A generic greedy algorithm operates by repeatedly adding any safe edge to the current spanning tree.
Generic-MST ( G, w ) 1. A // A trivially satisfies invariant // lines 2-4 maintain the invariant 2. while A does not form a spanning tree 3. do find an edge ( u , v ) that is safe for A 4. A A {( u , v )} 5. return A // A is now a MST

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/03/2011 for the course COT 5407 taught by Professor Staff during the Fall '08 term at FIU.

### Page1 / 31

MST - MST Many of the slides are from Prof. Plaisteds...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online