Math.3336: Discrete Mathematics. Chapter 10 Graph Theory

Similar documents
(5.2) 151 Math Exercises. Graph Terminology and Special Types of Graphs. Malek Zein AL-Abidin

Introduction to Graphs

Graphs. Pseudograph: multiple edges and loops allowed

Graphs. Introduction To Graphs: Exercises. Definitions:

DEFINITION OF GRAPH GRAPH THEORY GRAPHS ACCORDING TO THEIR VERTICES AND EDGES EXAMPLE GRAPHS ACCORDING TO THEIR VERTICES AND EDGES

Section 8.2 Graph Terminology. Undirected Graphs. Definition: Two vertices u, v in V are adjacent or neighbors if there is an edge e between u and v.

GRAPH THEORY: AN INTRODUCTION

Week 8: The fundamentals of graph theory; Planar Graphs 25 and 27 October, 2017

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

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

CPCS Discrete Structures 1

Introduction III. Graphs. Motivations I. Introduction IV

Elements of Graph Theory

Varying Applications (examples)

Math 776 Graph Theory Lecture Note 1 Basic concepts

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

Basics of Graph Theory

Assignment 4 Solutions of graph problems

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.

Math 170- Graph Theory Notes

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

Majority and Friendship Paradoxes

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Foundations of Discrete Mathematics

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

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

CMSC 380. Graph Terminology and Representation

Artificial Intelligence

An Introduction to Graph Theory

CS200: Graphs. Prichard Ch. 14 Rosen Ch. 10. CS200 - Graphs 1

Chapter 1 Graph Theory

Introduction to Graph Theory

Discrete Mathematics (2009 Spring) Graphs (Chapter 9, 5 hours)

An Introduction to Graph Theory

Graph Theory. Part of Texas Counties.

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

Lecture 6: Graph Properties

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G))

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

CS 441 Discrete Mathematics for CS Lecture 26. Graphs. CS 441 Discrete mathematics for CS. Final exam

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Computer Science 280 Fall 2002 Homework 10 Solutions

HW Graph Theory SOLUTIONS (hbovik) - Q

Paths, Circuits, and Connected Graphs

BIL694-Lecture 1: Introduction to Graphs

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

DS UNIT 4. Matoshri College of Engineering and Research Center Nasik Department of Computer Engineering Discrete Structutre UNIT - IV

Discrete Mathematics

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

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

Chapter 11: Graphs and Trees. March 23, 2008

ECS 20 Lecture 17b = Discussion D8 Fall Nov 2013 Phil Rogaway

Intermediate Math Circles Wednesday, February 8, 2017 Graph Theory I

Discrete Wiskunde II. Lecture 6: Planar Graphs

Discrete mathematics II. - Graphs

Ma/CS 6b Class 5: Graph Connectivity

Lecture 3: Recap. Administrivia. Graph theory: Historical Motivation. COMP9020 Lecture 4 Session 2, 2017 Graphs and Trees

Solution to Graded Problem Set 4

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402

Graphs and Isomorphisms

The vertex set is a finite nonempty set. The edge set may be empty, but otherwise its elements are two-element subsets of the vertex set.

Scheduling, Map Coloring, and Graph Coloring

Combinatorics Summary Sheet for Exam 1 Material 2019

Discrete mathematics

Math 454 Final Exam, Fall 2005

Mathematics and Statistics, Part A: Graph Theory Problem Sheet 1, lectures 1-4

2. CONNECTIVITY Connectivity

Math 575 Exam 3. (t). What is the chromatic number of G?

Number Theory and Graph Theory

Chapter 2 Graphs. 2.1 Definition of Graphs

Graph Theory CS/Math231 Discrete Mathematics Spring2015

5 Graphs

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Graph Theory

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory

Algorithms: Graphs. Amotz Bar-Noy. Spring 2012 CUNY. Amotz Bar-Noy (CUNY) Graphs Spring / 95

The University of Sydney MATH2969/2069. Graph Theory Tutorial 2 (Week 9) 2008

GRAPH THEORY - FUNDAMENTALS

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Assignment 1 Introduction to Graph Theory CO342

Algorithms. Graphs. Algorithms

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Math 443/543 Graph Theory Notes 5: Planar graphs and coloring

Graph Theory Questions from Past Papers

Proposition 1. The edges of an even graph can be split (partitioned) into cycles, no two of which have an edge in common.

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

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

CMSC Honors Discrete Mathematics

CSE 417: Algorithms and Computational Complexity. 3.1 Basic Definitions and Applications. Goals. Chapter 3. Winter 2012 Graphs and Graph Algorithms

Introduction to Graphs

INTRODUCTION TO GRAPH THEORY. 1. Definitions

Course Introduction / Review of Fundamentals of Graph Theory

Graph Theory Mini-course

Instant Insanity Instructor s Guide Make-it and Take-it Kit for AMTNYS 2006

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

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

ON THE STRUCTURE OF SELF-COMPLEMENTARY GRAPHS ROBERT MOLINA DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE ALMA COLLEGE ABSTRACT

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.

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 ( )

Transcription:

Math.3336: Discrete Mathematics Chapter 10 Graph Theory Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 1/38

Assignments to work on Homework #9 due Friday, 11/30, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 2/38

Chapter 10 Graphs Chapter 10 Overview Graphs and Graph Models Section 10.1 Graph Terminology/Special Types of Graphs Section 10.2 Representing Graphs and Graph Isomorphism Section 10.3 Connectivity Section 10.4 Euler and Hamiltonian Graphs Section 10.5 Shortest-Path Problems Section 10.6 Planar Graphs Section 10.7 Graph Coloring Section 10.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 3/38

Graphs and Graph Models Graph is a fundamental mathematical structure in computer science Graph G = (V, E) consists of a set of vertices (nodes) V and edges E between these nodes Lots of applications in many areas: web search, transportation, biological models,... Will encounter graphs and graph algorithms in many different courses of Computer Science Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 4/38

Example: Social Network as a Graph Nodes represent users (Michael, Jessica, Stuart... ) Edges represent friendship (e.g., Michael is friends with Jessica) Edge between nodes u and v is written as (u, v) e.g., (Sarah, Andrew) is an edge in this graph. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 5/38

Terminology Two nodes u and v are adjacent if there exists an edge between them (e.g., nodes 1 and 3) An edge (u, v) is incident with nodes u and v Degree of a vertex v, written deg(v), is the number of edges incident with it. The loop at a vertex contributes twice to the degree of that vertex. Neighborhood of a vertex v, denoted by N (v), is the set of vertices adjacent to it. If A V, then N (A) = v A N (v) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 6/38

Question Consider a graph G with vertices a, b, c, d and edges (a, b), (b, c), (a, c), (c, d), (b, d). 1 Draw this graph. 2 What is the degree of each vertex? deg(a) = deg(d) = 2, deg(b) = deg(c) = 3 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 7/38

Simple Graphs Graph contains a loop if any node is adjacent to itself A simple graph does not contain loops and there exists at most one edge between any pair of vertices Graphs that have multiple edges connecting two vertices are called multi-graphs A pseudograph may include loops, as well as multiple edges connecting the same pair of vertices. Most graphs we will look at are simple graphs Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 8/38

Graph Models: Computer Networks To model a computer network where we are only concerned whether two data centers are connected by a communications link, we use a simple graph. To model a computer network where we care about the number of links between data centers, we use a multigraph. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 9/38

Graph Models: Computer Networks(continued) To model a computer network with diagnostic links at data centers, we use a pseudograph, as loops are needed. To model a network with multiple one-way links, we use a directed multigraph. Note that we could use a directed graph without multiple edges if we only care whether there is at least one link from a data center to another data center. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 10/38

Handshaking Theorem Let G = (V, E) be a graph with m edges. Then: deg(v) = 2m v V Intuition: Each edge contributes two to the sum of the degrees Proof: By induction on the number of edges. Base case: If m = 0, then sum of degrees is 0. Induction: (Sketch) Remove one arbitrary edge from G, now inductive hypothesis applies. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 11/38

Applications of Handshaking Theorem Is it possible to construct a graph with 5 vertices where each vertex has degree 3? No, because the sum of degrees must be an even number. Every graph has an even number of vertices of odd degree. If n people go to a party and everyone shakes everyone else s hand, how many handshakes occur? 2m = v V deg(v) = n(n 1) m = n(n 1)/2 because people are vertices, and edges is the number of handshakes. Each vertex has degree n-1. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 12/38

Directed Graphs All graphs we considered so far are undirected In undirected graphs, edge (u, v) same as (v, u) But sometimes necessary to assign directions to edges (e.g., links from one webpage to another) A directed edge (arc) is an ordered pair (u, v) (i.e., (u, v) not same as (v, u)) A directed graph is a graph with directed edges Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 13/38

In-Degree and Out-Degree of Directed Graphs The in-degree of a vertex v, written deg (v), is the number of edges going into v deg (a) = 1 The out-degree of a vertex v, written deg + (v), is the number of edges leaving v deg + (a) = 2 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 14/38

Handshaking Theorem for Directed Graphs Let G = (V, E) be a directed graph. Then: deg (v) = deg + (v) = E v V v V v V deg (v) = 5 v V deg+ (v) = 5 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 15/38

Subgraphs A graph G = (V, E) is a subgraph of another graph G = (V, E ) if V V and E E Example: Every graph is a subgraph of itself. Graph G is a proper subgraph of G if G G. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 16/38

Question Consider a graph G with vertices {(v 1, v 2, v 3, v 4 )} and edges (v 1, v 3 ), (v 1, v 4 ), (v 2, v 3 ). Which of the following are subgraphs of G? 1 Graph G 1 with vertex v 1 and edge (v 1, v 3 ) 2 Graph G 2 with vertices {v 1, v 3 } and edge (v 1, v 3 ) 3 Graph G 3 with vertices {v 1, v 3 } and no edges 4 Graph G 4 with vertices {v 1, v 2 } and edge (v 1, v 2 ) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 17/38

Induced Subgraph Consider a graph G = (V, E) and a set of vertices V such that V V Graph G is the induced subgraph of G with respect to V if: 1 G contains exactly those vertices in V 2 For all u, v V, edge (u, v) G iff (u, v) G Subgraph induced by vertices {C, D}: Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 18/38

Complete Graphs A complete graph on n vertices K n is a simple undirected graph in which every pair of vertices is connected by one edge. How many edges does a complete graph with n vertices have? n(n 1)/2 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 19/38

Cycle Graphs A cycle graph C n, n 3 consists of n vertices v 1, v 2,..., v n and edges (v 1, v 2 ), (v 2, v 3 ),..., (v n 1, v n ), (v n, v 1 ). How many edges does a cycle graph with n vertices have? n Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 20/38

Wheel Graphs A wheel graph W n, n 3 is obtained when an additional vertex is added to the cycle C n and connected to all the vertices of C n by new edges. How many edges does a wheel graph with n vertices have? 2n Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 21/38

Bipartite graphs A simple undirected graph G = (V, E) is called bipartite if V can be partitioned into two disjoint sets V 1 and V 2 such that every edge in E connects a V 1 vertex to a V 2 vertex C V1 V2 A B E D A C E B D Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 22/38

Example I Bipartite and Non-Bi-partite Graphs Is this graph bipartite? no A B C What about this graph? yes A C E B D F Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 23/38

Example II Bipartite and Non-Bi-partite Graphs Which of these graphs is bipartite? G Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 24/38

Bipartite Graphs and Graph Colouring A simple graph is bipartite if and only if it is possible to assign one of two different colors to each vertex of the graph so that no two adjacent vertices are assigned the same color. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 25/38

Graph Coloring A coloring of a graph is the assignment of a color to each vertex so that no two adjacent vertices are assigned the same color. A graph is k-colorable if it is possible to color it using k colors. e.g., graph on left is 3-colorable Is it also 2-colorable? No. Look at blue vertex. You would need to give its neighbors different colors, but you cannot because there are edges between them. The chromatic number of a graph is the least number of colors needed to color it. What is the chromatic number of this graph? 3 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 26/38

Question Consider a graph G with vertices {v 1, v 2, v 3, v 4 } and edges (v 1, v 2 ), (v 1, v 3 ), (v 2, v 3 ), (v 2, v 4 ). Which of the following are valid colorings for G? 1 v 1 = red, v 2 = green, v 3 = blue not valid 2 v 1 = red, v 2 = green, v 3 = blue, v 4 = red valid 3 v 1 = red, v 2 = green, v 3 = red, v 4 = blue not valid Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 27/38

Examples What are the chromatic numbers for these graphs? A B A B A B C D C D C D Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 28/38

Applications of Graph Coloring Graph coloring has lots of applications, particularly in scheduling. Example: What s the minimum number of time slots needed so that no student is enrolled in conflicting classes? 311 312 314 331 429 439 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 29/38

Bipartite Graphs and Colorability Prove that a graph G = (V, E) is bipartite if and only if it is 2-colorable. Proof. Assume bipartite. Then, we can partition V into two disjoint sets V 1 and V 2 such that every edge connects a V 1 to a V 2 vertex. Assign V 1 vertices color red, and V 2 vertices color blue. This is a valid coloring... other direction similar. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 30/38

Complete graphs and Colorability Prove that any complete graph K n has chromatic number n. Proof. Proof is by contradiction: Suppose it s n 1 colorable. This would imply there exists two vertices with the same color. But in K n any pair of vertices is connected, hence this cannot be a valid coloring. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 31/38

Complete Bipartite Graphs A complete bipartite graph K m,n is a graph that has its vertex set partitioned into two subsets V 1 of size m and V 2 of size n such that there is an edge from every vertex in V 1 to every vertex in V 2. How many edges does a complete graph K m,n have? mn Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 32/38

Representing Graphs and Graph Isomorphisms An adjacency list can be used to represent a graph with no multiple edges by specifying the vertices that are adjacent to each vertex of graph. Suppose a graph G = (V, E) is a simple graph with n vertices, say v 1, v 2,..., v n. The adjacency matrix A G of G with respect to the listing of vertices is the n n zero-one matrix with 1 as its (i, j )th entry when v i and v j are adjacent, and 0 elsewhere. Let G = (V, E) be an undirected graph with vertices v 1, v 2,..., v n, and edges e 1, e 2,..., e m. The incidence matrix with respect to the ordering of V and E is the n m matrix M = [m ij ], where m ij = 1 when edge e j is incident with v i, and 0 elsewhere. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 33/38

Graph Isomorphisms The simple graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) are isomorphic if there is a one-to-one and onto function f from V 1 to V 2 with the property that a and b are adjacent in G 1 if and only if f (a) and f (b) are adjacent in G 2, a, b V 1 Such a function is called isomorphism. Two simple gaphs that are not isomorphic are called nonisomorphic. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 34/38

Example I Show that the graphs G = (V, E) and H = (W, F ) are isomorphic. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 35/38

Example II Show that the graphs G = (V, E) and H = (W, F ) are not isomorphic. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 36/38

Example III Determine whether the graphs G = (V, E) and H = (W, F ) are isomorphic. Non-Isomorphic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 37/38

Example IV Determine whether the graphs G = (V, E) and H = (W, F ) are isomorphic. Isomorphic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 10 Graph Theory 38/38