Applied Discrete Mathematics Week 13: Graphs

Slides:



Advertisements
Similar presentations
13 May 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Advertisements

Representing Relations Using Matrices
Applied Discrete Mathematics Week 12: Trees
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.
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
Selected Topics in Data Networking Graph Representation.
Applied Discrete Mathematics Week 12: Trees
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Let us switch to a new topic:
Applied Discrete Mathematics Week 10: Equivalence Relations
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Graphs Chapter 10.
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.
Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
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)
9.2: Graph Terminology. Special Simple Graphs Complete GraphsK 1,… CyclesC 3,… WheelsW 3,… N-cubesQ 1,… Complete bipartiteK 2,2,…
1 CS104 : Discrete Structures Chapter V Graph Theory.
Based on slides by Y. Peng University of Maryland
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 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
And before you really hate (mathematical) relations and begin to break your (social) relations, let’s switch to a new topic: Graphs Discrete Structures.
1 Graphs Terminology By: Sandeep Tuli Astt. Prof. CSE.
Chapter 9: Graphs.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
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.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
An Introduction to Graph Theory
Chapter 9 (Part 1): Graphs
Applied Discrete Mathematics Week 14: Trees
Applied Discrete Mathematics Week 13: Graphs
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Graphs Rosen, Chapter 8.
Lecture 5.2: Special Graphs and Matrix Representation
Lecture 19: CONNECTIVITY Sections
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Copyright © Zeph Grunschlag,
Graph Graphs and graph theory can be used to model:
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Representing Graphs and
Chapter 5 Fundamental Concept
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.
Applied Discrete Mathematics Week 10: Equivalence Relations
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Graphs.
Based on slides by Y. Peng University of Maryland
Chapter 13 (Part 1): Graphs
Rosen 5th ed., chs. 8-9 ~44 slides (more later), ~3 lectures
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Relations (sections 7.1 – 7.5)
Summary 3 Discrete Probability (sections )
CS100: Discrete structures
G-v, or G-{v} When we remove a vertex v from a graph, we must remove all edges incident with the vertex v. When a edge is removed from a graph, without.
Let us switch to a new topic:
Lecture 10: Graphs Graph Terminology Special Types of Graphs
HW 3 (Due Wednesday Feb 6) Create slide(s) for your 1 minute presentation on a graph theory application. Make sure your slide(s) include (1) Define the.
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
HW 3 (Due Wednesday Feb 6) Create slide(s) for your 1 minute presentation on a graph theory application. Make sure your slide(s) include (1) Define the.
Agenda Review Lecture Content: Shortest Path Algorithm
Representing Relations Using Matrices
Presentation transcript:

Applied Discrete Mathematics Week 13: Graphs Graph Terminology Theorem: An undirected graph has an even number of vertices of odd degree. Idea: There are three possibilities for adding an edge to connect two vertices in the graph: Before: After: Both vertices have even degree Both vertices have odd degree Both vertices have odd degree Both vertices have even degree One vertex has odd degree, the other even One vertex has even degree, the other odd April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology There are two possibilities for adding a loop to a vertex in the graph: Before: After: The vertex has even degree The vertex has even degree The vertex has odd degree The vertex has odd degree April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology So if there is an even number of vertices of odd degree in the graph, it will still be even after adding an edge. Therefore, since an undirected graph with no edges has an even number of vertices with odd degree (zero), the same must be true for any undirected graph. Please also study the proof on 4th Edition: page 446 5th Edition: page 547 6th edition: page 599 7th edition: page 653 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology Definition: When (u, v) is an edge of the graph G with directed edges, u is said to be adjacent to v, and v is said to be adjacent from u. The vertex u is called the initial vertex of (u, v), and v is called the terminal vertex of (u, v). The initial vertex and terminal vertex of a loop are the same. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology Definition: In a graph with directed edges, the in-degree of a vertex v, denoted by deg-(v), is the number of edges with v as their terminal vertex. The out-degree of v, denoted by deg+(v), is the number of edges with v as their initial vertex. Question: How does adding a loop to a vertex change the in-degree and out-degree of that vertex? Answer: It increases both the in-degree and the out-degree by one. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology Example: What are the in-degrees and out-degrees of the vertices a, b, c, d in this graph: deg-(a) = 1 deg+(a) = 2 deg-(b) = 4 deg+(b) = 2 a b c d deg-(d) = 2 deg+(d) = 1 deg-(c) = 0 deg+(c) = 2 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Graph Terminology Theorem: Let G = (V, E) be a graph with directed edges. Then: vV deg-(v) = vV deg+(v) = |E| This is easy to see, because every new edge increases both the sum of in-degrees and the sum of out-degrees by one. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: The complete graph on n vertices, denoted by Kn, is the simple graph that contains exactly one edge between each pair of distinct vertices. K1 K2 K3 K4 K5 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: The cycle Cn, n  3, consists of n vertices v1, v2, …, vn and edges {v1, v2}, {v2, v3}, …, {vn-1, vn}, {vn, v1}. C3 C4 C5 C6 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: We obtain the wheel Wn when we add an additional vertex to the cycle Cn, for n  3, and connect this new vertex to each of the n vertices in Cn by adding new edges. W3 W4 W5 W6 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: The n-cube, denoted by Qn, is the graph that has vertices representing the 2n bit strings of length n. Two vertices are adjacent if and only if the bit strings that they represent differ in exactly one bit position. 000 100 110 010 001 101 111 011 00 10 11 01 1 Q1 Q2 Q3 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: A simple graph is called bipartite if its vertex set V can be partitioned into two disjoint nonempty sets V1 and V2 such that every edge in the graph connects a vertex in V1 with a vertex in V2 (so that no edge in G connects either two vertices in V1 or two vertices in V2). For example, consider a graph that represents each person in a mixed-doubles tennis tournament (i.e., teams consist of one female and one male player). Players of the same team are connected by edges. This graph is bipartite, because each edge connects a vertex in the subset of males with a vertex in the subset of females. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Example I: Is C3 bipartite? No, because there is no way to partition the vertices into two sets so that there are no edges with both endpoints in the same set. v1 v2 v3 Example II: Is C6 bipartite? v5 v1 v2 v3 v4 v6 v1 v6 v2 v5 v3 v4 Yes, because we can display C6 like this: April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Special Graphs Definition: The complete bipartite graph Km,n is the graph that has its vertex set partitioned into two subsets of m and n vertices, respectively. Two vertices are connected if and only if they are in different subsets. K3,2 K3,4 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Operations on Graphs Definition: A subgraph of a graph G = (V, E) is a graph H = (W, F) where WV and FE. Note: Of course, H is a valid graph, so we cannot remove any endpoints of remaining edges when creating H. Example: K5 subgraph of K5 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Operations on Graphs Definition: The union of two simple graphs G1 = (V1, E1) and G2 = (V2, E2) is the simple graph with vertex set V1  V2 and edge set E1  E2. The union of G1 and G2 is denoted by G1  G2. G1 G2 G1  G2 = K5 April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs a b c d a b c d Vertex Adjacent Vertices a b, c, d b a, d c d a, b, c Initial Vertex Terminal Vertices a c b d a, b, c April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Definition: Let G = (V, E) be a simple graph with |V| = n. Suppose that the vertices of G are listed in arbitrary order as v1, v2, …, vn. The adjacency matrix A (or AG) of G, with respect to this listing of the vertices, is the nn zero-one matrix with 1 as its (i, j)th entry when vi and vj are adjacent, and 0 otherwise. In other words, for an adjacency matrix A = [aij], aij = 1 if {vi, vj} is an edge of G, aij = 0 otherwise. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? a b c d Solution: Note: Adjacency matrices of undirected graphs are always symmetric. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs For the representation of graphs with multiple edges, we can no longer use zero-one matrices. Instead, we use matrices of natural numbers. The (i, j)th entry of such a matrix equals the number of edges that are associated with {vi, vj}. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs

Applied Discrete Mathematics Week 13: Graphs Representing Graphs Example: What is the adjacency matrix AG for the following graph G based on the order of vertices a, b, c, d ? a b c d Solution: Note: For undirected graphs, adjacency matrices are symmetric. April 20, 2017 Applied Discrete Mathematics Week 13: Graphs