Graphs - 11                                                          CSC1001 Discrete Mathematics            1

 CHAPTER
                                                          กราฟ
   11                                                    (Graphs)

  1       Introduction to Graphs and Graph Models
1. Deffinition of Graphs
  Definition 1

 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 with it, called its endpoints. An edge is said to connect its
 endpoints.

Types of Graphs
1) A graph in which each edge connects two different vertices and where no two edges connect the same
   pair of vertices is called a simple graph.




2) A graphs that may have multiple edges connecting the same vertices are called multigraphs.




3) A graphs that may include loops, and possibly multiple edges connecting the same pair of vertices or a
   vertex to itself, are sometimes called pseudographs.




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                            เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
2       CSC1001 Discrete Mathematics                                                                  11 - Graphs


4) From types of graphs in type 1-3 are undirected graphs. However, to construct a graph model, we may
   find it necessary to assign directions to the edges of a graph. This is called a directed graph (or digraph).
   We directed graph
       A directed graph which has no loops and has no multiple directed edges is called a simple directed
       graph.
       A directed graph that may have multiple directed edges from a vertex to a second (possibly the same)
       vertex is called directed multigraphs.




5) A graph with both directed and undirected edges is called a mixed graph.




Example 1 (6 points) Identify the properties of graph terminology in the blank from the table.
                                                                           Multiple Edges          Loops
 No.                 Type                              Edges
                                                                              Allowed?            Allowed?
  1. Simple graph
  2. Multigraph
  3. Pseudograph
  4. Simple directed graph
  5. Directed multigraph
  6. Mixed graph

2. Graph Models
   Graphs are used in a wide variety of models. Can you find a subject to which graph theory has been or
has not been applied?
1) Social Networks Graphs are extensively used to model social structures based on different kinds of
   relationships between people or groups of people. In these graph models, individuals or organizations are
   represented by vertices; relationships between individuals or organizations are represented by edges.

มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                                เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Graphs - 11                                                          CSC1001 Discrete Mathematics            3
       Acquaintanceship and Friendship Graphs




       Influence Graphs




2) Communication Network We can model different communications networks using vertices to represent
   devices and edges to represent the particular type of communications links of interest.
       Call Graphs




3) Information Network Graphs can be used to model various networks that link particular types of infor-
   mation. We can describe how to model the WorldWideWeb using a graph and we can also describe how
   to use a graph to model the citations in different types of documents.
       Web Graph WorldWideWeb can be modeled as a directed graph where each Web page is represented
       by a vertex and where an edge starts at the Web page a and ends at the Web page b if there is a link
       on a pointing to b.
       Citation Graphs Graphs can be used to represent citations in different types of documents, including
       academic papers, patents, and legal opinions. In such graphs, each document is represented by a

มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                            เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
4       CSC1001 Discrete Mathematics                                                             11 - Graphs


       vertex, and there is an edge from one document to a second document if the first document cites the
       second in its citation list.
4) Software Design Applications Graph models are useful tools in the design of software.
      Module Dependency Graphs




       Precedence Graphs




5) Transportation Network We can use graphs to model many different types of transportation networks,
   including road, air, and rail networks, as well shipping networks
6) Biological Networks Many aspects of the biological sciences can be modeled using graphs.
       Niche Overlap Graphs in Ecology




       Protein Interaction Graphs

มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                           เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Graphs - 11                                                          CSC1001 Discrete Mathematics            5




7) Tournaments We now give some examples that show how graphs can also be used to model different
   kinds of tournaments.
       Round-Robin Tournaments




       Single-EliminationTournaments




Example 2 (12 points) Determine whether the graph shown has directed or undirected edges, whether it has
multiple edges, and whether it has one or more loops. Use your answers from the type of graph in Example 1.
1) Graph No.1                                             2) Graph No.2




มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                            เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
6         CSC1001 Discrete Mathematics                                                                    11 - Graphs


3) Graph No.3                                                  5) Graph No.5




                                                               6) Graph No.6
4) Graph No.4




     2      Graph Terminology and Special Types of Graphs
1. Deffinition of Graphs
    Definition 1
    Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if u and v are
    endpoints of an edge e of G. Such an edge e is called incident with the vertices u and v and e is said to
    connect u and v.

    Definition 2
    The set of all neighbors of a vertex v of G = (V,E), denoted by N(v), is called the neighbourhood of v. If A is
    a subset of V, we denote by N(A) the set of all vertices in G that are adjacent to at least one vertex in A.
    So, N(A) = Uv∈A N(v) .

    Definition 3
    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).

    Definition 4

    THE HANDSHAKING THEOREM Let G = (V ,E) be an undirected graph with m edges. Then
    3m = ∑ deg( v) .
          v∈V

    (Note that this applies even if multiple edges and loops are present.)


มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                                    เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
Graphs - 11                                                                 CSC1001 Discrete Mathematics               7
Example 3 (5 points) What are the degrees and what are the neighborhoods of the vertices in the graphs G
and H displayed in Figure?




Example 4 (2 points) How many edges are there in a graph with 10 vertices each of degree six?




Example 5 (2 points) How many edges are there in a graph with 12 vertices each of degree four?




  Definition 5
 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.

  Definition 6
 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. (Note that a loop at a vertex contributes 1 to both the in-degree and the out-degree of this
 vertex.)

มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555)                                    เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี

Discrete-Chapter 11 Graphs Part I

  • 1.
    Graphs - 11 CSC1001 Discrete Mathematics 1 CHAPTER กราฟ 11 (Graphs) 1 Introduction to Graphs and Graph Models 1. Deffinition of Graphs Definition 1 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 with it, called its endpoints. An edge is said to connect its endpoints. Types of Graphs 1) A graph in which each edge connects two different vertices and where no two edges connect the same pair of vertices is called a simple graph. 2) A graphs that may have multiple edges connecting the same vertices are called multigraphs. 3) A graphs that may include loops, and possibly multiple edges connecting the same pair of vertices or a vertex to itself, are sometimes called pseudographs. มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 2.
    2 CSC1001 Discrete Mathematics 11 - Graphs 4) From types of graphs in type 1-3 are undirected graphs. However, to construct a graph model, we may find it necessary to assign directions to the edges of a graph. This is called a directed graph (or digraph). We directed graph A directed graph which has no loops and has no multiple directed edges is called a simple directed graph. A directed graph that may have multiple directed edges from a vertex to a second (possibly the same) vertex is called directed multigraphs. 5) A graph with both directed and undirected edges is called a mixed graph. Example 1 (6 points) Identify the properties of graph terminology in the blank from the table. Multiple Edges Loops No. Type Edges Allowed? Allowed? 1. Simple graph 2. Multigraph 3. Pseudograph 4. Simple directed graph 5. Directed multigraph 6. Mixed graph 2. Graph Models Graphs are used in a wide variety of models. Can you find a subject to which graph theory has been or has not been applied? 1) Social Networks Graphs are extensively used to model social structures based on different kinds of relationships between people or groups of people. In these graph models, individuals or organizations are represented by vertices; relationships between individuals or organizations are represented by edges. มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 3.
    Graphs - 11 CSC1001 Discrete Mathematics 3 Acquaintanceship and Friendship Graphs Influence Graphs 2) Communication Network We can model different communications networks using vertices to represent devices and edges to represent the particular type of communications links of interest. Call Graphs 3) Information Network Graphs can be used to model various networks that link particular types of infor- mation. We can describe how to model the WorldWideWeb using a graph and we can also describe how to use a graph to model the citations in different types of documents. Web Graph WorldWideWeb can be modeled as a directed graph where each Web page is represented by a vertex and where an edge starts at the Web page a and ends at the Web page b if there is a link on a pointing to b. Citation Graphs Graphs can be used to represent citations in different types of documents, including academic papers, patents, and legal opinions. In such graphs, each document is represented by a มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 4.
    4 CSC1001 Discrete Mathematics 11 - Graphs vertex, and there is an edge from one document to a second document if the first document cites the second in its citation list. 4) Software Design Applications Graph models are useful tools in the design of software. Module Dependency Graphs Precedence Graphs 5) Transportation Network We can use graphs to model many different types of transportation networks, including road, air, and rail networks, as well shipping networks 6) Biological Networks Many aspects of the biological sciences can be modeled using graphs. Niche Overlap Graphs in Ecology Protein Interaction Graphs มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 5.
    Graphs - 11 CSC1001 Discrete Mathematics 5 7) Tournaments We now give some examples that show how graphs can also be used to model different kinds of tournaments. Round-Robin Tournaments Single-EliminationTournaments Example 2 (12 points) Determine whether the graph shown has directed or undirected edges, whether it has multiple edges, and whether it has one or more loops. Use your answers from the type of graph in Example 1. 1) Graph No.1 2) Graph No.2 มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 6.
    6 CSC1001 Discrete Mathematics 11 - Graphs 3) Graph No.3 5) Graph No.5 6) Graph No.6 4) Graph No.4 2 Graph Terminology and Special Types of Graphs 1. Deffinition of Graphs Definition 1 Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if u and v are endpoints of an edge e of G. Such an edge e is called incident with the vertices u and v and e is said to connect u and v. Definition 2 The set of all neighbors of a vertex v of G = (V,E), denoted by N(v), is called the neighbourhood of v. If A is a subset of V, we denote by N(A) the set of all vertices in G that are adjacent to at least one vertex in A. So, N(A) = Uv∈A N(v) . Definition 3 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). Definition 4 THE HANDSHAKING THEOREM Let G = (V ,E) be an undirected graph with m edges. Then 3m = ∑ deg( v) . v∈V (Note that this applies even if multiple edges and loops are present.) มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี
  • 7.
    Graphs - 11 CSC1001 Discrete Mathematics 7 Example 3 (5 points) What are the degrees and what are the neighborhoods of the vertices in the graphs G and H displayed in Figure? Example 4 (2 points) How many edges are there in a graph with 10 vertices each of degree six? Example 5 (2 points) How many edges are there in a graph with 12 vertices each of degree four? Definition 5 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. Definition 6 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. (Note that a loop at a vertex contributes 1 to both the in-degree and the out-degree of this vertex.) มหาวิทยาลัยราชภัฏสวนส ุนันทา (ภาคการศึกษาที่ 2/2555) เรียบเรียงโดย อ.วงศ์ยศ เกิดศรี