Lecture 5.3: Graph Isomorphism and Paths

Slides:



Advertisements
Similar presentations
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Advertisements

Graph-02.
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.
Selected Topics in Data Networking Graph Representation.
Graphs.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
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.
GRAPHS THEROY. 2 –Graphs Graph basics and definitions Vertices/nodes, edges, adjacency, incidence Degree, in-degree, out-degree Subgraphs, unions, isomorphism.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
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.
Lecture 10: Graph-Path-Circuit
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by 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 5.1: Graphs Basics
Introduction to Graph Theory
9/29/2011Lecture Strong Induction1 Lecture 3.2: Strong Induction CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures.
Lecture 5.3: Graph Isomorphism and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
9/27/2011 Lecture Mathematical Induction1 Lecture 3.1: Mathematical Induction* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from.
Lecture 3.4: Recursive Algorithms CS 250, Discrete Structures, Fall 2015 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
An Introduction to Graph Theory
Lecture 5.4: Paths and Connectivity
Applied Discrete Mathematics Week 14: Trees
CSNB 143 Discrete Mathematical Structures
Chapter 9 (Part 2): Graphs
Lecture 5.2: Special Graphs and Matrix Representation
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Copyright © Zeph Grunschlag,
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Representing Graphs and
Grade 11 AP Mathematics Graph Theory
CS 250, Discrete Structures, Fall 2015
Discrete Structures – CNS2300
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
EECS 203 Lecture 20 More Graphs.
Graphs.
Based on slides by Y. Peng University of Maryland
Lecture 4.1: Relations Basics
CS100: Discrete structures
Connectivity Section 10.4.
CS 250, Discrete Structures, Fall 2015
Graphs Discrete Structure CS203.
CS 250, Discrete Structures, Fall 2014
CS 250, Discrete Structures, Fall 2013
CS 250, Discrete Structures, Fall 2015
Lecture 4.3: Closures and Equivalence Relations
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Theorem 5.13: For vT‘, l’(v)= min{l(v), l(vk)+w(vk, v)}
Lecture 3.1: Mathematical Induction
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Paths and Connectivity
Paths and Connectivity
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
Lecture 3.1: Mathematical Induction
Agenda Review Lecture Content: Shortest Path Algorithm
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Concepts of Computation
Presentation transcript:

Lecture 5.3: Graph Isomorphism and Paths CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag

Lecture 5.3 -- Graph Isomorphism and Connectivity Course Admin -- HW4 Grading now – expect results in about a week Solution has been posted 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Course Admin -- Homework 5 Heads up: will be posted today Due on Dec 4 Covers the chapter on Graphs (lecture 5.*) 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

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 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Lecture next Tuesday I am traveling (NSF in DC) and won’t be here to give the lecture The TA, Amit Dutta, will cover for me He is going to talk about homework assignment mostly Please do attend the lecture Please cooperate with him This is the first time he will be lecturing a big class 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Outline Graph Isomorphism Paths 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Warm-up Exercise Theorem: No. of edges in an n-cube is n2n-1 Proof: Use mathematical induction. Let’s use the whiteboard. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Various mathematical notions come with their own concept of equivalence, as opposed to equality: Equivalence for sets is bijectivity: EG {23, 12, 43}  {12, 23, 43} Equivalence for graphs is isomorphism: EG  4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Intuitively, two graphs are isomorphic if can bend, stretch and reposition vertices of the first graph, until the second graph is formed. Etymologically, isomorphic means “same shape”. EG: Can twist or relabel: to obtain: 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism Undirected Graphs DEF: Suppose G1 = (V1, E1 ) and G2 = (V2, E2 ) are pseudographs. Let f :V1V2 be a function s.t.: f is bijective for all vertices u,v in V1, the number of edges between u and v in G1 is the same as the number of edges between f (u) and f (v ) in G2. Then f is called an isomorphism and G1 is said to be isomorphic to G2. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism Digraphs DEF: Suppose G1 = (V1, E1 ) and G2 = (V2, E2 ) are directed multigraphs. Let f :V1V2 be a function s.t.: f is bijective for all vertices u,v in V1, the number of edges from u to v in G1 is the same as the number of edges between f (u) and f (v ) in G2. Then f is called an isomorphism and G1 is said to be isomorphic to G2. Note: Only difference between two definitions is the italicized “from” in no. 2 (was “between”). 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example EG: Prove that is isomorphic to First label the vertices: 2 2 1 3 1 3 5 4 5 4 Lecture 5.3 -- Graph Isomorphism and Connectivity 4/13/2019

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. 2 2 1 1 3 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. 2 2 1 1 3 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. Next vertex is 5 so set f (3) = 5. 2 2 1 3 1 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. Next vertex is 5 so set f (3) = 5. In this fashion we get f (4) = 2 2 2 1 3 1 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. Next vertex is 5 so set f (3) = 5. In this fashion we get f (4) = 2, f (5) = 4. 2 2 1 3 1 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. Next vertex is 5 so set f (3) = 5. In this fashion we get f (4) = 2, f (5) = 4. If we would continue, we would get back to f (1) =1 so this process is well defined and f is a isomorphism. 2 2 1 1 3 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Example Next, set f (1) = 1 and try to walk around clockwise on the star. The next vertex seen is 3, not 2 so set f (2) = 3. Next vertex is 5 so set f (3) = 5. In this fashion we get f (4) = 2, f (5) = 4. If we would continue, we would get back to f (1) =1 so this process is well defined and f is a morphism. Finally since f is bijective, f is an isomorphism. 2 2 1 3 1 3 5 4 5 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Properties of Isomorphims Since graphs are completely defined by their vertex sets and the number of edges between each pair, isomorphic graphs must have the same intrinsic properties. I.e. isomorphic graphs have the same… number of vertices and edges degrees at corresponding vertices types of possible subgraphs 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Exercise Is “isomorphism” on graphs an equivalence relation? If so, what are the equivalence classes? Let’s use the whiteboard! 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples To show that two graphs are non-isomorphic need to show that no function can exist that satisfies defining properties of isomorphism. In practice, you try to find some intrinsic property that differs between the 2 graphs in question. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples Q: Why are the following non-isomorphic? u2 v2 u3 u1 v1 v3 u4 v4 u5 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: 1st graph has more vertices than 2nd. Q: Why are the following non-isomorphic? u2 v2 u3 v3 u1 v1 u4 v4 u5 v5 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: 1st graph has more edges than 2nd. Q: Why are the following non-isomorphic? u2 v2 u3 v3 u1 v1 u4 v4 u5 v5 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: 2nd graph has vertex of degree 1, 1st graph doesn't. Q: Why are the following non-isomorphic? u1 u2 u3 u4 u5 u6 v1 v2 v3 v4 v5 v6 u7 u8 u9 v7 v8 v9 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: 1st graph has 2 degree 1 vertices, 4 degree 2 vertex and 2 degree 3 vertices. 2nd graph has 3 degree 1 vertices, 3 degree 2 vertex and 3 degree 3 vertices. Q: Why are the following non-isomorphic? u1 u2 u3 u4 u5 u6 v1 v2 v3 v4 v5 v6 u7 u8 v7 v8 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: None of the previous approaches work as there are the same no. of vertices, edges, and same no. of vertices per degree. LEMMA: If G and H are isomorphic, then any subgraph of G will be isomorphic to some subgraph of H. Q: Find a subgraph of 2nd graph which isn’t a subgraph of 1st graph. u1 u2 u3 u4 u5 u6 v1 v2 v3 v4 v5 v6 u7 u8 v7 v8 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Graph Isomorphism -Negative Examples A: This subgraph is not a subgraph of the left graph. Why not? Deg. 3 vertices must map to deg. 3 vertices. Since subgraph and left graph are symmetric, can assume v2 maps to u2. Adjacent deg. 1 vertices to v2 must map to degree 1 vertices, forcing the deg. 2 adjacent vertex v3 to map to u3. This forces the other vertex adjacent to v3, namely v4 to map to u4. But then a deg. 3 vertex has mapped to a deg. 2 vertex. u1 u2 u3 u4 u5 u6 v1 v2 v3 v4 v5 v6 u7 u8 v7 v8 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism 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-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 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Paths DEF: A path of length n in an undirected graph is a sequence of n edges e1, e2, … ,en such that each consecutive pair ei , ei+1 share a common vertex. In a simple graph, one may instead define a path of length n as a sequence of n+1 vertices v0, v1, v2, … ,vn such that each consecutive pair vi , vi+1 are adjacent. Paths of length 0 are also allowed according to this definition. Q: Why does the second definition work for simple graphs? 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Paths A: For simple graphs, any edge is unique between vertices so listing the vertices gives us the edge-sequence as well. DEF: A simple path contains no duplicate edges (though duplicate vertices are allowed). A cycle (or circuit) is a path which starts and ends at the same vertex. Note: Simple paths need not be in simple graphs. E.g., may contain loops. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Paths Q: Find a longest possible simple path in the following graph: e6 e1 e2 1 2 e5 e3 e4 e7 3 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Paths A: The following path from 1 to 2 is a maximal simple path because simple: each of its edges appears exactly once maximal: because it contains every edge except the unreachable edge e7 The maximal path: e1,e5,e6,e2,e3,e4 e1 e6 1 e2 2 e5 e3 e4 e7 3 4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Paths in Directed Graphs One can define paths for directed graphs by insisting that the target of each edge in the path is the source of the next edge: DEF: A path of length n in a directed graph is a sequence of n edges e1, e2, … ,en such that the target of ei is the source ei+1 for each i. In a digraph, one may instead define a path of length n as a sequence of n+1 vertices v0, v1, v2, … ,vn such that for each consecutive pair vi , vi+1 there is an edge from vi to vi+1 . 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Paths in Directed Graphs Q: Consider digraph adjacency matrix: Find a path from 1 to 4. Is there a path from 4 to 1? 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Paths in Directed Graphs 13 . There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Paths in Directed Graphs 132 . There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Paths in Directed Graphs 1324. There’s no path from 4 to 1. From 4 must go to 2, from 2 must stay at 2 or return to 4. In other words 2 and 4 are disconnected from 1. 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity

Lecture 5.3 -- Graph Isomorphism and Connectivity Today’s Reading Rosen 10.3 and 10.4 4/13/2019 Lecture 5.3 -- Graph Isomorphism and Connectivity