رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Based on slides by Y. Peng University of Maryland
Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
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
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.
Introduction to Graphs
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
1 Section 8.4 Connectivity. 2 Paths In an undirected graph, a path of length n from u to v, where n is a positive integer, is a sequence of edges e 1,
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:
Graphs Rosen 8.1, 8.2. There Are Many Uses for Graphs! Networks Data organizations Scene graphs Geometric simplification Program structure and processes.
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.
© 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 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,
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.
Based on slides by Y. Peng University of Maryland
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.
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.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
© 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.
And before you really hate (mathematical) relations and begin to break your (social) relations, let’s switch to a new topic: Graphs Discrete Structures.
Basic properties Continuation
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graphs Basic properties.
1 Graphs Terminology By: Sandeep Tuli Astt. Prof. CSE.
Chapter 9: Graphs.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
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.
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 14: Trees
Applied Discrete Mathematics Week 13: Graphs
Chapter 9 (Part 2): Graphs
Let us switch to a new topic:
Applied Discrete Mathematics Week 13: Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
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
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 Chapters 10.1 and 10.2 Based on slides by Y. Peng University of Maryland.
Graphs.
Based on slides by Y. Peng University of Maryland
Chapters 8.1 and 8.2 Based on slides by Y. Peng University of Maryland
CS100: Discrete structures
Connectivity Section 10.4.
Let us switch to a new topic:
Graphs G = (V, E) V are the vertices; E are the edges.
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
Presentation transcript:

رياضيات متقطعة لعلوم الحاسب MATH 226

Chapter 10

Introduction to Graphs Definition: 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. For each e  E, e = {u, v} where u, v  V. An undirected graph (not simple) may contain loops. An edge e is a loop if e = {u, u} for some u  V.

4 Introduction to Graphs Definition: A directed graph G = (V, E) consists of a set V of vertices and a set E of edges that are ordered pairs of elements in V. For each e  E, e = (u, v) where u, v  V. An edge e is a loop if e = (u, u) for some u  V. A simple graph is just like a directed graph, but with no specified direction of its edges.

Section 10.2

6 Graph Terminology Definition: Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if {u, v} is an edge in G. The vertices u and v are called endpoints of the edge {u, v}.

7 Graph Terminology Definition: 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).

8 Graph Terminology Example: What are the degrees and what are the neighborhoods of the vertices in the graphs G and H displayed in Figure 1? a bc dfh g j f e

CMSC Discrete Structures9 Graph Terminology The Handshaking Theorem: Let G = (V, E) be an undirected graph with e edges. Then 2e =  v  V deg(v) Example: How many edges are there in a graph with 10 vertices, each of degree 6? Solution: The sum of the degrees of the vertices is 6  10 = 60. According to the Handshaking Theorem, it follows that 2e = 60, so there are 30 edges.

10 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.

11 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.

12 Graph Terminology Example: What are the in-degrees and out-degrees of the vertices a, b, c, d in this graph:ab cd deg - (a) = 1 deg + (a) = 2 deg - (b) = 4 deg + (b) = 2 deg - (d) = 2 deg + (d) = 1 deg - (c) = 0 deg + (c) = 2

CMSC Discrete Structures13 Special Graphs Definition: The complete graph on n vertices, denoted by K n, is the simple graph that contains exactly one edge between each pair of distinct vertices. K1K1K1K1 K2K2K2K2 K3K3K3K3 K4K4K4K4 K5K5K5K5

14 Special Graphs Definition: The cycle 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 }. C3C3C3C3 C4C4C4C4 C5C5C5C5 C6C6C6C6

CMSC Discrete Structures15 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: K5K5K5K5 subgraph of K 5

CMSC Discrete Structures16 Representing Graphsab c dab c d a, d b c a, b, c d b, c, d a Adjacent Vertices Vertexab c a, b, c d ca Terminal Vertices Initial Vertex

17 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 v 1, v 2, …, v n. The adjacency matrix A (or A G ) 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 v i and v j are adjacent, and 0 otherwise. In other words, for an adjacency matrix A = [a ij ], a ij = 1 if {v i, v j } is an edge of G, a ij = 0otherwise.

18 Representing Graphsab c d Example: What is the adjacency matrix A G for the following graph G based on the order of vertices a, b, c, d ? Solution: Note: Adjacency matrices of undirected graphs are always symmetric.

19 Connectivity Definition: A path of length n from u to v, where n is a positive integer, in an undirected graph is a sequence of edges e 1, e 2, …, e n of the graph such that e 1 = {x 0, x 1 }, e 2 = {x 1, x 2 }, …, e n = {x n-1, x n }, where x 0 = u and x n = v. When the graph is simple, we denote this path by its vertex sequence x 0, x 1, …, x n, since it uniquely determines the path. The path is a circuit if it begins and ends at the same vertex, that is, if u = v.

20 Connectivity Definition (continued): The path or circuit is said to pass through or traverse x 1, x 2, …, x n-1. A path or circuit is simple if it does not contain the same edge more than once.

21 Connectivity Let us now look at something new: Definition: An undirected graph is called connected if there is a path between every pair of distinct vertices in the graph. For example, any two computers in a network can communicate if and only if the graph of this network is connected. Note: A graph consisting of only one vertex is always connected, because it does not contain any pair of distinct vertices.

22 Connectivity Example: Are the following graphs connected? dab c e Yes. dabc e No. dab c e Yes. dabc e f No.

23 Connectivity Example: What are the connected components in the following graph? a bc dfh g j f e Solution: The connected components are the graphs with vertices {a, b, c, d}, {e}, {f}, {f, g, h, j}.

24 Connectivity Definition: An directed graph is strongly connected if there is a path from a to b and from b to a whenever a and b are vertices in the graph. Definition: An directed graph is weakly connected if there is a path between any two vertices in the underlying undirected graph.

25 Connectivity Example: Are the following directed graphs strongly or weakly connected?ab c d Weakly connected, because, for example, there is no path from b to d. ab c d Strongly connected, because there are paths between all possible pairs of vertices.

26 The End