Lecture4 - CME 305: Discrete Mathematics and Algorithms...

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

View Full Document Right Arrow Icon
CME 305: Discrete Mathematics and Algorithms Instructor: Professor Amin Saberi (saberi@stanford.edu) 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. Definition: 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 find the cheapest subgraph of G - or equivalently MST ( G ) - one way would be to enumerate all the spanning trees and find the cheapest one. However, the number of spanning trees can be exponentially large. We need to come up with a more efficient way to find 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:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/17/2010.

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 Right Arrow Icon
Ask a homework question - tutors are online