0% found this document useful (0 votes)
14 views53 pages

Ds 9 Graph Intro

Uploaded by

Thanh Hùynh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views53 pages

Ds 9 Graph Intro

Uploaded by

Thanh Hùynh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai

Chapter 9
Xuan Toan, Tran Hong
Tai

Introduction to Graphs
Discrete Structures for Computing on June 16, 2024
Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

Nguyen An Khuong, Tran Tuan Anh, Mai Xuan Toan, Tran Hong
Tai
Faculty of Computer Science and Engineering
University of Technology - VNUHCM
[email protected]
9.1
Contents Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

1 Graph definitions
Terminology
Special Graphs
Bipartie graph Contents
Graph definitions

Representing Graphs and Graph Isomorphism


Terminology

2 Special Graphs

Bipartie graph

Representing Graphs Representing Graphs


Graph Isomorphism and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

3 Exercise Exercise
Graph

Graph Isomorphism

Isomorphism

9.2
Course outcomes Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Course learning outcomes


L.O.1 Understanding of logic and discrete structures
L.O.1.1  Describe definition of propositional and predicate logic
L.O.1.2  Define basic discrete structures: set, mapping, graphs
Contents
L.O.2 Represent and model practical problems with discrete structures
L.O.2.1  Logically describe some problems arising in Computing Graph definitions
L.O.2.2  Use proving methods: direct, contrapositive, induction
Terminology

Special Graphs

L.O.2.3  Explain problem modeling using discrete structures Bipartie graph

Representing Graphs
L.O.3 Understanding of basic probability and random variables and Graph
Isomorphism
L.O.3.1  Define basic probability theory Representing Graphs

L.O.3.2  Explain discrete random variables Graph Isomorphism

Exercise
L.O.4 Compute quantities of discrete structures and probabilities Graph

L.O.4.1  Operate (compute/ optimize) on discrete structures


Isomorphism

L.O.4.2  Compute probabilities of various events, conditional


ones, Bayes theorem

9.3
Motivations Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

The need of the graph Its applications


• Representation/Storing • Electric circuit/board
• Searching/sorting • Chemical structure Contents
Graph definitions
• Optimization • Networking Terminology

Special Graphs

• Map, geometry, . . . Bipartie graph

Representing Graphs
and Graph
Isomorphism
• Graph theory is useful for analysing "things that are Representing Graphs

Graph Isomorphism

connected to other things". Exercise


Graph

• Some difficult problems become easy when represented using Isomorphism

a graph.

9.4
Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
A graph (ç thà ) G is a pair of (V, E ), which are:
• V  nonempty set of vertices (nodes) (¿nh)
Contents
• E  set of edges (c¤nh) Graph definitions
Terminology

A graph captures abstract relationships between vertices. Special Graphs

Bipartie graph

Representing Graphs
2 4 2 4 and Graph
Isomorphism
Representing Graphs

1 3
Graph Isomorphism

1 3 Exercise
Graph

Undirected graph Directed graph Isomorphism

9.5
Undirected Graph (ç thà væ h÷îng) Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition (Simple graph (ìn ç thà))


• Each edge connects two different vertices, and
Contents
• No two edges connect the same pair of vertices Graph definitions
An edge between two vertices u and v is denoted as {u, v} Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.6
Undirected Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition (Multigraph (a ç thà))


Graphs that may have multiple edges connecting the same vertices.

An unordered pair of vertices {u, v} are called multiplicity m (bëi Contents


Graph definitions
m) if it has m different edges between. Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.7
Undirected Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition (Pseudograph (gi£ ç thà))


Are multigraphs that have
• loops (khuy¶n) edges that connect a vertex to itself
Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.8
Terminologies For Undirected Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Neighborhood
In an undirected graph G = (V, E),
• two vertices u and v ∈ V are called adjacent (li·n k· ) if they
are end-points (iºm ¦u mót ) of edge e ∈ E , and
• e is incident with (c¤nh li¶n thuëc ) u and v
Contents
Graph definitions
• e is said to connect (c¤nh nèi ) u and v; Terminology

Special Graphs

Bipartie graph

Representing Graphs
The degree of a vertex and Graph
Isomorphism
The degree of a vertex (bªc cõa mët ¿nh), denoted by deg(v) is Representing Graphs

Graph Isomorphism

the number of edges incident with it, except that a loop Exercise
contributes twice to the degree of that vertex. Graph

Isomorphism

• isolated vertex (¿nh cæ lªp ): vertex of degree 0


• pendant vertex (¿nh treo ): vertex of degree 1

9.9
Example Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai

Example Xuan Toan, Tran Hong


Tai

What are the degrees and neighborhoods of the vertices in these


graphs?
b c d a b c

Contents
Graph definitions
Terminology

a f e g e d Special Graphs

Bipartie graph

G H Representing Graphs
and Graph
Isomorphism
Representing Graphs

Solution Graph Isomorphism

Exercise
In G, deg(a) = 2, deg(b) = deg(c) = deg(f ) = 4, deg(d) = 1, . . . Graph

Neiborhoods of these vertices are Isomorphism

N (a) = {b, f }, N (b) = {a, c, e, f }, . . .


In H , deg(a) = 4, deg(b) = deg(e) = 6, deg(c) = 1, . . .
Neiborhoods of these vertices are
N (a) = {b, d, e}, N (b) = {a, b, c, d, e}, . . .
9.10
Basic Theorems Introduction to Graphs

Nguyen An Khuong,

Theorem (The Handshaking Theorem)


Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Let G = (V, E) be an undirected graph with m edges. Then


X
2m = deg(v)
v∈V

(Note that this applies even if multiple edges and loops are Contents
Graph definitions
present.) Terminology

Special Graphs

Example
Bipartie graph

Representing Graphs
and Graph
What are the degrees and neighborhoods of the vertices in these Isomorphism
graphs?
Representing Graphs

Graph Isomorphism

b c d a b c Exercise
Graph

Isomorphism

a f e g e d
G H
9.11
Prove that ... Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Theorem
An undirected graph has an even number of odd-degree vertices.

...
Contents
If the number of vertices in an undirected graph is an odd number,
Graph definitions
then there exists an even-degree vertex. Terminology

Special Graphs

Bipartie graph

... Representing Graphs


and Graph
If the number of vertices in an undirected graph is an odd number, Isomorphism
then the number of vertices with even degree is odd. Representing Graphs

Graph Isomorphism

Exercise
... Graph

Isomorphism

If the number of vertices in an undirected graph is an even


number, then the number of vertices with even degree is even.

9.12
Exercise Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong

Exercise (1) Tai

Is there any undirected simple graph including four vertices that


their degrees are respectively 1, 1, 2, 2 ?

Exercise (2)
Contents
Is there any undirected simple graph including six vertices that Graph definitions
their degree are respectively 2, 3, 3, 3, 3, 3 ? Terminology

Special Graphs

Bipartie graph

Exercise (3) Representing Graphs


and Graph
Isomorphism
An undirected simple graph G has 15 edges, 3 vertices of degree 4 Representing Graphs

and other vertices having degree 3. What is the number of vertices Graph Isomorphism

Exercise
of the graph G? Graph

Isomorphism

Exercise (4)
Is it possible that each person has exactly 5 friends in the same
group of 9 people ?

9.13
Exercise Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Exercise (6)
Give an undirected simple graph G = (V, E) with |V | = n, show Contents
that Graph definitions
Terminology

a) ∀v ∈ V , deg(v) < n, Special Graphs

Bipartie graph

b) there does not exist simultaneously both a vertex of degree 0 Representing Graphs
and Graph
and a vertex of degree (n − 1), Isomorphism
deduce that there are at least two vertices of the same degree.
Representing Graphs

c) Graph Isomorphism

Exercise
Graph

Isomorphism

9.14
Directed Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition (Directed Graph (ç thà câ h÷îng))


A directed graph G is a pair of (V, E ), in which:
• V  nonempty set of vertices
• E  set of directed edges (c¤nh câ h÷îng, arcs ) Contents

A directed edge start at u and end at v is denoted as (u, v). Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.15
Terminologies for Directed Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai

Neighborhood Xuan Toan, Tran Hong


Tai

In an directed graph G = (V, E),


• u is said to be adjacent to (nèi tîi ) v and v is said to be
adjacent from (÷ñc nèi tø ) u if (u, v) is an arc of G, and
• u is called initial vertex (¿nh ¦u ) of (u, v)
• v is called terminal (¿nh cuèi ) or end vertex of (u, v)
Contents
Graph definitions
• the initial vertex and terminal vertex of a loop are the same. Terminology

Special Graphs

Bipartie graph

Representing Graphs
The degree of a vertex and Graph
Isomorphism
In a graph G with directed edges: Representing Graphs

• in-degree (bªc v o ) of a vertex v , denoted by deg− (v), is


Graph Isomorphism

Exercise
the number of edges with v as their terminal vertex. Graph

• out-degree (bªc ra) of a vertex v , denoted by deg+ (v), is


Isomorphism

the number of edges with v as their initial vertex.


Note: a loop at a vertex contributes 1 to both the in-degree and
the out-degree of this vertex.
9.16
Basic Theorem Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Theorem
Let G = (V, E) be a graph with directed edges. Then

deg− (v) = deg+ (v) = |E|.


X X

v∈V v∈V Contents


Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.17
Complete Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong

A complete graph (ç thà ¦y õ ) on n vertices, Kn , is a simple Tai

graph that contains exactly one edge between each pair of distinct
vertices.

Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

K5 K4

Exercise
What is the largest number of edges a undirected simple graph
with 10 vertices can have? Kn can have?
9.18
Complement Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Given G = (V, E) is a simple undirected graph, |V | = n. A


complement graph (ç thà bò) of G is Gc = (V, F ) satisfies:
G ∪ Gc = Kn and E ∩ F = ∅.
Note: Some documents denote a complement graph is Ḡ.
Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.19
Cycles Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

A cycle (ç thà váng ) Cn , n ≥ 3, consists of n vertices


v1 , v2 , . . . , vn and edges {v1 , v2 }, {v2 , v3 }, . . . , {vn−1 , vn }, and
{vn , v1 }.
Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

C5 C4

9.20
Wheels Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

We obtain a wheel (ç thà h¼nh b¡nh xe ) Wn when we add an


additional vertex to a cycle Cn , for n ≥ 3, and connect this new
vertex to each of the n vertices in Cn .
Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

W5 W4

9.21
n-cube
Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

An n-dimensional hypercube (khèi n chi·u ), Qn , is a graph that


has vertices representing the 2n bit strings of length n. Two
vertices are adjacent iff the bit strings that they represent differ in
exactly one bit position.
Contents
110 111
Graph definitions
Terminology

10 11 100 101 Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
010 011
0 1 Representing Graphs

Graph Isomorphism

Exercise
00 01 000 001 Graph

Isomorphism

Q1 Q2 Q3

What's about Q4 ?
9.22
Applications of Special Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

• Local networks topologies Contents


• Star, ring, hybrid Graph definitions
Terminology

• Parallel processing Special Graphs

• Linear array
Bipartie graph

Representing Graphs
• Mesh network and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.23
Graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

• One goat, a cabbage and a wolf are on a side of river; a


boatman wishes to transport them to the other side but, his
boat being too small, he could transport only one of them at
once.
• How does he proceed not to leave them together without Contents
surveillance: the wolf and the goat, as well as the goat and Graph definitions

the cabbage?
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.24
Bipartite Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong

Definition Tai

A simple graph G is called bipartite (ç thà ph¥n æi ) if its vertex
set V can be partitioned into two disjoint sets V1 and V2 such that
every edge in the graph connects a vertex in V1 and a vertex in V2
(so that no edge in G connects either two vertices in V1 or two
vertices in V2 ) Contents
Graph definitions
Terminology

Example Special Graphs

Bipartie graph

C6 is bipartite Representing Graphs


and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

C6

9.25
Complete Bipartite Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
A complete bipartite Km,n is a graph that
• has its vertex set partitioned into two subsets of m and n
vertices, respectively,
• with an edge between two vertices iff one vertex is in the first Contents
Graph definitions
subset and the other is in the second one Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

K3,3

9.26
Bipartite graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example (Bipartite graphs?)


• C6
• Cn
• K3
Contents
• Kn Graph definitions
Terminology

• the following graph Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.27
Bipartie graph Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.28
New Graph From Old Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
A subgraph (ç thà con) of a graph G = (V, E) is a graph
H = (W, F ) where W ⊆ V and F ⊆ E .

Definition Contents

The union (hñp ) of two simple graphs G1 = (V1 , E1 ) and


Graph definitions
Terminology

G2 = (V2 , E2 ) is a simple graph with vertex set V1 ∪ V2 and edge Special Graphs

set E1 ∪ E2 . The union of G1 and G2 is denoted by G1 ∪ G2 .


Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

G1 G2 G1 ∪ G2

9.29
Planar Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.30
Planar Graphs Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
• A graph is called planar (ph¯ng ) if it can be drawn in the
plane without any edges crossing.
• Such a drawing is called planar representation (biºu di¹n
ph¯ng ) of the graph. Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

K4 K4 with no crossing

9.31
Example Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example
• Is K5 planar?

• Is Q3 planar?

110 111 Contents


Graph definitions

100 101
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
010 011 Representing Graphs

Graph Isomorphism

Exercise
Graph

000 001 Isomorphism

K5 Q3

9.32
Important Corollaries Introduction to Graphs

Nguyen An Khuong,

Corollary Tran Tuan Anh, Mai


Xuan Toan, Tran Hong

• If G is a connected planar simple graph with e edges and v


Tai

vertices where v ≥ 3, then e ≤ 3v − 6.


• If G is a connected planar simple graph with e edges and v
vertices where v ≥ 3, and no circuits of length 3, then
e ≤ 2v − 4. Contents
Graph definitions
Terminology

Example Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.33
Elementary Subdivision Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
• Given a planar graph G, an elementary subdivision (ph¥n chia
sì c§p ) is removing an edge {u, v} and adding a new vertex
w together with edges {u, w} and {w, v}. Contents
• Graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are called Graph definitions
homeomorphic (çng phæi ) if they can obtained from the Terminology

Special Graphs

same graph by a sequence of elementary subdivisions. Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.34
Kuratowski's Theorem Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Theorem
A graph is nonplanar iff it contains a subgraph homeomorphic to
K3,3 or K5 .

Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

K3,3 Exercise
Non-planar Graph

Isomorphism

K5
Non-planar

9.35
Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example
A graph is nonplanar iff it contains a subgraph homeomorphic to
K3,3 .

Contents
a
Graph definitions
Terminology

f f d Special Graphs

c j Bipartie graph

e b
j g Representing Graphs
a g and Graph
Isomorphism
i h Representing Graphs

e Graph Isomorphism

i h Exercise
d c
Graph

Isomorphism

9.36
Adjacency Lists (Danh s¡ch k·) Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Vertex Adjacent vertices Initial vertex Terminal vertices


a b, c, e a b, c, d, e
b a b b, d
c a, d, e c a, c, e Contents
d c, e d c, e Graph definitions
e a, c, d e b, c, d Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.37
Adjacency Matrices Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong

Definition Tai

Adjacency matrix (Ma trªn k· ) AG of G = (V, E)


• Dimension |V | × |V |
• Matrixelements
1 if (vi , vj ) ∈ E
aij = Contents
0 otherwise
Graph definitions
Terminology

Special Graphs

a b Bipartie graph

Representing Graphs
and Graph
Isomorphism
 a b c d  Representing Graphs

a 0 1 1 1 Graph Isomorphism

Exercise
b 
 1 0 1 0 
 Graph

c  1 1 0 0  Isomorphism

d 1 0 0 0

c d

9.38
Examples Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example
Give the graph defined by the following adjacency matrix
Contents
A B C D E Graph definitions
  Terminology

Special Graphs

A  0 0 1 1 0  Bipartie graph

Representing Graphs
 
B  0 0 0 1 0  and Graph
Isomorphism
 
C 
 1 0 0 1 0 
 Representing Graphs

D  1 1 1 0 1  Graph Isomorphism

Exercise
 
E  0 0 0 1 0 
Graph

Isomorphism

9.39
Adjacency Matrices Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example
Give the directed graph defined by the following adjacency matrix
Contents
A B C D E Graph definitions
  Terminology

Special Graphs

A  1 0 1 1 0  Bipartie graph

Representing Graphs
 
B  0 0 0 0 0  and Graph
Isomorphism
 
C 
 1 0 0 0 0 
 Representing Graphs

D  1 1 1 0 1  Graph Isomorphism

Exercise
 
E  1 0 0 0 0 
Graph

Isomorphism

9.40
Incidence Matrices Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong

Definition Tai

Incidence matrix (ma trªn li¶n thuëc ) MG of G = (V, E)


• Dimension |V | × |E|
• Matrix 
elements
1 if ej is incident with vi
mij = Contents
0 otherwise
Graph definitions
Terminology

Special Graphs

a e2 b Bipartie graph

Representing Graphs
and Graph
Isomorphism
e1 e2 e3 e4 Representing Graphs

1 1 1 0
 
a Graph Isomorphism

Exercise
e1
e4 e3 b  0 1 0 1 
Graph

1 0 0 1
 
c   Isomorphism

d 0 0 1 0

c d

9.41
Examples Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Example
Give incidence matrix according to the following graph
Contents
F Graph definitions
Terminology

B C Special Graphs

Bipartie graph

Representing Graphs
and Graph
A Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
E D Graph

G Isomorphism

9.42
Graph Isomorphism Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Definition
G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are isomorphic (¯ng c§u ) if
there is a one-to-one function f from V1 to V2 with the property
that a and b are adjacent in G1 iif f (a) and f (b) are adjacent in
G2 , for all a and b in V1 . Such a function f is called an Contents

isomorphism (mët ¯ng c§u). Graph definitions


Terminology

(i.e. there is a one-to-one correspondence between vertices of the Special Graphs

two graphs that preserves the adjacency relationship.)


Bipartie graph

Representing Graphs
and Graph
Isomorphism
u1 u2 v1 v2 Representing Graphs

Isomorphism function f : U −→ Graph Isomorphism

Exercise
V with Graph

f (u1 ) = v1 f (u2 ) = v4 Isomorphism

f (u3 ) = v3 f (u4 ) = v2
u3 u4 v3 v4

9.43
Isomorphism ? Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Contents
Graph definitions
Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

Exercise
Graph

Isomorphism

9.44
Isomorphism? Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

A
A B
Contents
B Graph definitions
Terminology

F C
Special Graphs

C Bipartie graph

Representing Graphs
and Graph
Isomorphism
D Representing Graphs

E D Graph Isomorphism

G2 Exercise
F E Graph

G1 Isomorphism

9.45
Isomorphism? Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

A1 A2 B2

Contents
Graph definitions

D1 E1 E2 F2 Terminology

Special Graphs

Bipartie graph

Representing Graphs
F1 and Graph
Isomorphism
Representing Graphs

Graph Isomorphism

C1 B1 D2 C2 Exercise
G1 G2 Graph

Isomorphism

9.46
Isomorphism Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Are the simple graphs with the following adjacency matrices


isomorphic ?
   
0 0 1 0 1 1 Contents
1  0 0 1   1 0 0 
Graph definitions
1 1 0 1 0 0 Terminology

Special Graphs
   
0 1 0 1 0 1 1 1 Bipartie graph

 1 0 Representing Graphs
0 1   1 0 0 1  and Graph
2     Isomorphism
 0 0 0 1   1 0 0 1  Representing Graphs

1 1 1 0 1 1 1 0 Graph Isomorphism

    Exercise
0 1 1 0 0 1 0 1 Graph

 1 0 0 1   1 0 0 0  Isomorphism

3    
 1 0 0 1   0 0 0 1 
0 1 1 0 1 0 1 0

9.47
Isomorphism Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Determine whether the graphs (without loops) with the incidence


matrices are isomorphic.
   
1 0 1 1 1 0 Contents
•  0 1 1   1 0 1  Graph definitions
Terminology

1 1 0 0 1 1 Special Graphs

    Bipartie graph

1 1 0 0 0 0 1 0 0 1 Representing Graphs
and Graph
•  1 0 1 0 1   0 1 1 1 0  Isomorphism
   
 0 0 0 1 1   1 0 0 1 0  Representing Graphs

Graph Isomorphism

0 1 1 1 0 1 0 1 0 1
Exercise
• Extend the definition of isomorphism of simple graphs to Graph

undirected graphs containing loops and multiple edges.


Isomorphism

• Define isomorphism of directed graphs

9.48
Revision Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Given an adjacency matrix of G1 and an incidence matrix of G2


(G1 ) A B C D E (G2 )  e1 e2 e3 e4 e5 e6 e7
0 1 1 1 1

A

A 1 0 0 0 1 1 0

B  1 0 0 1 0  B  1 1 0 1 0 0 0 
Contents
1 0 0 1 0
  
C   C  0 1 1 0 1 0 0 
Graph definitions
 
1 1 1 0 1
 
D   D  0 0 1 1 0 0 1

E 1 0 0 1 0 E 0 0 0 0 0 1 1 Terminology

What is the relation between G1 and G2 .


Special Graphs

Bipartie graph

Representing Graphs
A) Isomorphism. and Graph
Isomorphism
B) Non-isomorphism. Representing Graphs

Order.
Graph Isomorphism

C)
Exercise
D) Equivalence. Graph

Isomorphism

9.49
Revision Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Given a complete graph K5 and a complete bi-partite graph K3,2 . Contents


Which of the following assessment is/are true? Graph definitions
Terminology

K3,2 and K5 are non-isomorphic.


Special Graphs

A) Bipartie graph

B) K3,2 and K5 have the same number of vertex. Representing Graphs


and Graph
Isomorphism
C) K3,2 and K5 have the same number of edge. Representing Graphs

K3,2 and K5 are isomorphic.


Graph Isomorphism

D)
Exercise
Graph

Isomorphism

9.50
Revision Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

Choose the correct statement of a (undirected simple graph) has n


vertices. Contents
Graph definitions
Bªc cõa mët ¿nh b§t ký trong ç thà nhä hìn n − 2.
Terminology

A) Special Graphs

Tçn t¤i mët ¿nh trong ç thà câ bªc l 1.


Bipartie graph

B)
Representing Graphs
and Graph
C) Khæng thº chùa ¿nh cæ lªp. Isomorphism
Tçn t¤i hai ¿nh trong ç thà câ còng sè bªc.
Representing Graphs

D) Graph Isomorphism

E) C¡c ¡p ¡n kh¡c ·u sai. Exercise


Graph

Isomorphism

9.51
Prove that ... Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

...
There are 101 invited people in a party.
Suppose that A knows B ⇒ B knows A.
Prove that
1 at least one people knows an even number of other people. Contents
2 at least two people who know the same number of people Graph definitions

(but not considering himself).


Terminology

Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
A chess tournament of n persons plays according to the circle Representing Graphs

Graph Isomorphism

competition. Prove that at any moment of the tournament there Exercise


are always two players having identical number of games played. Graph

And if n ≥ 4, at any intermediate moment of the tournament,


Isomorphism

there are always two players having identical number of games


that they are the winner.

9.52
Revision Introduction to Graphs

Nguyen An Khuong,
Tran Tuan Anh, Mai
Xuan Toan, Tran Hong
Tai

In a tournament with n teams participated (n ≥ 4), n + 1


competition games were happening. Prove that there exists a team
that has played at least three matches.

Contents
With any four of the n people (n ≥ 4), there exists a person who
Graph definitions
knows the three others. Prove that there exists a person who Terminology

knows all n − 1 others. Special Graphs

Bipartie graph

Representing Graphs
and Graph
Isomorphism
In a party of 6 people, prove that there are 3 people who know Representing Graphs

Graph Isomorphism

each other or 3 people who do not know each other. Exercise


Graph

Isomorphism

During a summer vacation, 7 friends are vacationing away. They


promised each other that during the holidays each person must
write to exactly three of them. Prove that there is someone who
does not write back to the his sender.
9.53

You might also like