© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 1): Graphs  Introduction to Graphs (9.1)

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.
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
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.
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.
Module #19: Graph Theory: part I Rosen 5 th ed., chs. 8-9 내년 3 월 ? 교환 학생 프로그램 영어 점수 미리미리 준비하세요.
Foundations of Discrete Mathematics
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)
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.
Lecture 10: Graph-Path-Circuit
© 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.
Graphs G = (V,E) V is the vertex set. Vertices are also called nodes and points. E is the edge set. Each edge connects two different vertices. Edges are.
Basic properties Continuation
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
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.
Chapter 9 (Part 1): Graphs
Applied Discrete Mathematics Week 13: Graphs
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Lecture 19: CONNECTIVITY Sections
Applied Discrete Mathematics Week 13: Graphs
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.
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.
Graphs and Graph Models
Graphs Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
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?.
Let us switch to a new topic:
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Presentation transcript:

© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 1): Graphs  Introduction to Graphs (9.1)  Graph Terminology (9.2)

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 3 Introduction to Graphs (9.1)  There are 5 main categories of graphs: –Simple graph –Multigraph –Pseudograph –Directed graph –Directed multigraph

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 4 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 5 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 e 1 and e 2 are called multiple or parallel edges if f(e 1 ) = f(e 2 ). –Example: Multiple telephone lines connecting computers in different cities.

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

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 7 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 8 Introduction to Graphs (9.1) (cont.) San Fransisco Los Angeles Denver Chicago Detroit Washington New York A Computer network with diagnostic lines

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 9 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.

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

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 11 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 e 1 and e 2 are multiple edges if f(e 1 ) = f(e 2 ).

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

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 13 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 14 Introduction to Graphs (9.1) (cont.) Racoon Hawk Owl Opossum Shrew Mouse Woodpecker Crow Squirrel A niche overlap graph

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 15 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 16 Introduction to Graphs (9.1) (cont.) An influence graph Linda DeborahFred Yvonne Brian

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 17 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 18 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 19 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).

– Example: What are the degrees of the vertices in the graphs G and H? Solution: a fe g d cb G H a e d cb

Dr. Djamel BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 21 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 22 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 23 Graph Terminology (9.2) (cont.) –Theorem 2: An undirected graph has an even number of vertices of odd degree. Proof: Let V 1 and V 2 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  V 1, 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 24 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 25 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 BouchaffraCSE 504 Discrete Structures & Foundations of Computer Science, Ch. 8 (part 1): Graphs 26 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 e f cb

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