This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 4/14/2011 1 CS/ENGRD 2110 ObjectOriented Programming and Data Structures Spring 2010 Thorsten Joachims Lecture 20: Other Algorithms on Graphs Minimum Spanning Trees • Example Problem: – Nodes = neighborhoods – Edges = possible cable routes – Goal: Find lowest cost network that connects all neighborhoods • Analogously: – Router network – Clustering – Component in many approximation algorithms 33 4 13 9 6 32 40 7 21 15 100 1 2 5 66 22 28 24 34 72 64 8 25 54 101 62 11 12 27 49 51 3 10 14 16 Undirected Trees • An undirected graph is a tree if there is exactly one (simple) path between any pair of vertices Facts About Trees • Properties of trees – E = V – 1 – Connected – no cycles • In fact, any two of these properties imply the third, and imply that the graph is a tree Spanning Trees • A spanning tree of a connected undirected graph (V,E) is a subgraph (V,E') that is a tree – Same set of vertices V – E' ⊆ E – (V,E') is a tree Finding a Spanning Tree • A subtractive method – Start with the whole graph – it is connected – Find a cycle (how?), pick an edge on the cycle and throw it out the graph is still connected (why?) – Repeat until no more cycles 4/14/2011 2 Finding a Spanning Tree • A subtractive method – Start with the whole graph – it is connected – Find a cycle (how?), pick an edge on the cycle and throw it out the graph is still connected (why?) – Repeat until no more cycles Finding a Spanning Tree • A subtractive method – Start with the whole graph – it is connected – Find a cycle (how?), pick an edge on the cycle and throw it out the graph is still connected (why?) – Repeat until no more cycles Finding a Spanning Tree • An additive method – Start with no edges – there are no cycles – Find connected components (how?). – If more than one connected component, insert an edge between them still no cycles (why?) – Repeat until only one component Finding a Spanning Tree • An additive method – Start with no edges – there are no cycles – Find connected components (how?). – If more than one connected component, insert an edge between them still no cycles (why?) – Repeat until only one component Finding a Spanning Tree • An additive method – Start with no edges – there are no cycles – Find connected components (how?). – If more than one connected component, insert an edge between them still no cycles (why?) – Repeat until only one component Finding a Spanning Tree • An additive method – Start with no edges – there are no cycles – Find connected components (how?)....
View
Full
Document
This note was uploaded on 09/17/2011 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell.
 Spring '07
 FRANCIS
 ObjectOriented Programming, Data Structures

Click to edit the document details