Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Based on slides by Y. Peng University of Maryland
Representing Relations Using Matrices
Applied Discrete Mathematics Week 12: Trees
SE561 Math Foundations Week 11 Graphs I
Graph Theory in CS Route Search in Online Map Services
Math Foundations Week 12 Graphs (2). Agenda Paths Connectivity Euler paths Hamilton paths 2.
Copyright © Zeph Grunschlag, Paths and Connectivity Zeph Grunschlag.
1 Section 8.4 Connectivity. 2 Paths In an undirected graph, a path of length n from u to v, where n is a positive integer, is a sequence of edges e 1,
Selected Topics in Data Networking Graph Representation.
Graphs.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Lecture 4.5: POSets and Hasse Diagrams CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
Copyright © Zeph Grunschlag, More on Graphs.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Based on slides by Y. Peng University of Maryland
Lecture 3.4: Recursive Algorithms CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
Module #19: Graph Theory: part II Rosen 5 th ed., chs. 8-9.
GRAPHS THEROY. 2 –Graphs Graph basics and definitions Vertices/nodes, edges, adjacency, incidence Degree, in-degree, out-degree Subgraphs, unions, isomorphism.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Lecture 4.3: Closures and Equivalence Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.2: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
Basic properties Continuation
Lecture 4.2: Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 5.1: Graphs Basics
Introduction to Graph Theory
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
Copyright © Curt Hill Graphs Definitions and Implementations.
Chapter 9: Graphs.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda.
CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
9/29/2011Lecture Strong Induction1 Lecture 3.2: Strong Induction CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
Lecture 5.3: Graph Isomorphism and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
9/27/2011 Lecture Mathematical Induction1 Lecture 3.1: Mathematical Induction* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from.
Lecture 5.4: Paths and Connectivity
Applied Discrete Mathematics Week 14: Trees
Chapter 9 (Part 2): Graphs
Lecture 5.2: Special Graphs and Matrix Representation
Copyright © Zeph Grunschlag,
CS 250, Discrete Structures, Fall 2015
Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
Connectivity Section 10.4.
Relations and Digraphs
Lecture 4.3: Closures and Equivalence Relations
Lecture 3.1: Mathematical Induction
Discrete Mathematics Lecture 13_14: Graph Theory and Tree
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Lecture 5.3: Graph Isomorphism and Paths
Paths and Connectivity
9.4 Connectivity.
Paths and Connectivity
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
Lecture 3.1: Mathematical Induction
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Presentation transcript:

Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag

Course Admin -- Homework 5 Due at 11am on Nov 30 (Wed) Covers the chapter on Graphs (lecture 5.*) Thanksgiving is in the way – please try to start early Has a 10-pointer bonus problem too Lecture Paths and Connectivity Little work will not hurt!

Course Admin -- Homework 4 Grading now Expect results in a couple of days Graded HWs will be distributed next Tuesday Solution posted Lecture Paths and Connectivity

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

Outline Paths and Isomorphism Connectivity

A visualization of the Linkein Social Graph Lecture Paths and Connectivity

and of the Facebook network Lecture Paths and Connectivity

Recap: Graph Isomorphism DEF: Suppose G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) are pseudographs. Let f :V 1  V 2 be a function s.t.: 1) f is bijective 2) for all vertices u,v in V 1, the number of edges between u and v in G 1 is the same as the number of edges between f (u) and f (v ) in G 2 ; or e(u, v, G 1 ) = e(f(u), f(v), G 2 ) Then f is called an isomorphism and G 1 is said to be isomorphic to G 2. Lecture Paths and Connectivity

Properties of Isomorphisms Two graphs are isomorphic to each other if they satisfy the following properties: same number of vertices same number of edges same degrees at corresponding vertices Any subgraph of one is isomorphic to some subgraph of the other Lecture Paths and Connectivity

Warm-up Exercise Theorem: Isomorphism is an equivalence relation Proof: We need to prove that the isomorphism relation is reflexive, symmetric, and transitive. Let’s use the whiteboard. Lecture Paths and Connectivity

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-e 1  2-e 1  1-e 3  3-e 4  2-e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

Paths 1 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- e 1  2-e 1  1-e 3  3-e 4  2-e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2- e 1  1-e 3  3-e 4  2-e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2-e 1  1- e 3  3-e 4  2-e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2-e 1  1-e 3  3- e 4  2-e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2-e 1  1-e 3  3-e 4  2- e 6  2-e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2-e 1  1-e 3  3-e 4  2-e 6  2- e 5  2-e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

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-e 1  2-e 1  1-e 3  3-e 4  2-e 6  2-e 5  2- e 4  e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7

Paths in Real (CS) World Linkedin paths (let us see in practice) Facebook paths Internet paths … Lecture Paths and Connectivity

Paths and Isomorphism Paths and circuits can also be serve as a good criteria for determining whether two graphs are isomorphic Look for (simple) circuits of different lengths. Example below: u1u1 u6u6 u2u2 u3u3 u5u5 u4u4 Lecture Paths and Connectivity

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

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

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 Paths and Connectivity

Q: Which of the following graphs are connected? Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

A: First and second are disconnected. Last is connected. Connectivity Lecture Paths and Connectivity

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” ? jobrobjab Lecture Paths and Connectivity

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

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

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

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 Paths and Connectivity

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? Lecture Paths and Connectivity

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

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

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

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)

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

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 Paths and Connectivity

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 Paths and Connectivity

Connectivity in Directed 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: 1) Should we ignore directions? 2) Should we insist that we can get from a to b in actual digraph? 3) Should we insist that we can get from a to b and that we can get from b to a? Lecture Paths and Connectivity

Connectivity in Directed Graphs Resolution: Don’t bother choosing which definition is better. Just define to separate concepts: 1) Weakly connected : can get from a to b in underlying undirected graph 2) Semi-connected (my terminology): can get from a to b OR from b to a in digraph 3) 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) connected if every pair of vertices is connected in the same sense. Lecture Paths and Connectivity

Connectivity in Directed Graphs Q: Classify the connectivity of each graph. Lecture Paths and Connectivity

Connectivity in Directed Graphs A: semi weakstrong Lecture Paths and Connectivity

Today’s Reading Rosen 10.3 and 10.4 Little work will not hurt!