1 / 30

Trees and Connectivity

Trees and Connectivity. Lecture 9: Oct 10. (based on slides in MIT 6.042). v. ). (. Paths and Cycles. Simple Path : all vertices different. A simple cycle is a cycle that doesn’t cross itself. w. Every vertex is of degree exactly 2. cycle: v ··· w ··· v. also: w ··· v ··· w.

tobit
Download Presentation

Trees and Connectivity

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. Trees and Connectivity Lecture 9: Oct 10 (based on slides in MIT 6.042)

  2. v ) ( Paths and Cycles Simple Path: all vertices different A simple cycle is a cycle that doesn’t cross itself w Every vertex is of degree exactly 2. cycle: v ···w ···v also: w ···v ···w

  3. Tree Graphs with no cycles? A forest. Connected graphs with no cycles? A tree.

  4. More Trees leaf leaf A leaf is a vertex of degree 1. A binary tree Even more leaves. More leaves.

  5. Tree Characterization by Path Definition. A tree is a connected graph with no cycles. Can there be no path between u and v? NO Can there be more than one simple path between u and v? NO This will create cycles. v u How to prove it formally? Claim. In a tree, there is a unique simple path between every pair of vertices.

  6. Tree Characterization by Path Definition. A tree is a connected graph with no cycles. Claim. In a tree, there is a unique simple path between every pair of vertices. Is the converse true? That is, are the above statements equivalent? YES Given a graph G, if there is a unique simple path between every pair of vertices, then G is a tree? YES • Suppose that G is not a tree. • Since there is a path between every pair of vertices, G is connected. • So G has a cycle C. • But then there are more than one simple paths between the vertices in C. • A contradiction (or proof the contrapositive).

  7. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO Then every vertex has degree at least 2 (why?). Go to unvisited edges as long as possible. Cannot get stuck, unless there is a cycle.

  8. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO n-1? How many edges does a tree have? We usually use n to denote the number of vertices, and use m to denote the number of edges in a graph.

  9. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO n-1? How many edges does a tree have? v Look at a leaf v. Is T-v a tree? YES • Can T-v has a cycle? • Is T-v connected? NO YES By induction, T-v has (n-1)-1=n-2 edges. So T has n-1 edges.

  10. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO n-1 How many edges does a tree have? Is a graph with n-1 edges a tree? NO

  11. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO n-1 How many edges does a tree have? YES Is a connected graph G with n-1 edges a tree? • There must be a vertex v of degree 1 (why?). • G-v is a connected graph (why?) with n-2 edges. • By induction, G-v is a tree. • So G is a tree. If every vertex has degree at least 2, then there are >= n edges.

  12. Tree Characterization by Number of Edges Definition. A tree is a connected graph with no cycles. Can a tree has no leaves? NO n-1 How many edges does a tree have? YES Is a connected graph G with n-1 edges a tree? NO Can a tree has only one leaf? Handshaking lemma. • Every other vertex has degree at least 2. • One vertex has degree at least 3 (why?). • So number of edges >= (1 + 2 + 2 +…+ 2 + 3)/2 = n. • A contradiction.

  13. B Cut Edges and Cycles Definition. An edge is a cut edge if its removal disconnects the graph. A Aisnot a cut edge. B is a cut edge. Claim:An edge is not a cut edge iff it is traversed by a simple cycle.

  14. Tree Characterization by Connectivity Definition. A tree is a connected graph with no cycles. Definition. An edge is a cut edge if its removal disconnects the graph. Is an edge in a tree always a cut edge? YES Otherwise there was a cycle. Is a tree a minimally connected graph? YES

  15. Tree Characterizations Definition. A tree is a connected graph with no cycles. Characterization by paths: A graph is a tree if and only if there is a unique simple path between every pair of vertices. Characterization by number of edges: A graph is a tree if and only if it is connected and has n-1 edges. Characterization by connectivity: A graph is a tree if and only if it is connected and every edge is a cut edge.

  16. Spanning Trees A spanning tree: a subgraph that is a tree on all the vertices. A connected graph always has a spanning tree? YES A connected graph has at least n-1 edges? YES

  17. Number of Spanning Trees A connected graph has a unique spanning tree? NO How many spanning trees in a cycle? n How many edges in a complete graph? n(n-1)/2 How many spanning trees in a complete graph? How many non-isomorphic spanning trees in a complete graph? (from Wolfram MathWorld)

  18. vi vi+1 v0 … v0 v1 v2 vn-1 vn Paths and cycles in directed graphs Paths are directed: v0, v1,…, vn where vivi+1 for all i. A directed cycle if v0=vn

  19. Directed Acyclic Graphs Definition. A directed acyclic graph is a directed graph with no directed cycles. A directed acyclic graph has at most n-1 edges? NO How many edges can a directed acyclic graph has? Every edge! 1 2 3 Given a directed graph with m edges, does it have a subgraph with at least m/2 edges? YES 4 Find an arbitrary ordering, take forward or backward edges. 1 2 6 3 4 5

  20. Directed Spanning Trees root indegree=1 outdegree=2 For every vertex, there is a directed path from the root. Every vertex, except the root, has degree exactly one. Exactly n-1 edges.

  21. vi vi+1 v0 Strongly Connected Graphs Definition. A graph is strongly connected if for every pair of vertices (u,v), there is a directed path from u to v and a directed path from v to u. Strongly connected. Not strongly connected.

  22. Graph Orientations • Each junction is a vertex. • Each edge is a road. • How to make every road an “one-way-road” so that everywhere can still be reached from everywhere?

  23. Graph Orientations (The one way street problem) Given an undirected graph, assign a direction to each edge so that the resulting directed graph is strongly connected.

  24. Graph Orientations When a graph has a strongly connected orientation? When a graph does not have a strongly connected orientation? A bridge (Robbins 1939) A graph has a strongly connected orientation if and only if there is no cut edge (bridge).

  25. Graph Connectivity Reliable network design In a tree, every vertex is connected to every other vertex. But any failure disconnects the graph!

  26. Graph Connectivity 3-edge-connected. Reliable network design A graph is k-edge-connected if the graph remains connected no matter which k-1 edges are removed

  27. Graph Connectivity Efficient network design In a tree, every vertex is connected to every other vertex. But there is only one path, and so the transmission speed is slow.

  28. Graph Connectivity 3-path-connected. Efficient network design A graph is k-path-connected if there are at least k edge-disjoint paths between every pair of vertices.

  29. Graph Connectivity A graph is k-edge-connected if the graph remains connected no matter which k-1 edges are removed Reliable network design A graph is k-path-connected if there are at least k edge-disjoint paths between every pair of vertices. Efficient network design When k=1, they are equivalent. Which is easier? If removal of k edges disconnects G, then G is at most k-path-connected. k-path-connected => k-edge-connected

  30. Graph Connectivity A graph is k-edge-connected if the graph remains connected no matter which k-1 edges are removed Reliable network design A graph is k-path-connected if there are at least k edge-disjoint paths between every pair of vertices. Efficient network design When k=1, they are equivalent. Which is easier? (Menger 1927) A graph is k-edge-connected iff it is k-path connected. This is a fundamental theorem in graph theory. At least how many edges in a k-edge-connected graph?

More Related