Chapter 9 (Part 1): Graphs

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Graph-02.
1 Slides based on those of Kenneth H. Rosen Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Graphs.
Discrete Mathematics and Its Applications
1 Section 8.1 Introduction to Graphs. 2 Graph A discrete structure consisting of a set of vertices and a set of edges connecting these vertices –used.
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.
Applied Discrete Mathematics Week 12: Trees
Chapter 11 Graphs and Trees This handout: Terminology of Graphs Eulerian Cycles.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE Discrete.
Let us switch to a new topic:
Graphs Rosen 8.1, 8.2. There Are Many Uses for Graphs! Networks Data organizations Scene graphs Geometric simplification Program structure and processes.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Graphs Chapter 10.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 1): Graphs  Introduction to Graphs (9.1)
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.
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.
9.1 Introduction to Graphs
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.
Discrete Structures Graphs 1 (Ch. 10) Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore.
9 Graphs. A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes) and E, a set of edges. Each edge has either one or two vertices associated.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
CS 103 Discrete Structures Lecture 20
Foundations of Discrete Mathematics Chapters 9 and 10 By Dr. Dalia M. Gil, Ph.D.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 1): Graphs  Introduction to Graphs (9.1)
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
Basic properties Continuation
Introduction to Graphs Slides by Gene Boggess
Graphs Basic properties.
1 Graphs Terminology By: Sandeep Tuli Astt. Prof. CSE.
Chapter Graphs and Graph Models
Chapter 9: Graphs.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
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.
رياضيات متقطعة لعلوم الحاسب 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
Applied Discrete Mathematics Week 13: Graphs
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Graphs Rosen, Chapter 8.
Lecture 19: CONNECTIVITY Sections
Applied Discrete Mathematics Week 13: Graphs
Copyright © Zeph Grunschlag,
Graph Graphs and graph theory can be used to model:
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
Graphs Rosen, Chapter 8.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Graphs Slides are adopted from “Discrete.
Graphs and Graph Models
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Chapter 13 (Part 1): Graphs
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
10.1 Graphs and Graph Models
Graph Theory What is a graph?.
5 The Mathematics of Getting Around
Let us switch to a new topic:
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Discrete Math II Howon Kim
Discrete Math II Howon Kim
Chapter 8 (Part 2): Relations
Presentation transcript:

Chapter 9 (Part 1): Graphs Introduction to Graphs (9.1) Graph Terminology (9.2)

History Basic ideas were introduced in the eighteenth century by Leonard Euler (Swiss mathematician) Euler was interested in solving the Königsberg bridge problem (Town of Königsberg is in Kaliningrad, Republic of Russia) Graphs have several applications in many areas: Study of the structure of the World Wide Web Shortest path between 2 cities in a transportation network Molecular chemistry Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) There are 5 main categories of graphs: Simple graph Multigraph Pseudograph Directed graph Directed multigraph Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Definition 1 A simple graph G = (V,E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges. Example: Telephone lines connecting computers in different cities. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Definition 2: A multigraph G = (V,E) consists of a set E of edges, and a function f from E to {{u,v} | u, v  V, u  v}. The edges e1 and e2 are called multiple or parallel edges if f(e1) = f(e2). Example: Multiple telephone lines connecting computers in different cities. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) San Fransisco Los Angeles Denver Chicago Detroit Washington New York A Computer network with multiple lines Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Definition 3: A pseudograph G = (V,E) consists of a set V of vertices, a set E of edges, and a function f from E to {{u,v} | u, v  V}. An edge is a loop if f(e) = {u,u} = {u} for some u  V. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) San Fransisco Los Angeles Denver Chicago Detroit Washington New York A Computer network with diagnostic lines Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Definition 4: A directed graph (V,E) consists of a set of vertices V and a set of edges E that are ordered pairs of elements of V. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) San Fransisco Los Angeles Denver Chicago Detroit Washington New York Host A Communication network with one-way telephone lines This example shows that the host computer can only receive data from other computer, it cannot emit

Introduction to Graphs (9.1) (cont.) Definition 5: A directed multigraph G = (V,E) consists of a set V of vertices, a set E of edges, and a function f from E to {{u,v} | u, v  V}. The edges e1 and e2 are multiple edges if f(e1) = f(e2). Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) San Fransisco Los Angeles Denver Chicago Detroit Washington New York A Computer network with multiple one-way telephone lines Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Modeling graphs Example: Competition between species in an ecological system can be modeled using a niche overlap graph. An undirected edge connect two vertices if the two species represented by these vertices compete for food. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Racoon Hawk Owl Opossum Shrew Mouse Woodpecker Crow Squirrel A niche overlap graph Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Example: Influence of one person in society A directed graph called an influence graph is used to model this behavior There is a directed edge from vertex a to vertex b if the person represented by a vertex a influences the person represented by vertex b. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Linda Deborah Fred Yvonne Brian An influence graph Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Introduction to Graphs (9.1) (cont.) Example: The World Wide Web can be modeled as a directed graph where each web page is represented by a vertex and where an edge connects 2 web pages if there is a link between the 2 pages Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) Basic Terminology Goal: Introduce graph terminology in order to further classify graphs Definition 1: Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if {u,v} is an edge of G. If e = {u,v}, the edge e is called incident with the vertices u and v. The edge e is also said to connect u and v. The vertices u and v are called endpoints of the edge {u,v}. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Definition 2: The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of that vertex. The degree of the vertex v is denoted by deg(v). Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Example: What are the degrees of the vertices in the graphs G and H? Solution: a f e g d c b G H a e d c b

Graph Terminology (9.2) (cont.) Theorem 1: The handshaking theorem Let G = (V,E) be an undirected graph with e edges. Then (Note that this applies even if multiple edges & loops are present.) Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Example: How many edges are there in a graph with ten vertices each of degree 6 ? Solution: Since the sum of the degrees of the vertices is 6*10 = 60  2e = 60. Therefore, e = 30 Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Theorem 2: An undirected graph has an even number of vertices of odd degree. Proof: Let V1 and V2 be the set of vertices of even degree and the set of vertices of odd degree, respectively, in an undirected graph G = (V,E). Then Since deg(v) is even for v  V1, the first term in the right-hand side of the last equality is even. Furthermore, the sum of the two terms on the right-hand side of the last equality is even, since this sum is 2e. Hence, the second term in the sum is also even. Since all the terms in this sum are odd, there must be an even number of such terms. Thus, there are an even number of vertices of odd degree. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Definition 3: 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 or end vertex of (u,v). The initial vertex and terminal vertex of a loop are the same. Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Definition 4: In a graph with directed edges the in-degree of a vertex v, denoted 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. (Note that a loop at a vertex contributes 1 to both the in-degree and the out-degree of this vertex) Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Example: Find the in-degree and the out-degree of each vertex in the graph G Solution: The in-degree of G are: deg-(a) = 2, deg-(b) = 2, deg-(c) = 3, deg-(d) = 2, deg-(e) = 3, and deg-(f) = 0. The in-degree of G are: deg+(a) = 4, deg+(b) = 1, deg+(c) = 2, deg+(d) = 2, deg+(e) = 3, and deg+(f) = 0 a b c f e Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs

Graph Terminology (9.2) (cont.) Theorem 3: Let G = (V,E) be a graph with directed edges. Then Dr. Djamel Bouchaffra CSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs