You are on page 1of 23

Basic definitions in graph theory

Connected graph – Tree


Complete graph – Bipartite graph
Practice

Introduction to graph theory

Tran Nguyen Nam Hung

Ho Chi Minh City University of Science

May 10th, 2022

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Table of contents

1 Basic definitions in graph theory

2 Connected graph – Tree

3 Complete graph – Bipartite graph

4 Practice

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Definition 1
A graph is a collection of vertices, or nodes, and edges
between some or all of the vertices. The graph is usually
denoted by G = (V , E ), where V is the set of its vertices and
E is the set of its edges. Two vertices v , w are called
adjacent if there is an edge between v and w .

Definition 2
The degree of a vertex v is the number of edges connecting it
to the other vertices.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Theorem 1 (Handshaking lemma)


Given a graph G = (V , E ) consisting of n vertices and m
edges. Let d1 , d2 , . . . , dn be the degrees of its n vertices. Then,
we have
d1 + d2 + · · · + dn = 2m.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Definition 3
A path is a sequence of distinct vertices such that any two
consecutive vertices are adjacent.

Definition 4
A cycle is a sequence of distinct vertices V1 , V2 , . . . , Vn
(n ≥ 3) such that

(V1 , V2 ), (V2 , V3 ), . . . , (Vn−1 , Vn ), (Vn , V1 )

are adjacent.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Theorem 2
Given a positive integer n ≥ 3 and a graph G = (V , E ) such
that |V | = n and |E | ≥ n. Then, G consists at least one cycle.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Exercise
Consider the graph below.

1 What is the degree of vertex A ?


2 How many edges in total does the graph consist of ?
3 Find a path from A to C .
4 Find a cycle in this graph.
Tran Nguyen Nam Hung Introduction to graph theory
Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Connected graph
Definition 5
A graph is called connected if for any two vertices, there
exists a path from a vertex to the other one.

For example, the graph on the left above is connected, while


the graph on the right above is not connected.
Tran Nguyen Nam Hung Introduction to graph theory
Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Components
Definition 6
For any graph G = (V , E ), V can be partitioned uniquely into
disjoint subsets such that two vertices in V are in the same
subset if and only if there exists a path between them. Each
subset in the partition, together with the edges between
vertices in that set, forms a connected subgraph a of G . This
subgraph is called the component of G .
a
G ′ = (V ′ , E ′ ) is a subgraph of G if V ′ ⊂ V and E ′ ⊂ E

For example, in the example above, the graph on the left


contains one component (as it is connected), the graph on the
right consists of two components.
Tran Nguyen Nam Hung Introduction to graph theory
Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Theorem 3
Given a connected graph consisting of n vertices, where n ≥ 2
is a positive integer. Then, this graph has at least n − 1 edges.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Tree
Definition 7
A connected graph is no cycle is called a tree.

Theorem 4
Given a tree with n vertices. Then, this graph contains exactly
n − 1 edges.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Complete graph
Definition 8
A graph is called complete if any two vertices in that graph
are adjacent. For any positive integer n, Kn denotes the
complete graph with n vertices.
In the figure below are the graphs K5 and K6 .

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Definition 9
A graph is called bipartite if their vertices can be partitioned
into two disjoint subsets, called A, B, such that any two
vertices in the same set are not adjacent. If for any pair of
vertices (a, b) with a ∈ A, b ∈ B are adjacent, this graph is
called complete bipartite. Similarly as above, for any two
positive integers m, n, Km,n denotes the complete bipartite
graph with |A| = m, |B| = n.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Examples

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Exercise

Find a graph that is


1 Bipartite but not connected.

2 Connected but not bipartite.

3 Neither bipartite nor connected.

4 Both bipartite and connected.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Theorem 5
A graph is bipartite if and only if it doesn’t contain any cycle
with an odd number of vertices.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 1
Consider a graph with 9 cells of a 3 × 3 chessboard as vertices.
In this graph, two cells are adjacent if the knight can move
from a cell to the other one in exactly one step.
1 Is this graph bipartite ?

2 Is this graph connected ?

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 2
Given a graph with n ≥ 3 vertices labelled 1, 2, . . . , n. Two
vertices i, j are adjacent if and only if |i − j| ≤ 2.
1 Is this graph bipartite ?

2 Prove that this graph contains exactly one Hamiltonian


cycle a .
a
a Hamiltonian cycle is a cycle that visits each vertex exactly once

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 3
Given a connected graph G = (V , E ). An edge e ∈ E is called
bridge if the graph formed by removing e from G isn’t
connected. Prove that an edge is a bridge if and only if it is
not the edge of any cycle.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 4
A bipartite graph is called maximal if it is impossible to add
any edge into this graph such that the new graph we obtain
(with one more edge) is still bipartite. Prove that a bipartite
graph is maximal if and only if it is a complete bipartite graph.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 5
A graph is called uniquely bipartite if there is exactly one
way to divide its vertices into two subsets such that any two
vertices in the same subset are not adjacent. Prove that a
graph is uniquely bipartite if and only if it is bipartite and
connected.

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 6
Doctor Dung draws the graph Kn on the board. Every minute,
if the graph still contains some edges, Doctor Dung will tell
Hung to divide the graph into two parts, called A, B and erase
all the remaining edges that connect a vertex in A with a
vertex in B (Hung must erase at least one edge in each turn).
After at most how many minutes will all the edges be erased
by Hung ?

Tran Nguyen Nam Hung Introduction to graph theory


Basic definitions in graph theory
Connected graph – Tree
Complete graph – Bipartite graph
Practice

Problem 7 (VN TST 2019)


In a country there are n ≥ 2 cities. Any two cities has exactly
one two–way airway. The government wants to license several
airlines to take charge of these airways with such following
conditions:
1 Every airway can be licensed to exactly one airline.

2 By choosing one arbitrary airline, we can move from a


city to any other cities, using only flights from this airline.
What is the maximum number of airlines that the government
can license to satisfy all of these conditions?

Tran Nguyen Nam Hung Introduction to graph theory

You might also like