1 / 12

10.4 Spanning Trees

10.4 Spanning Trees. Def. Def: Let G be a simple graph. A spanning tree of G is a subgraph of G that is a tree containing every vertex of G See handout for examples. Thm . 1. Thm 1.: A simple graph is connected iff it has a spanning tree Recall some def: Connected ____

jela
Download Presentation

10.4 Spanning Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10.4 Spanning Trees

  2. Def • Def: Let G be a simple graph. A spanning tree of G is a subgraph of G that is a tree containing every vertex of G • See handout for examples

  3. Thm. 1 • Thm 1.: A simple graph is connected iff it has a spanning tree • Recall some def: • Connected ____ • Spanning tree______ • Tree_________

  4. Proof of Thm. 1 A simple graph is conn.iff it has a spanning tree: Proof Suppose G has a spanning tree T Because it is spanning, ________ Because it is a tree, 10.1 Thm. 1 says _________ Since T is a subgraph of G, G is ________ • Suppose G is connected If G is NOT a tree it must ___________ Remove an edge. The resulting graph has ___ edge and contains ___vertices of G and is ________ Repeat until _____ This is possible because______________

  5. Algorithms for constructing spanning trees • See handout and use the following methods • Depth first (backtracking) • Start with a root • Form a path by adding vertices as long as possible (without adding a circuit) • When you can’t add any more, go back to previous one and add more… • Breath first • Start with a root • Add all edges incident to this vertex (level 1), arbitrarily order them • For each vertex in level 1, add each edge incident (as long as it doesn’t form a circuit),…

  6. Depth example a d i j c e f h k b g Start at f

  7. Breadth example a b c l d e f g h i j m k start at e

  8. Use backtracking to find a subset, if possible, … • Of the set {27, 24, 19, 14, 11, 8} with the sum of 20

  9. Use backtracking to find a subset, if possible, … • Of the set {27, 24, 19, 14, 11, 8} with the sum of 41

  10. Use backtracking to find a subset, if possible, … • Of the set {27, 24, 19, 14, 11, 8} with the sum of 60

  11. Ex with colors • See if a graph has 3 colors– use a tree

  12. 10.5 Minimum spanning trees • Prim’s Algorithm • Start with smallest weight • Successively add edges that are incident, choosing smallest weights, and not forming a circuit • Stop after n-1 edges selected (with n vertices) • Kruskal’s Algorithm • Start with smallest weight • Successively add edges that are smallest weight (not necessarily incident) and not forming a circuit • Stop after n-1 edges selected (with n vertices) • See handout or book ex

More Related