Lecture 19 Thursday, March 29. Examples of isomorphic, and non-isomorphic graphs will be given in class.

Similar documents
Lecture 22 Tuesday, April 10

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Problem Set 2 Solutions

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

Introduction to Graph Theory

Lecture 20 : Trees DRAFT

Kruskal s MST Algorithm

Ma/CS 6b Class 5: Graph Connectivity

Treewidth and graph minors

7.3 Spanning trees Spanning trees [ ] 61

Math 776 Graph Theory Lecture Note 1 Basic concepts

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected

Discrete mathematics

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Graph theory - solutions to problem set 1

CSE 331: Introduction to Algorithm Analysis and Design Graphs

Module 11. Directed Graphs. Contents

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models.

2. CONNECTIVITY Connectivity

Discrete mathematics , Fall Instructor: prof. János Pach

CMSC Honors Discrete Mathematics

CMSC 380. Graph Terminology and Representation

The Structure of Bull-Free Perfect Graphs

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Binary Decision Diagrams

1 Matchings in Graphs

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Notes for Recitation 8

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

Lecture 2 : Counting X-trees

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4)

Faster parameterized algorithms for Minimum Fill-In

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

Lecture 4: Walks, Trails, Paths and Connectivity

4 Basics of Trees. Petr Hliněný, FI MU Brno 1 FI: MA010: Trees and Forests

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

A Vizing-like theorem for union vertex-distinguishing edge coloring

MATH20902: Discrete Maths, Solutions to Problem Set 1. These solutions, as well as the corresponding problems, are available at

K 4 C 5. Figure 4.5: Some well known family of graphs

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

Solution to Graded Problem Set 4

Assignment 4 Solutions of graph problems

A generalization of Mader s theorem

8 Matroid Intersection

Faster parameterized algorithms for Minimum Fill-In

Approximation Algorithms: The Primal-Dual Method. My T. Thai

Lecture 6: Faces, Facets

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

Fundamental Properties of Graphs

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

11.9 Connectivity Connected Components. mcs 2015/5/18 1:43 page 419 #427

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

Embedded Width, A Variation of Treewidth for Planar Graphs

Math 170- Graph Theory Notes

Number Theory and Graph Theory

Bipartite Roots of Graphs

1 Digraphs. Definition 1

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

Generell Topologi. Richard Williamson. May 6, 2013

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

6c Lecture 3 & 4: April 8 & 10, 2014

6. Lecture notes on matroid intersection

Matching Theory. Figure 1: Is this graph bipartite?

A Structure of the Subgraph Induced at a Labeling of a Graph by the Subset of Vertices with an Interval Spectrum

Lecture 4: Trees and Art Galleries


Matchings. Examples. K n,m, K n, Petersen graph, Q k ; graphs without perfect matching. A maximal matching cannot be enlarged by adding another edge.

Graph Theory Mini-course

Problem Set 3. MATH 778C, Spring 2009, Austin Mohr (with John Boozer) April 15, 2009

Notes on Binary Dumbbell Trees

Problem Set 2 Solutions

2. Lecture notes on non-bipartite matching

HW Graph Theory SOLUTIONS (hbovik) - Q

1 Matching in Non-Bipartite Graphs

Induction Review. Graphs. EECS 310: Discrete Math Lecture 5 Graph Theory, Matching. Common Graphs. a set of edges or collection of two-elt subsets

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

V :non-empty vertex ornode set E V V :edge set G (V, E) :directed graph on V, or digraph on V

{ 1} Definitions. 10. Extremal graph theory. Problem definition Paths and cycles Complete subgraphs

Basic Graph Theory with Applications to Economics

AMS /672: Graph Theory Homework Problems - Week V. Problems to be handed in on Wednesday, March 2: 6, 8, 9, 11, 12.

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

Graphs and Isomorphisms

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) We will be interested in s.t. ( )~1. To gain some intuition note ( )

Applied Mathematics Letters. Graph triangulations and the compatibility of unrooted phylogenetic trees

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) 2 ( ) ( )

Graph Definitions. In a directed graph the edges have directions (ordered pairs). A weighted graph includes a weight function.

Module 7. Independent sets, coverings. and matchings. Contents

Fixed-Parameter Algorithms, IA166

Infinite locally random graphs

arxiv:submit/ [math.co] 9 May 2011

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Transcription:

CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 19 Thursday, March 29 GRAPH THEORY Graph isomorphism Definition 19.1 Two graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) are isomorphic, write G 1 G 2, when there is a bijection β : V 1 V 2 such that for any two distinct u 1, v 1 V 1 we have u 1 v 1 E 1 iff β(u 1 ) β(v 1 ) E 2. Examples of isomorphic, and non-isomorphic graphs will be given in class. We encourage you to develop a good intuition for graph isomorphism. This intuition should convince you without a tedious proof, for example that when G 1 G 2 then G 1 is connected iff G 2 is connected. Recall the definition of the complete graph on n vertices, which we denote by K n. A graph G is said to be complete when it is isomorphic to K n for some n. The isomorphism is simply renaming the vertices, but the crucial property that there is an edge between any two vertices hold in any complete graph. Subgraphs So far we have defined connected components as blocks of a partition on V, therefore as sets of vertices. In fact, the same term is used for the closely associated subgraph. Definition 19.2 A graph G 1 = (V 1, E 1 ) is a subgraph of the graph G 2 = (V 2, E 2 ) when V 1 V 2 and E 1 E 2. (Beware: not all pairs of such subsets form graphs!) If G = (V, E) is a graph and V V is a set consisting of some of G s nodes, the subgraph of G induced by V is the graph G = (V, E ) where E consists of all the edges of G whose both endpoints are in V. We have defined a connected component as a maximally connected set of nodes C V. We shall use the same name for the subgraph induced by C. The vertices and edges of a walk form a subgraph, which in some sense corresponds to that walk. Note that in the walk, which is a sequence, vertices and even edges may occur multiple times. 1

However, in the subgraph definition (as in any graph definition) vertices and edges occur exactly once. Hence, multiple walks may correspond, in general, to the same subgraph. Similarly, the vertices and edges of a path form a subgraph. Because vertices and hence, edges, only occur once in a path we can reconstruct the path uniquely out of the corresponding subgraph. Thus we define: Definition 19.3 For any n N, we call a subgraph S a path of length n when S P n+1 (the path graph on n + 1 vertices). Counting paths Consider the path u v w. According to the definition (paths are sequences of nodes, etc.), w v u is a different path. This seems a bit awkward in undirected graphs: since there is no direction on edges, what is the meaning of direction on paths? Not being concerned with direction must be done carefully, however. Here is the problem with identifying paths just by their sets of node: Example 19.4 Consider K 4, the complete graph on 4 nodes, {1, 2, 3, 4}. Find two paths that have the same set of nodes, but different sets of edges, therefore, they correspond to different subgraphs. Solution: Consider the following paths 1 2 3 4 and 1 3 2 4. They have the same set of nodes, V = {1, 2, 3, 4}, but different sets of edges: E 1 = {1 2, 2 3, 3 4} and E 2 = {1 3, 3 2, 2 4} hence they correspond to the distinct subgraphs: (V, E 1 ) and (V, E 2 ). Therefore, when we count paths in a graph, we will count the subgraphs that are paths (according to Definition 19.3. In particular, when we count paths of length n we will count subgraphs isomorphic with P n+1. Example 19.5 How many paths of length 2 are there in C 3? How about in C 4? Solution: Recall that C 3 = ({1, 2, 3}, {1 2, 2 3, 3 1}). And recall that we count how many subgraphs of C 2 are isomorphic to P 3. Any two edges form a path of length 2 since they must have an endpoint in common. Since any path of length 2 is made of two edges that have an endpoint in common there is a bijection in C 3 between paths of length 2 and sets of two edges, There are ( 3 = 3 of the latter hence there are 3 paths of length 2. As subgraphs all three have the same set of vertices, {1, 2, 3} and they have the following sets of edges: {1 2, 2 3}, {2 1, 1 3}, and {1 3, 3 2}. In C 4 = ({1, 2, 3, 4}, {1 2, 2 3, 3 4, 4 1}) we still have a bijection between paths of length 2 and sets of two edges that have an endpoint in common, but not any two edges do have an endpoint in common. So we count differently. 2

Note that there is a bijection between paths of length 2 and the vertices of C 4 by associating with each path of length 2 its middle vertex. Therefore there are 4 paths of length 2. For conciseness we describe them as follows: 1 2 3, 2 1 4, 4 3 2, 1 4 3, i.e., we write, for example, 1 2 3 instead of ({1, 2, 3}, {1 2, 2 3}), etc. Note that this same subgraph could have also be described as 3 2 1. Example 19.6 How many paths are there in P n (the path graph on n 1 vertices)? Solution: The paths of length 0 correspond to subgraphs consisting of a single node. There are exactly n of these. This also the answer when n = 1. Now assume n 2. We observe that in P n = ([1..n], {1 2,..., (n 1) n}) the paths of length 1 are one-to-one correspondence with the pairs of nodes (i, j) such that i < j. Indeed, i and j are the endpoints of the path, which also contains all the the nodes and edges in-between. One way to count these is in steps: in the first step we choose i [1..(n 1)] and in the second step we choose j [(i + 1)..n], for a total of n 1 (n i) = i=1 n 1 i = i=1 (n 1)n 2 Another way is to see that such pairs are in one-to-one correspondence with subsets of size 2 of [1..n] and we get the same answer: ( n. Therefore, for n 2, there are n + ( n paths in Pn. Cycles Definition 19.7 A closed walk is a walk in which the first and the last vertex are the same. A cycle 1 is a closed walk of length at least 3 in which all nodes are pairwise distinct, except for the last and the first. The length of the cycle is the length of the closed walk. Hence, walks of length 0 are not cycles. Walks of the form u v u are not cycles either. And, there are no closed walks of length 1. Hence, a cycle cannot have length 0, 1, or 2. Counting cycles A cycle has as many nodes as edges but since there is no cycle of length 2, we need at least three distinct nodes and thus three distinct edges. 1 Warning! Some textbooks call cycle what we call closed walk and they call simple cycle what we call cycle. 3

We can have multiple closed walks corresponding to the same subgraphs, however note that a cycle can almost be reconstructed from the corresponding subgraph, the difference being only that we can start the cycle sequence at any of its vertices. Thus, we give the following: Definition 19.8 For any n N, we call a subgraph S a cycle of length n when S C n (the cycle graph on n vertices). Again we want to count cycles in such a way that direction does not matter. Again counting just sets of nodes that form a cycle does not work, e.g., see the following: Example 19.9 Consider K 4, the complete graph on 4 nodes, {1, 2, 3, 4}. Find two cycles that have the same nodes, but different edges (and thus we want to count them as different cycles). Solution: We describe them as closed walks: 1 2 3 4 1 and 1 3 2 4 1. (Can you find more?) Therefore, when we count cycles in a graph, we will count the subgraphs that are cycles (by the definition above). In particular, when we count cycles of length n we will count subgraphs isomorphic with C n. Trees and forests Definition 19.10 A graph in which there are no cycles is called acyclic. A graph that is both connected and acyclic is called a tree. Consequently, an acyclic graph is also called a forest since all its connected components are trees! We skip the tedious proof that when G 1 G 2 then G 1 is acyclic iff G 2 is acyclic. Since we have remarked that the same holds for connectivity, it follows that G 1 is a tree iff G 2 is a tree. Proposition 19.11 If G = (V, E) is acyclic (a forest) then E = V CC In particular, G = (V, E) is a tree then E = V 1. Proof: Actually, we prove the result for trees and then we derive the one for forests by adding up the respective equations for each connected component. A leaf in a graph is a node of degree 1. Let s use edgy for the negation of edgeless. An edgy graph has at least one edge. 4

Lemma 19.12 Every edgy tree has at least one leaf (actually, at least two!). Proof: (of Lemma 19.1. Let G = (V, E) be an edgy tree. Consider the set L N of lengths of paths (not walks!) in G. Since paths cannot have length more than E, L is finite. WOP implies that L has a greatest element, m. Because G is edgy, m 1. Therefore, there exists in G a path of maximum length and that path has at least two nodes (it cannot be the path of length 0). We have an opportunity to define an important concept: Definition 19.13 A path is called maximal if it cannot be extended with another edge at either end and still remain a path. A path of maximum length is of course maximal. However, we can have maximal paths that are not of maximum length (example in class). Now back to the proof of the lemma. We claim that the (distinct) endpoints of a maximal path are leaves. This follows by contradiction (in class). Lemma 19.14 Removing a leaf from an edgy tree leaves again a tree. Proof: (of Lemma 19.14). Indeed, the resulting graph is still acyclic. It is also still connected because the only paths affected have the removed leaf as an endpoint. Back to the proof of the proposition. With these two lemmas we can prove, by induction on n that for any n, for any tree, if the tree has n vertices then it has n 1 edges. Base Case: n = 1. Then m = 0 and the proposition is true. Induction Step: Let k be an arbitrary natural number 1. Assume (IH) that every tree with k vertices has k 1 edges. We want to prove that a tree, G, with k + 1 vertices has k edges. Note that k + 1 2 so G has at least two distinct nodes. There must be a path between these two nodes and this path must have at least one edge. Therefore G is an edgy tree. By Lemma 19.12, G has at least one leaf (actually two, but we don t need this here). Let G be the graph obtained by removing this leaf. By Lemma 19.14, G is still a tree. It has k + 1 1 = k nodes, so we can apply the IH. Therefore, G has k 1 edges. When we removed the leaf from G we removed exactly one edge, because the degree of the leaf is 1. Hence G has one more edge that G, i.e., it has k 1 + 1 = k edges. 5