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

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**Unformatted text preview: **6/15/2011 1 CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2011 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 6/15/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