Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.
SE561 Math Foundations Week 11 Graphs I
Graph Theory in CS Route Search in Online Map Services
Graph Colouring Lecture 20: Nov 25.
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
Selected Topics in Data Networking Graph Representation.
Applied Discrete Mathematics Week 12: Trees
Graphs.
9.2 Graph Terminology and Special Types Graphs
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,
1 Graphs Chapters 9.1 and 9.2 University of Maryland Chapters 9.1 and 9.2 Based on slides by Y. Peng University of Maryland.
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
Module #19: Graph Theory: part I Rosen 5 th ed., chs. 8-9 내년 3 월 ? 교환 학생 프로그램 영어 점수 미리미리 준비하세요.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
aka “Undirected Graphs”
Copyright © Zeph Grunschlag, More on Graphs.
Advanced Computer Networks: Part 1 Complex Networks, P2P Networks and Swarm Intelligence on Graphs.
1 CS104 : Discrete Structures Chapter V Graph Theory.
9.1 Introduction to Graphs
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.
Graphs What are Graphs? General meaning in everyday math: A plot or chart of numerical data using a coordinate system. Technical meaning in discrete.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Chapter 1 Fundamental Concepts Introduction to Graph Theory Douglas B. West July 11, 2002.
Lecture 4.3: Closures and Equivalence Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
Lecture 5.4: Paths and Connectivity CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Zeph Grunschlag.
Lecture 4.2: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Basic properties Continuation
Lecture 4.2: Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Graphs Basic properties.
Lecture 5.1: Graphs Basics
Introduction to Graph Theory
Chapter 9: Graphs.
Great Theoretical Ideas in Computer Science for Some.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda.
COMPSCI 102 Introduction to Discrete Mathematics.
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.
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Graphs Chapters 10.1 and 10.2 University of Maryland Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
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
Lecture 5.2: Special Graphs and Matrix Representation
Lecture 19: CONNECTIVITY Sections
Applied Discrete Mathematics Week 13: Graphs
Copyright © Zeph Grunschlag,
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS 250, Discrete Structures, Fall 2015
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
CS 250, Discrete Structures, Fall 2014
CS 250, Discrete Structures, Fall 2015
Let us switch to a new topic:
Lecture 5.3: Graph Isomorphism and Paths
Discrete Mathematics for Computer Science
Applied Discrete Mathematics Week 13: Graphs
Lecture 3.1: Mathematical Induction
Presentation transcript:

Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag

Lecture Special Graphs and Matric Representation Course Admin – Homework 4 Due this Thursday at 11am Also has a 20-pointer bonus problems Please submit on time 10/12/20152

Course Admin -- Final Exam Tuesday, December 10, 10:45am- 1:15pm, lecture room 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.*) Final Exam Topics provided Our last lecture will be this Thursday We plan to do a final exam review then Lecture Special Graphs and Matric Representation10/12/20153

Lecture Special Graphs and Matric Representation Outline Special Types of Graphs Some Graph Operations Adjacency Matrices 10/12/20154

A Theorem for Practice Theorem: For a set V with n elements, the (maximum) possible number of edges in a simple graph are n(n-1)/2. Proof: Technique: mathematical induction Base step (n=1): Clearly a graph with 1 vertex has 0 (= 1(1-1)/2) edges. Induction step: Assume to be true for n=k. A graph with k vertices has at max k(k-1)/2 edges. Now, show to be true for n=k+1. Consider a graph with k+1 edges. It will have additional k edges which will connect the k+1 th vertex with every other vertex. This means, it will have a total of k(k-1)/2 + k = k(k+1)/2 edges. Lecture Special Graphs and Matric Representation10/12/20155

Handshaking Theorem There are two ways to count the number of edges in the above graph: 1. Just count the set of edges: 7 2. Count seeming edges vertex by vertex and divide by 2 because double-counted edges: (deg(1)+deg(2)+deg(3)+deg(4))/2 = ( )/2 = 14/2 = e1e1 e3e3 e2e2 e4e4 e5e5 e6e6 e7e7 Lecture Special Graphs and Matric Representation10/12/20156

Handshaking Theorem Theorem: In an undirected graph In a directed graph Q: In a party of 5 people can each person be friends with exactly three others? Lecture Special Graphs and Matric Representation10/12/20157

Handshaking Theorem A: Imagine a simple graph with 5 people as vertices and edges being undirected edges between friends (simple graph assuming friendship is symmetric and irreflexive). Number of friends each person has is the degree of the person. Handshaking would imply that |E | = (sum of degrees)/2 or 2|E | = (sum of degrees) = (5·3) = 15. Impossible as 15 is not even. In general: Lecture Special Graphs and Matric Representation10/12/20158

Handshaking Theorem Lemma: The number of vertices of odd degree must be even in an undirected graph. Proof : Let us prove by contradiction. Suppose that number of vertices with odd degrees is not even, i.e., odd  2|E | = (Sum of degrees of vertices with even degrees) + (Sum of degrees of vertices with odd degrees)  even = even + odd = odd –- this is impossible  contradiction 10/12/20159

Complete Graphs - K n A simple graph is complete if every pair of distinct vertices share an edge. The notation K n denotes the complete graph on n vertices. K 1 K 2 K 3 K 4 K 5 Lecture Special Graphs and Matric Representation10/12/201510

Cycles - C n The cyclic graph C n is a circular graph with V = {0,1,2,…,n-1} where vertex with index i is connected to the vertices with indices i +1 mod n and i -1 mod n. They look like polygons: C 1 C 2 C 3 C 4 C 5 Q: What type of graphs are C 1 and C 2 ? Lecture Special Graphs and Matric Representation10/12/201511

Wheels - W n A: Pseudographs The wheel graph W n is just a cycle graph with an extra vertex in the middle: W 1 W 2 W 3 W 4 W 5 Usually consider wheels with 3 or more spokes only. Lecture Special Graphs and Matric Representation10/12/201512

Hypercubes - Q n The n-cube Q n is defined recursively. Q 0 is just a vertex. Q n+1 is gotten by taking 2 copies of Q n and joining each vertex v of Q n with its copy v’ : Q 0 Q 1 Q 2 Q 3 Q 4 Lecture Special Graphs and Matric Representation10/12/201513

Bipartite Graphs A simple graph is bipartite if V can be partitioned into V = V 1  V 2 so that any two adjacent vertices are in different parts of the partition. Another way of expressing the same idea is bichromatic: vertices can be colored using two colors so that no two vertices of the same color are adjacent. Lecture Special Graphs and Matric Representation10/12/201514

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201515

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201516

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201517

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201518

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201519

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201520

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201521

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201522

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201523

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201524

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Lecture Special Graphs and Matric Representation10/12/201525

Bipartite Graphs EG: C 4 is a bichromatic: And so is bipartite, if we redraw it: Q: For which n is C n bipartite? Lecture Special Graphs and Matric Representation 10/12/201526

Bipartite Graphs A: C n is bipartite when n is even. For even n color all odd numbers red and all even numbers green so that vertices are only adjacent to opposite color. If n is odd, C n is not bipartite. If it were, color 0 red. So 1 must be green, and 2 must be red. This way, all even numbers must be red, including vertex n-1. But n-1 connects to 0 . Lecture Special Graphs and Matric Representation10/12/201527

Complete Bipartite - K m,n When all possible edges exist in a simple bipartite graph with m red vertices and n green vertices, the graph is called complete bipartite and the notation K m,n is used. EG: K 2,3 K 4,5 Lecture Special Graphs and Matric Representation10/12/201528

Subgraphs Notice that the 2-cube occurs inside the 3-cube. In other words, Q 2 is a subgraph of Q 3 : DEF: Let G = (V,E ) and H = (W,F ) be graphs. H is said to be a subgraph of G, if W  V and F  E. Q: How many Q 2 subgraphs does Q 3 have? Lecture Special Graphs and Matric Representation10/12/201529

Subgraphs A: Each face of Q 3 is a Q 2 subgraph so the answer is 6, as this is the number of faces on a 3-cube: Lecture Special Graphs and Matric Representation10/12/201530

Unions In previous example can actually reconstruct the 3-cube from its 6 2-cube faces: Lecture Special Graphs and Matric Representation10/12/201531

Unions If we assign the 2-cube faces (aka Squares) the names S 1, S 2, S 3, S 4, S 5, S 6 then Q 3 is the union of its faces: Q 3 = S 1  S 2  S 3  S 4  S 5  S 6 Lecture Special Graphs and Matric Representation10/12/201532

Unions DEF: Let G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) be two simple graphs (and V 1,V 2 may or may not be disjoint). The union of G 1, G 2 is formed by taking the union of the vertices and edges. I.E: G 1  G 2 = (V 1  V 2, E 1  E 2 ). A similar definitions can be created for unions of digraphs, multigraphs, pseudographs, etc. Lecture Special Graphs and Matric Representation10/12/201533

Adjacency Matrix We already saw a way of representing relations on a set with a Boolean matrix: R digraph(R) M R /12/201534

Adjacency Matrix Since digraphs are relations on their vertex sets, can adopt the concept to represent digraphs. In the context of graphs, we call the representation an adjacency matrix : For a digraph G = (V,E ) define matrix A G by: Rows, Columns –one for each vertex in V Value at i th row and j th column is 1 if i th vertex connects to j th vertex (i  j ) 0 otherwise Lecture Special Graphs and Matric Representation10/12/201535

Adjacency Matrix: Directed Multigraphs Can easily generalize to directed multigraphs by putting in the number of edges between vertices, instead of only allowing 0 and 1: For a directed multigraph G = (V,E ) define the matrix A G by: Rows, Columns –one for each vertex in V Value at i th row and j th column is The number of edges with source the i th vertex and target the j th vertex Lecture Special Graphs and Matric Representation10/12/201536

Adjacency Matrix: Directed Multigraphs Q: What is the adjacency matrix? Lecture Special Graphs and Matric Representation10/12/201537

Adjacency Matrix: Directed Multigraphs A: Lecture Special Graphs and Matric Representation10/12/201538

Adjacency Matrix: General Undirected graphs can be viewed as directed graphs by turning each undirected edge into two oppositely oriented directed edges, except when the edge is a self-loop in which case only 1 directed edge is introduced. EG: Lecture Special Graphs and Matric Representation10/12/201539

Adjacency Matrix: General Q: What’s the adjacency matrix? Lecture Special Graphs and Matric Representation10/12/201540

Adjacency Matrix: General A: Notice that this matrix is symmetric Lecture Special Graphs and Matric Representation10/12/201541

Lecture Special Graphs and Matric Representation Today’s Reading Rosen 10.2 and /12/201542