1 / 42

Lecture 5.4: Paths and Connectivity

Lecture 5.4: Paths and Connectivity. CS 250, Discrete Structures, Fall 2011 Nitesh Saxena * Adopted from previous lectures by Zeph Grunschlag. Course Admin -- Homework 4 . Graded and returned now Please pick them up if you haven’t done so already Solution posted.

joel-hewitt
Download Presentation

Lecture 5.4: Paths 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. Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 NiteshSaxena *Adopted from previous lectures by ZephGrunschlag

  2. Course Admin -- Homework 4 • Graded and returned now • Please pick them up if you haven’t done so already • Solution posted Lecture 5.4 -- Paths and Connectivity

  3. Course Admin -- Homework 5 • Due at 11am on Dec 4 (Tues) • Covers the chapter on Graphs (lecture 5.*) • Has a 25-pointer bonus problem too Lecture 5.4 -- Paths and Connectivity

  4. Course Admin -- Final Exam • Tuesday, December 11,  10:45am- 1:15pm, lecture room • Please mark the date/time/place • Emphasis on post mid-term 2 material • Coverage: • 65% post mid-term 2 (lectures 4.*, 5.*), and • 35% pre mid-term 2 (lecture 1.*. 2.* and 3.*) • Our last lecture will be on December 4 • We plan to do a final exam review then Lecture 5.4 -- Paths and Connectivity

  5. Outline • Paths • Connectivity Lecture 5.4 -- Paths and Connectivity

  6. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  7. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  8. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  9. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  10. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  11. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  12. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  13. Paths A path in a graph is a continuous way of getting from one vertex to another by using a sequence of edges. EG: could get from 1 to 3 circuitously as follows: 1-e12-e11-e33-e42-e62-e52-e43 e6 e1 e2 1 2 e5 e3 e4 e7 3 4 Lecture 5.4 -- Paths and Connectivity

  14. Paths in Real (CS) World • Linkedin paths • Facebook paths • Internet paths • … Lecture 5.4 -- Paths and Connectivity

  15. Number of Paths of Certain Lengths • Adjacency matrix A for a graph depicts all paths of length 1 • The matrix A2depicts number of paths of length 2 • In general, the matrix Akdepicts number of paths of length k a b c d Lecture 5.4 -- Paths and Connectivity

  16. Number of Paths of Certain Lengths • Adjacency matrix A for a graph depicts all paths of length 1 • The matrix A2depicts number of paths of length 2 • In general, the matrix Akdepicts number of paths of length k a b c d Lecture 5.4 -- Paths and Connectivity

  17. Connectivity DEF: Let G be a pseudograph. Let u and v be vertices. u and v are connected to each other if there is a path in G which starts at u and ends at v. G is said to be connected if all vertices are connected to each other. Note: Any vertex is automatically connected to itself via the empty path. Lecture 5.4 -- Paths and Connectivity

  18. Connectivity Q: Which of the following graphs are connected? 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  19. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  20. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  21. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  22. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  23. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  24. Connectivity A: First and second are disconnected. Last is connected. 1 2 3 4 Lecture 5.4 -- Paths and Connectivity

  25. English Connectivity Puzzle Can define a puzzling graph G as follows: V = {3-letter English words} E : two words are connected if we can get one word from the other by changing a single letter. One small subgraph of G is: Q: Is “fun” connected to “car” ? rob job jab Lecture 5.4 -- Paths and Connectivity

  26. English Connectivity Puzzle A: Yes: funfanfarcar Or: funfinbinbanbarcar Lecture 5.4 -- Paths and Connectivity

  27. Some Little Theorems Thm1: Every connected graph with n vertices has at least n-1 edges Proof: Use proof by mathematical induction Basis Step (n=1): No. of edges is 0, which is less >= 0 (n-1) Induction Step: Assume to be true for n = k and show it to be true for n = k + 1 We assumed that a connected graph with k vertices will have at least k–1 edges. Now, we add a new vertex to this graph to obtain a new graph with k vertices. For the new graph to remain connected, the new vertex should be incident with at least one edge which is also incident with one of the vertices in the old graph. This means that the new graph should have a total of at least (k – 1) + 1 = k edges. This proves the induction step. Finally, combining the basis and induction steps, we get that the theorem is true for all n

  28. Some Theorems Thm 2: Vertex connectedness in a simple graph is an equivalence relation Proof: We will show that the “connectedness” relation is reflexive, symmetric and transitive It is reflexive since every vertex is connected to itself via a path of length 0 It is symmetric because if a vertex u is connected to another vertex v, then there exists a path between u and v – just traverse the reverse path It is transitive because if u and v are connected (via path p) and v and w are connected (via path q), then u and w are connected via a path p|q

  29. Some Theorems • Thm 3: If a connected simple graph G is the union of graphs G1 and G2, then G1 and G2 must have a common vertex • Proof: (very simple) let’s use the board. Lecture 5.4 -- Paths and Connectivity

  30. Connected Components DEF: A connected component (or just component) in a graph G is a set of vertices such that all vertices in the set are connected to each other and every possible connected vertex is included. Q: What are the connected components of the following graph? 1 6 2 7 8 5 3 4 Lecture 5.4 -- Paths and Connectivity

  31. 1 8 5 3 Connected Components A: The components are {1,3,5},{2,4,6},{7} and {8} as one can see visually by pulling components apart: 6 2 7 4 Lecture 5.4 -- Paths and Connectivity

  32. 1 5 3 Connected Components A: The components are {1,3,5},{2,4,6},{7} and {8} as one can see visually by pulling components apart: 6 2 7 8 4 Lecture 5.4 -- Paths and Connectivity

  33. 1 5 3 Connected Components A: The components are {1,3,5}, {2,4,6}, {7} and {8} as one can see visually by pulling components apart: 6 2 7 8 4 Lecture 5.4 -- Paths and Connectivity

  34. Degree of Connectivity Not all connected graphs are treated equal! Q: Rate following graphs in terms of their design value for computer networks: 1) 2) 3) 4)

  35. Degree of Connectivity A: Want all computers to be connected, even if 1 computer goes down: 1) 2nd best. However, there is a weak link— “cut vertex” 2) 3rd best. Connected but any computer can disconnect 3) Worst! Already disconnected 4) Best! Network dies only with 2 bad computers Lecture 5.4 -- Paths and Connectivity

  36. Degree of Connectivity The network is best because it can only become disconnected when 2 vertices are removed. In other words, it is 2-connected. Formally: DEF: A connected simple graph with 3 or more vertices is 2-connected if it remains connected when any vertex is removed. When the graph is not 2-connected, we call the disconnecting vertex a cut vertex. Lecture 5.4 -- Paths and Connectivity

  37. Degree of Connectivity There is also a notion of N-Connectivity where we require at least N vertices to be removed to disconnect the graph. Lecture 5.4 -- Paths and Connectivity

  38. Connectivity inDirected Graphs In directed graphs may be able to find a path from a to b but not from b to a. However, Connectivity was a symmetric concept for undirected graphs. So how to define directed Connectivity is non-obvious: • Should we ignore directions? • Should we insist that we can get from a to b in actual digraph? • Should we insist that we can get from a to b and that we can get from b to a? Lecture 5.4 -- Paths and Connectivity

  39. Connectivity inDirected Graphs Resolution: Don’t bother choosing which definition is better. Just define to separate concepts: • Weakly connected : can get from a to b in underlying undirected graph • Semi-connected (my terminology): can get from a to b OR from b to a in digraph • Strongly connected : can get from a to b AND from b to a in the digraph DEF: A graph is strongly (resp. semi, resp. weakly) connectedif every pair of vertices is connected in the same sense. Lecture 5.4 -- Paths and Connectivity

  40. Connectivity inDirected Graphs Q: Classify the connectivity of each graph. Lecture 5.4 -- Paths and Connectivity

  41. Connectivity inDirected Graphs A: semi weak strong Lecture 5.4 -- Paths and Connectivity

  42. Today’s Reading • Rosen 10.3 and 10.4 Lecture 5.4 -- Paths and Connectivity

More Related