{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture4

Lecture4 - CME 305 Discrete Mathematics and Algorithms...

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

CME 305: Discrete Mathematics and Algorithms Instructor: Professor Amin Saberi ([email protected]) January 14, 2010 Lecture 4: Minimum Spanning Tree and its Applications 1 Minimum Spanning Trees We are given a connected graph G ( V,E ), each edge e has a cost (wight) of c ( e ) > 0. Let the cost of G to be e E c ( e ). Question: What is cheapest connected subgraph of G ? Clearly, the solution G 0 is a tree. Otherwise, suppose G 0 has at least one cycle. Pick an edge from that cycle and delete it. The resulting graph is still connected and has a lower cost, thus G 0 could not be the cheapest connected subgraph. Deﬁnition: For a connected graph G ( V,E ), a spanning tree of G , T ( G ) is a subgraph of G that is a tree and has vertex set V . Given the cost function c ( · ), the minimum spanning tree of G , MST ( G ), is the cheapest spanning tree of G . To ﬁnd the cheapest subgraph of G - or equivalently MST ( G ) - one way would be to enumerate all the spanning trees and ﬁnd the cheapest one. However, the number of spanning trees can be exponentially large. We need to come up with a more eﬃcient way to ﬁnd MST ( G ). Joseph Kruskal proposed the following greedy algorithm to produce an MST . For simplicity assume that the c ( · ) is a one-to-one function. The Greedy Algorithm: Greedy-MST 1. Given graph G ( V,E ), initialize E ( T ) = {} and V ( T ) = V . 2. Re-index the edges e 1 ,...,e m so that c ( e i 1 ) < c ( e i 2 ) < ... < c ( e i m ) 3. While | E ( T ) | < | V | - 1, add the cheapest unused e i k that does not create a cycle. Claim 1 Greedy-MST produces T * = MST ( G ) . Proof:

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.

{[ snackBarMessage ]}

Page1 / 3

Lecture4 - CME 305 Discrete Mathematics and Algorithms...

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

View Full Document
Ask a homework question - tutors are online