1 Notations EN

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Posts and Telecommunications Institute of Technology

Faculty of Information Technology 1

Discrete Mathematics 2

Basic Concepts in Graph Theory

Dao Thi Thuy Quynh


Contents
⦁ Graph Definitions
⦁ Basic Terms in Undirected Graphs
⦁ Basic Terms in Directed Graphs
⦁ Some Special Types of Graphs

2 http://www.ptit.edu.vn
Undirected Simple Graph
⦁ Definition 1: Undirected simple graph 𝐺 = < 𝑉, 𝐸 >:
o 𝑉 is the set of vertices
o 𝐸 is the set of edges, consisting of unordered pairs of two distinct
vertices in 𝑉
o There is at most one edge connecting two vertices

3 http://www.ptit.edu.vn
Undirected Multigraph
⦁ Definition 2: Undirected multigraph 𝐺 = < 𝑉, 𝐸 >:
o 𝑉 is the set of vertices
o 𝐸 is the set of edges, consisting of unordered pairs of two distinct
vertices in 𝑉
o 𝑒1 ∈ 𝐸, 𝑒2 ∈ 𝐸 are called multiple edges if they connect the same
two vertices, 𝑒1 = 𝑢, 𝑣 , 𝑒2 = 𝑢, 𝑣

4 http://www.ptit.edu.vn
Undirected Pseudograph
⦁ Definition 3: Undirected pseudograph 𝐺 = < 𝑉, 𝐸 >
o 𝑉 is the set of vertices
o 𝐸 is the set of edges, consisting of unordered pairs of two (maybe
the same) vertices in 𝑉

5 http://www.ptit.edu.vn
Directed Simple Graph
⦁ Definition 4: Directed simple graph 𝐺 = < 𝑉, 𝐸 >:
o 𝑉 is the set of vertices
o 𝐸 is the set of edges (arrows), consisting of ordered pairs of two
distinct vertices in 𝑉
o There is at most one edge (arrow) from a vertex to another one

6 http://www.ptit.edu.vn
Directed Multigraph
⦁ Definition 5: Directed multigraph 𝐺 = < 𝑉, 𝐸 >:
o 𝑉 is the set of vertices
o 𝐸 is the set of edges (arrows), consisting of ordered pairs of two
distinct vertices in 𝑉
o 𝑒1 ∈ 𝐸, 𝑒2 ∈ 𝐸 are called multiple arrows if they connect the same
two vertices, 𝑒1 = 𝑢, 𝑣 , 𝑒2 = 𝑢, 𝑣

7 http://www.ptit.edu.vn
Convention
⦁ We will focus on Undirected Simple Graph and Directed
Simple Graph
⦁ “Undirected Graph” means “Undirected Simple Graph”
⦁ “Directed Graph” means “Directed Simple Graph”

8 http://www.ptit.edu.vn
Contents
⦁ Graph Definitions
⦁ Basic Terms in Undirected Graphs
⦁ Basic Terms in Directed Graphs
⦁ Some Special Types of Graphs

9 http://www.ptit.edu.vn
Vertex Degree
⦁ Definition 1: Two vertices 𝑢 and 𝑣 of undirected graph
𝐺 =< 𝑉, 𝐸 > are said to be adjacent if there is an edge
connecting them. If 𝑒 = (𝑢, 𝑣) is an edge of undirected
graph 𝐺, e is said to be incident to 𝑢 and 𝑣; two vertices
𝑢 and 𝑣 are said to be the endpoints of edge 𝑒.

⦁ Definition 2: The degree of a vertex 𝑣 of an undirected


graph, denoted by deg(𝑣) , is the number of edges
incident to the vertex.

10 http://www.ptit.edu.vn
Example
⦁ deg(𝑎) = 2, deg(𝑏) = deg(𝑐) = deg(𝑓) = 4;
⦁ deg(𝑒) = 3, deg(𝑑) = 1, deg(𝑔) = 0.

⦁ An isolated vertex is a vertex with degree zero (e.g. 𝑔)


⦁ A leaf vertex (also terminal vertex) is a vertex with
degree one (e.g. 𝑑)

11 http://www.ptit.edu.vn
S u m of Degrees of Vertices Theorem
⦁ Theorem 1: Suppose an undirected graph 𝐺 =< 𝑉, 𝐸 >
has m edges, then we have: σ 𝑣∈𝑉 deg 𝑣 = 2𝑚.
⦁ Proof: for each edge 𝑒 = (𝑢, 𝑣), degree is counted one
time in deg(𝑢) and one time in deg(𝑣). Therefore, sum of
the degrees of the vertices equals twice the number of
edges.

⦁ Corollary 1: For any undirected graph, the number of


vertices with odd degree is even.

12 http://www.ptit.edu.vn
Path, Circuit
⦁ Definition 1: Path with length 𝑛 from vertex 𝑢 to vertex 𝑣 in
undirected graph 𝐺 =< 𝑉, 𝐸 > is sequence 𝑥0, 𝑥1, . . . , 𝑥𝑛−1, 𝑥 𝑛,
in which 𝑛 is a positive integer, 𝑥0 = 𝑢, 𝑥𝑛 = 𝑣, (𝑥𝑖, 𝑥𝑖+1) ∈ 𝐸,
𝑖 = 0, 1, 2, . . . , 𝑛 − 1.
⦁ The above path can be represented as a sequence of edges
(𝑥0 , 𝑥1 )(𝑥1 , 𝑥2 ) , . . . , (𝑥𝑛 −1 , 𝑥𝑛 ).
⦁ 𝑢 is the starting point and 𝑣 is the ending point of the path

⦁ A circuit is a path ending at the starting point (𝑢 = 𝑣)


⦁ A path or a circuit is said to be simple if there is no repetition
of edges
⦁ A cycle is a simple circuit with no repeated vertices other than
the first and last ones

13 http://www.ptit.edu.vn
Example
⦁ 𝑎, 𝑑, 𝑐, 𝑓, 𝑒 is a simple path with length 4
⦁ 𝑑, 𝑒, 𝑐, 𝑏 is not a path because (𝑒, 𝑐) is not an edge
⦁ 𝑏, 𝑐, 𝑓, 𝑒, 𝑏 is a circuit with length 4
⦁ Path with length 5 𝑎, 𝑏, 𝑒, 𝑑, 𝑎, 𝑏 is not simple because
(𝑎, 𝑏) appears twice

14 http://www.ptit.edu.vn
Connected Graph
⦁ Definition 2: An undirected graph is said to be
connected if there is a path between every pair of
vertices

⦁ If 𝐺 =< 𝑉, 𝐸 > is not connected, 𝐺 consists of several


connected subgraphs (two subgraphs do not share any
vertex)
o Each such subgraph is called a connected component of 𝐺
o An undirected graph is connected if and only if it has only one
connected component

⦁ In an undirected graph, if there exist a vertex 𝑢 ∈ 𝑉 such


that there is a path from 𝑢 to all the other vertices of 𝑉,
the graph is connected
15 http://www.ptit.edu.vn
Example
⦁ Undirected graph 𝐺 consists of 3 connected components

16 http://www.ptit.edu.vn
Bridge, C u t Vertex
⦁ Definition 3: In an undirected graph, a bridge is an
edge of the graph whose deletion increases its number of
connected components. A cut vertex is a vertex whose
deletion (with its boundary edges) increases its number
of connected components.
⦁ Examples: (5,9) and (5,10),… are bridges; 5,6,… are
cut vertices

17 http://www.ptit.edu.vn
Contents
⦁ Graph Definitions
⦁ Basic Terms in Undirected Graphs
⦁ Basic Terms in Directed Graphs
⦁ Some Special Types of Graphs

18 http://www.ptit.edu.vn
Indegree and Outdegree
⦁ Definition 1: If 𝑒 = (𝑢, 𝑣) is an arrow of directed graph
𝐺, then 𝑢 and 𝑣 is said to be adjacent. Vertex 𝑣 is called
the head end and vertex 𝑢 is called the tail end of arrow
(𝑢, 𝑣).

⦁ Definition 2: In a directed graph, the number of arrows


ending at a vertex is called the indegree of the vertex
(denoted by 𝑑𝑒𝑔−(𝑣)) and the number of arrows starting
at a vertex is its outdegree (denoted by 𝑑𝑒𝑔+(𝑣)).

19 http://www.ptit.edu.vn
Example
⦁ 𝑑𝑒𝑔+ 𝑎 = 2, 𝑑𝑒𝑔+ 𝑏 = 2, 𝑑𝑒𝑔+ 𝑐 = 0,
𝑑𝑒𝑔+(𝑑) = 2, 𝑑𝑒𝑔+(𝑒) = 1.
⦁ 𝑑𝑒𝑔− 𝑎 = 1, 𝑑𝑒𝑔− 𝑏 = 1, 𝑑𝑒𝑔− 𝑐 = 2,
𝑑𝑒𝑔−(𝑑) = 2, 𝑑𝑒𝑔−(𝑒) = 1.

20 http://www.ptit.edu.vn
S u m of Indegrees/Outdegrees
of Vertices Theorem
⦁ Theorem 1: For any directed graph 𝐺 =< 𝑉, 𝐸 >, we
have: σ 𝑣∈𝑉 𝑑𝑒𝑔+(𝑣) = σ 𝑣∈𝑉 𝑑𝑒𝑔−(𝑣) = |𝐸|.
⦁ Proof: Each arrow (𝑢, 𝑣) is counted one time in 𝑑𝑒𝑔− 𝑣
and one time in 𝑑𝑒𝑔+ 𝑣 .

⦁ Notes:
o Many properties of directed graphs do not depend on directions.
In some cases, we can ignore the directions on arrows.
o The undirected graph receiving by removing directions on arrows
is called the corresponding undirected graph.

21 http://www.ptit.edu.vn
Path, Circuit
⦁ Definition 1: Path with length 𝑛 from vertex 𝑢 to vertex
𝑣 in directed graph 𝐺 =< 𝑉, 𝐸 > is sequence
𝑥0 , 𝑥1 , . . . , 𝑥𝑛 −1 , 𝑥𝑛 , in which 𝑛 is a positive integer, 𝑥0 =
𝑢, 𝑥𝑛 = 𝑣, (𝑥𝑖 , 𝑥𝑖 +1 ) ∈ 𝐸, 𝑖 = 0, 1, 2, . . . , 𝑛 − 1.
⦁ The above path can be represented as a sequence of
arrows (𝑥0 , 𝑥1 )(𝑥1 , 𝑥2 ) , . . . , (𝑥𝑛 −1 , 𝑥𝑛 )
⦁ 𝑢 is the starting point and 𝑣 is the ending point of the
path

⦁ A circuit is a path ending at the starting point (𝑢 = 𝑣)


⦁ A path or a cycle is said to be simple if there is no
repetition of arrows

22 http://www.ptit.edu.vn
Strongly Connected Graph,
Weakly Connected Graph
Definition 2: Directed graph 𝐺 =< 𝑉, 𝐸 > is said to be
strongly connected if there is a path between every pair of
vertices.
Definition 3: Directed graph 𝐺 =< 𝑉, 𝐸 > is said to be
weakly connected if its corresponding undirected graph is
connected.

23 http://www.ptit.edu.vn
Orientation
⦁ Definition 4: An orientation of an undirected graph is
an assignment of a direction to each edge, turning the
initial graph into a directed graph. A strong orientation is
an orientation that results in a strongly connected graph.

⦁ Theorem 1: For any undirected graph 𝐺 =< 𝑉, 𝐸 >,


there exists a strong orientation on 𝐺 if and only if all its
edges are not bridge.

24 http://www.ptit.edu.vn
Contents
⦁ Graph Definitions
⦁ Basic Terms in Undirected Graphs
⦁ Basic Terms in Directed Graphs
⦁ Some Special Types of Graphs

25 http://www.ptit.edu.vn
Complete Graph
⦁ Complete graph 𝑛 vertices, denoted by 𝐾𝑛, is a simple
undirected graph that exists an edge connecting between
two every vertices
𝑛 (𝑛 −1
⦁ Number of edges: ) 2

26 http://www.ptit.edu.vn
Cycle Graph
⦁ Cycle graph 𝑛 vertices, denoted by 𝐶𝑛 (𝑛 ≥ 3) is a
simple undirected graph consisting of edges
(1,2), (2,3), … , (𝑛 − 1, 𝑛), (𝑛, 1)

27 http://www.ptit.edu.vn
Wheel Graph
⦁ Wheel graph 𝑛 vertices, denoted by 𝑊𝑛is a graph
formed by connecting a single vertex to all vertices of a
cycle graph 𝐶𝑛−1.

28 http://www.ptit.edu.vn
Bipartite Graph (Bigraph)
⦁ Bigraph 𝐺 =< 𝑉, 𝐸 > is a graph whose vertices can be
divided into two disjoint sets 𝑋 and 𝑌 and such that
every edge connects a vertex in to one in, i.e. (𝑥, 𝑦), in
which 𝑥 ∈ 𝑋 and 𝑦 ∈ 𝑌.

29 http://www.ptit.edu.vn
Exercise 1
⦁ Determine the degree of each vertex in the below
undirected graph
2 5

1 7
4

3 6

30 http://www.ptit.edu.vn
Exercise 2
⦁ Determine the indegree and outdegree of each vertex in
the below directed graph

2 5

1 7
4

3 6

31 http://www.ptit.edu.vn

You might also like