0% found this document useful (0 votes)
6 views87 pages

Chapter01 GraphsTheory

Uploaded by

hamidmaraf2005
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)
6 views87 pages

Chapter01 GraphsTheory

Uploaded by

hamidmaraf2005
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/ 87

Graphs theory

Abdelhamid Lebal

October 8, 2024

Abdelhamid Lebal Graphs theory October 8, 2024 1 / 87


”The only way to do great work is
to love what you do.”
- Steve Jobs

”Success is not final, failure is not


fatal: It is the courage to continue
that counts.”
- Winston Churchill.

Abdelhamid Lebal Graphs theory October 8, 2024 2 / 87


Graphs theory

Abdelhamid Lebal

October 8, 2024

Abdelhamid Lebal Graphs theory October 8, 2024 3 / 87


Contents

1 Introduction

2 The utilization of graphs

3 Definitions

4 Eulerian and Hamiltonian trajectories

5 Non-graphical representation of a graph (Graph modelisation)

Abdelhamid Lebal Graphs theory October 8, 2024 4 / 87


Introduction

Introduction
Graph theory is one of the most and effective mathematical and
computational tools (techniques) used in operations research, as it can
be used to model many concrete situations, involving interacting objects.
Examples
Route, rail and air network planning.
The design of telecommunication networks, social networks and
computer networks.
Optimizing delivery routes, warehouse, and distribution center
planning.
Social network analysis to understand connections between
individuals, influence and dissemination of information.
Modelling spatial relationships between geographic objects such as
cities, roads, rivers, etc.
Planning telecommunications networks to ensure optimal coverage.
Abdelhamid Lebal Graphs theory October 8, 2024 5 / 87
The utilization of graphs

The utilization of graphs

Many problems are related to classical graph problems. Among them:


Problem of finding shorter path between two cities,
Minimum cost spanning tree problem,
Flow problem
Assignment problem,
...

Abdelhamid Lebal Graphs theory October 8, 2024 6 / 87


Definitions

Definitions
1-Graph:
A graph is a geographic drawing defined by a set of points called
vertices or (nodes) which are connected to each other by a set of arrows
called arcs or edges. Mathematically, a graph (G) is represented by a pair
of two sets (G = (V, E)) where (V) is the set of vertices and (E) is the
set of edges (un-oriented graph) or arcs (oriented graph).
u3

a d
u2 u9
u6
u5 u7
u1

b c e
u4 u8

Abdelhamid Lebal Graphs theory October 8, 2024 7 / 87


Definitions

Definitions

2-Order & Size of a graph:

The number of vertices |V | of a G = (V , E ) is called


Order of G . It is identified by |G | or ord(G ) = n, and the
number of its arcs is called the size of G , it is denoted
|E | = m.

Abdelhamid Lebal Graphs theory October 8, 2024 8 / 87


Definitions

Definitions

3-Arc
An arc connects two vertices, so it will be represented by a pair (x, y )
where x and y are two vertices. An arc can be oriented, i.e.the order ”x”
and of ”y ” is important in the couple (x, y ). An arc can be non-oriented
called : edge and in this case the order of ”x” and ”y ” in the couple
(x, y ) is not important, so (x, y ) = (y , x).

x y x y
Figure: An-oriented arc (edge) Figure: Arc oriented

Abdelhamid Lebal Graphs theory October 8, 2024 9 / 87


Definitions

Definitions

Note:
An un-oriented arc ”edge” can always be transformed into a situation
where we have only two arcs oriented.

x y

=
x y

Abdelhamid Lebal Graphs theory October 8, 2024 10 / 87


Definitions

Définitions
4-Loop
We call ’loop’ an arc or edge whose initial vertex is equal to its final
vertex. The arc (z, z) is a loop.

x z u2

Abdelhamid Lebal Graphs theory October 8, 2024 11 / 87


Definitions

Definitions

5-Adjacency of vertices and adjacency of arcs (edges)

It is said that two vertices in a graph (G=(V, E)) are adjacent or


neighbours if they are joined by an arc (edge).
We say that two arcs (edges) in a graph (G = (V, E) ) are adjacent
if they have at least one common end.
Example:
The vertices ′ a′ and ′ e ′ of the first figure are adjacent (the arc u6
joins the two vertices).
The arcs u3 and u9 of the first figure are adjacent because the arcs
have a common end which is the vertex ′ d ′ .

Abdelhamid Lebal Graphs theory October 8, 2024 12 / 87


Definitions

Definitions

6-Weighted graph or valued graph

A graph is called weighted if we assign a weight or value (distance,


cost, time,...) to each of its arcs (edges).

a e
3 5 10 20

2.5 30

b c d f
Figure: Example of weighted graphs

Abdelhamid Lebal Graphs theory October 8, 2024 13 / 87


Definitions

Definitions
7-Simple graph
A simple graph is a graph without loops and without multiple arcs
(edges) .
Note:
If there is more than one arc (edge) between any two vertices oriented in
the same direction, all of these arcs (edges) are called multiple arc
(edge) .

z
z

x y
x y
Figure: Simple graph
Figure: Non-simple graph
Abdelhamid Lebal Graphs theory October 8, 2024 14 / 87
Definitions

Definitions

8: p-Graph or multi-graph
A p-graph is a graph in which there is never more ’p’ arcs or edges of the
form (i, j) between two random vertices.
examples:

z z

x y x y
Figure: Example of 1-graph ≡
Figure: Example of a 3-graph graph

Abdelhamid Lebal Graphs theory October 8, 2024 15 / 87


Definitions

Definitions
9- out-degree, in-degree & degree of a vertex

Definition 1:
The out-degree of a vertex is the number of adjacent arcs that leave it
(the outgoing arcs). It is denoted d + (x) which:
d + (x) = {a ∈ E /a = (x, y ) Where y ∈ V }: the vertex ′ y ′ is called
successeur of ′ x ′ , where the set of successors of a vertex ′ x ′ is defined by:
Γ+ (x) = {y /y ∈ V and (x, y ) ∈ E }
Definition 2:
The In-degree of a vertex is the number of adjacent arcs that arrive
(incoming arcs). It is denoted d − (x) which: d − (x) = {a ∈ E /a = (y , x)
where y ∈ V }: the vertex ′ y ′ is called predecessor of ′ x ′ , where the
predecessor set of a vertex ′ x ′ is defined by:
Γ− (x) = {y /y ∈ V et (y , x) ∈ E }
Abdelhamid Lebal Graphs theory October 8, 2024 16 / 87
Definitions

Definitions

Definition 3:
Degree of a vertex is the number of arcs adjacent to it. Note d(x), so
d(x) is the sum of the number of outgoing arcs and incoming arcs; i.e.
d(x) = d + (x) + d − (x). For a simple non-oriented graph, the degree d(x)
is the number of neighbours of (x), i.e. the number of adjacent vertices to
x. The number of vertices that are adjacent of a vertex x is defined by:

Γ(x) = Γ+ (x) + Γ− (x)

Abdelhamid Lebal Graphs theory October 8, 2024 17 / 87


Definitions

Definitions

Note:

If a vertex has one or more loops, each makes a contribution of 2 in


the calculation of degree of that vertex.
A vertex with a degree of zero (d(x) = 0) is known as an isolated
vertex;
A vertex with a degree of one (d(x) = 1) is known as a pendant
vertex;
A vertex with a degree of n − 1 is known as a dominant vertex;
An empty graph is a graph formed only of isolated vertices (graph
without arcs (edges)) E = ∅.

Abdelhamid Lebal Graphs theory October 8, 2024 18 / 87


Definitions

Definitions

The Handshaking Lemma:

The sum of the degrees of the vertices of a graph is equal to 2 times


its number of arcs (edges);
P
x∈V d(x) = 2.|E |
An arc (edge) e = (x, y ) of the graph is counted exactly twice in the
sum of degrees: once in d(x) and once in d(y ). In other words: the
sum of degrees of vertices is always even.
In an oriented graph G = (V , E ), the sum of the in-degrees of the
vertices of G is equal to the sum of the out-degrees of G , that is:
+ −
P P
x∈V d (x) = x∈V d (x)

Abdelhamid Lebal Graphs theory October 8, 2024 19 / 87


Definitions

Definitions

Attention!
Do not confuse the notions of order and degree !!!

Abdelhamid Lebal Graphs theory October 8, 2024 20 / 87


Definitions

Definitions

Example:

According to the graph of the fol- e


lowing figure, the sets of succes- c
sors, predecessors and neighbors
of vertices (a, b, c, d, e) are:
a b c d e a b
Γ+ (x) {b} {e} {b, e} {} {}
Γ− (x) {} {a, c} {} {} {b, c}
Γ(x) {b} {a, c, e} {b, e} {} {b, c}
d

Abdelhamid Lebal Graphs theory October 8, 2024 21 / 87


Definitions

Definitions

The following table determines the half-degrees (interior and exterior)


and the degrees of the vertices of the previous graph:
a b c d e Total
+
d (x) 1 1 3 0 0 5
d − (x) 0 2 0 0 3 5
d(x) 1 3 3 0 3 10
It is clear that:
+ −
P P P
x∈X d (x) = x∈X d (x) = 5 is verified and x∈X dG (x) = 10 is
an even number;
The vertex a is pendant: d(a) = 1;
The vertex d is an isolated vertex: d(d) = 0.

Abdelhamid Lebal Graphs theory October 8, 2024 22 / 87


Definitions

Definitions
10-complete graph
An G = (X , E ) oriented (non-oriented) graph is called complete if any
pair of vertices are connected by an arc (edge). In other words: if (G ) is
oriented: ∀x, y ∈ V : (x, y ) ∈
/ E =⇒ (y , x) ∈ E . Note that Kn is the
complete simple graph at n vertices (also known as clic at n vertices).
Examples:

b b d b b d

a c a c a c a c
Figure: Incomplete graphs Figure: Complete graphs

Abdelhamid Lebal Graphs theory October 8, 2024 23 / 87


Definitions

Definitions

V1 V2 V1 V2

c c

a a

d d

b b

e e
Figure: complete bipartite graph
Figure: Bipartite graph
K2,3

Abdelhamid Lebal Graphs theory October 8, 2024 24 / 87


Definitions

Definitions

11-Bipartite graph
If a graph G = (V , E ) can be divided into two subsets V1 and V2 , it is
called bipartite graph, such that, V1 ∩ V2 = ∅ and V1 ∪ V2 = V and any
arc (edge) u ∈ E at one end in V1 and the other in V2 . It is denoted
G = (V1 , V2 , E ).
The previous graph is a bipartite graph G = (V1 , V2 , E ) such that:
V1 = {a, b}, V2 = {c, d, e} and
E = {(a, c), (a, e), (b, c), (b, d), (b, e)}.

Abdelhamid Lebal Graphs theory October 8, 2024 25 / 87


Definitions

Definitions

12-Complete bipartite graph


A bipartite graph G = (V1 , V2 , E ) is called complete bipartite if any
vertex of the subsets v1 or V2 is adjacent to all vertices of the other set;
∀x ∈ V1 , ∀y ∈ V2 : (x, y ) ∈ E Where (y , x) ∈ E . If the graph is simple
and |V1 | = n and |V2 | = m we note this graph Kn,m . The graph of right
figure is a complete bipartite graph.

Abdelhamid Lebal Graphs theory October 8, 2024 26 / 87


Definitions

Definitions

13-Regular graph
A graph G = (V , E ) is called regular of degree k, if ∀x ∈ V , d(x) = k.
in other words, all vertices have the same degree. A regular graph of
degree 3 is called cubic.
Examples:
The complete graph Kn is regular graph of degree n − 1
The complete bipartite graph Kn,n is regular graph of degree n.

Abdelhamid Lebal Graphs theory October 8, 2024 27 / 87


Definitions

Definitions
14-Complementary graph
A graph that is simple G = (V , E ), we can define a complementary
graph G = (X , V ) as follows: [(x, y ) ∈ E ⇐⇒ (x, y ) ∈
/ E ], i.e : an arc
(edge) belongs to the complementary graph G if it does not belong to the
initial graph G .

d d

c b c
b
a a
Figure: Graph G Figure: Complementary graph of
Abdelhamid Lebal
G
Graphs theory October 8, 2024 28 / 87
Definitions

Definitions

14-Complementary graph
Note:

The union of a simple graph and its complementary is a complete graph of


order n; G ∪ G = Kn .

Abdelhamid Lebal Graphs theory October 8, 2024 29 / 87


Definitions

Definitions

15- Sub-graph
Either a graph G = (V , E ) and V0 a subset of V , V0 ⊆ V . The
sub-graph of G generated by V0 is the graph G0 = (V0 , E0 ) such that:
E0 ⊆ E and V0 = {u/u ∈ V and u ∈ V0 ∗ V0 }.

Abdelhamid Lebal Graphs theory October 8, 2024 30 / 87


Definitions

Definition
15- Sub-Graph
Example:
Either the graph G of the figure below on the left, The sub-graph
generated by V0 = {a, c, d} is the graph of the figure below right.

a b a

d d
c c

Figure: Graph G Figure: Sub-graph of G

Abdelhamid Lebal Graphs theory October 8, 2024 31 / 87


Definitions

Definitions

16-Partial graph
Either a graph G = (X , V ) and V0 a subset of V , V0 ⊆ V . The partial
graph generated by V0 is the graph G0 = (V , E0 ).

Example: The par-


a a
tial graph generated by
E0 = {(a, a), (a, d)(d, b)} of
graph G is that of the following
figure. d
c
Figure: Partial graph of G

Abdelhamid Lebal Graphs theory October 8, 2024 32 / 87


Definitions

Definitions
17- Partial sub-graph
If G ′ is a partial graph of a sub-graph of G , then the graph G ′ = (V ′ , E ′ )
is considered as a partial sub-graph of the graph G = (V , E ).

Example: The graph of the fol- a


lowing figure is a partial graph
of the graph of previous figure
(sub-graph of G) generated by
the set (a, a), (a, d) is therefore a
partial sub-graph of the graph G
of the figure Graph G ) .
d
c
Figure: Partial sub-graph of G
Abdelhamid Lebal Graphs theory October 8, 2024 33 / 87
Definitions

Definitions

18-Chain
Definition 1: A chain c is a finite and ordered sequence of vertices,
(c = x0 , x1 , ..., xm ), such that: ∀i ∈ [0, m[, (xi , xi+1) ∈ E Where
(xi+1 , xi ) ∈ E . The number m is called length of the chain and we write
m = l(c). The vertices x0 and xm are called the ends of the chain c.
Definition 2: A chain c in a graph is a finite and ordered sequence of
edges (u1, u2 , ..., um ) such that ∀i, 1 ≤ i ≤ m − 1 : ui and ui+1 are
adjacent.

Abdelhamid Lebal Graphs theory October 8, 2024 34 / 87


Definitions

Definitions

18-Chain
Note:
By convention, any chain must contain at least one edge (arc).
A chain is called elementary if it does not meet more than once each
of its vertices.
A chain is called simple if it passes only once through each of its arcs
(edges).

Abdelhamid Lebal Graphs theory October 8, 2024 35 / 87


Definitions

Definitions
18-Chain
The subsequent vertices
(a, c, f , b, e) is a chain. This
chain is elementary and
e
simple.
The sequence of vertices
(a, c, b, d, e, b, f ) forms a
chain joining a to f . this
b d
string is simple but is not
elementary.
a
The subsequent vertices
(c, f , d, e, b, f , d, b, a) forms
a chain joining c to a. this
chain is neither simple nor
c f
elementary.
Abdelhamid Lebal Graphs theory October 8, 2024 36 / 87
Definitions

Definitions
18-Chain
e

b d

c f
Figure: A chain is neither simple nor elementary

Abdelhamid Lebal Graphs theory October 8, 2024 37 / 87


Definitions

Definitions
19-Cycle
Un Cycle is a closed chain (both ends of the chain are confed).
Example:
In the graph G , the ordered sequence of vertices (a, c, f , d, b) forms a
cycle.
e e
b d b d
a a
c f c f
Figure: Graph G Figure: The cycle (a, c, f , d, b, a)
Abdelhamid Lebal Graphs theory October 8, 2024 38 / 87
Definitions

Definitions

Note:

A cycle is called elementary if it does not meet more than once each
of these vertices.
A cycle is called simple if it passes only once through each of its arcs
(edges).

Abdelhamid Lebal Graphs theory October 8, 2024 39 / 87


Definitions

Definitions

19-Path
1 A path c in a graph G = (V , E ) is an ordered sequence
c = (x0 , x1 , ..., xn ) of G such that, for i = 0, 1, 2, ..., n − 1, we have
(xi , xi+1 ) ∈ E . The x0 is the initial end of the path, xn is its final
end.
2 A path is a chain such that the terminal end of an arc coincides with
the initial end of the next arc. The first vertex of the path is called the
initial node. of the path, and the last is called the terminal node.

Abdelhamid Lebal Graphs theory October 8, 2024 40 / 87


Definitions

Definitions

e e
b d b d
a a
c f c f
Figure: Simple and elementary Figure: Simple path but not
path(a, c, f , d, e) elementary (a, b, d, e, b, c)

Abdelhamid Lebal Graphs theory October 8, 2024 41 / 87


Definitions

Definitions

e
b d
a
c f
Figure: Path is neither simple nor elementary(a, b, f , d, e, b, c)

Abdelhamid Lebal Graphs theory October 8, 2024 42 / 87


Definitions

Définitions
20-Circuit
The Circuit is a closed path (The two ends of the path are confused).
Example:
In the graph G , the ordered sequence of vertices (b, c, f , d, e, b) forms a
circuit.

e
b d
a
c f
Figure: The sequence (b, c, f , d, e, b) forms a circuit

Abdelhamid Lebal Graphs theory October 8, 2024 43 / 87


Definitions

Definitions

20-Circuit
Note:

A circuit is called elementary if it does not meet more than once


each of its vertices.
A circuit is called simple if it passes only once through each of its
arcs.
A circuit of length 1 is a loop.

Abdelhamid Lebal Graphs theory October 8, 2024 44 / 87


Definitions

Definitions

21-Acyclic graph

A graph (G ) is said to be acyclic if it has no cycles.

Properties
1 If in a graph G any vertex is of degree greater than or equal to 2,
then G has at least one cycle.
2 An acyclic graph G at n vertices has at most n − 1 edges.

Abdelhamid Lebal Graphs theory October 8, 2024 45 / 87


Definitions

Connexity

The connectedness in a graph is defined by a relation between two vertices


(nodes) as follows:
x and y have a relationship of connection ⇐⇒ there is a chain
between x and y , otherwise, x = y (isolated vertex).

Abdelhamid Lebal Graphs theory October 8, 2024 46 / 87


Definitions

Graph Connectedness
Example: Be the following graph
G:
There is a chain between the
vertices x1 and x4 noted x4
C = (x1 , x2 , x4 ). Therefore
x1 and x4 have a relationship x2 x6
of connexity.
There are no chains between x1
the vertices x1 and x5 , x5
between the vertex x1 and
x6 , and between the vertex x3 x7
x5 and the vertex x7 . Then
the following couples Figure: A graph G
(x1 , x5 ), (x1 , x6 ), (x5 , x7 )
have no relationship of
connexity
Abdelhamid Lebal Graphs theory October 8, 2024 47 / 87
Definitions

Strong connecty

Strong connecty is defined by a relationship between two vertices as


follows:
x and y have a relation of strong connecty ⇐⇒ there is a path
from x to y and a path from y to x, otherwise x = y isolated vertex.
Example:
In the graph of the previous figure:
There is a path between the vertices x1 and x2 noted C = (x1 , x2 )
and a path between x2 and x1 noted C = (x2 , x3 , x1 ). then x1 and x2
have a relation of strong connexity.
There is a path between the vertices x4 and x1 noted
C = (x4 , x2 , x3 , x1 ) but there is no path from x1 and x4 . Then x1 and
x4 have no relation of strong connexity.

Abdelhamid Lebal Graphs theory October 8, 2024 48 / 87


Definitions

Connected graphs, Strongly connected graphs

A graph G = (X , U) is said to be connected if all its vertices have two by


two the relation of strong connexity.
Examples:
x4 x1
x2 x2 x3

x1 x1
x5 x2
x3 x3
Figure: No-connected graph Figure: Connected graphs

Abdelhamid Lebal Graphs theory October 8, 2024 49 / 87


Definitions

Strongly connected graph

A graph G = (X , U) is said strongly connected if all its vertices have the


strong connexity relation in pairs.
Examples:
x4 x2 x4 x2
x1
x1
x5 x3
x5 x3

Figure: Not strongly connected


graph Figure: Strongly connected graph

Abdelhamid Lebal Graphs theory October 8, 2024 50 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

A path, chain, circuit or cycle is said Eulerian if it passes once and


only once through all the edges (arcs) of the graph.

Abdelhamid Lebal Graphs theory October 8, 2024 51 / 87


Eulerian and Hamiltonian trajectories

Figure: The city of Konigsberg

Abdelhamid Lebal Graphs theory October 8, 2024 52 / 87


Eulerian and Hamiltonian trajectories

Figure: Schema of the city of Konigsberg

Abdelhamid Lebal Graphs theory October 8, 2024 53 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

Theorem 1:
A multigraph G has a Eulerian chain joining the vertices x0 and xk of V
if and only if:
The graphe G is connected.
∀x ∈ V \{x0 , xk }, d(x) = 2i/i : integer (all vertices are of even degree
except x0 and xk ).

Abdelhamid Lebal Graphs theory October 8, 2024 54 / 87


Eulerian and Hamiltonian trajectories

Example 1: The Konigsberg problem (Euler 1736).

D A C
Figure: Schema of the city of Figure: Graph representing the
Konigsberg city of Konigsberg

Abdelhamid Lebal Graphs theory October 8, 2024 55 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

The town of Konigsberg (currently called: Kaliningrand) has two islands


(A and B) and two banks (C and D). The problem posed by Euler in 1736
is: Is it possible to leave from A, B, C or D and cross the seven bridges
P1 , P2 , P3 , P4 , P5 , P6 , P7 in order to visit the city of Konigsberg, once and
only once (without imposing to return to the starting point).
This problem can be represented by a non-oriented graph.
The question is whether the graph representing the city of Konigsberg has
an Eulerian chain (or cycle).
In the previous graph, we have d(A) = 5, d(B) = 3, d(C ) = 3, d(D) = 3.
All the vertices are of odd degree, so the graph G does not allow an
Eulerian chain which means that we cannot visit the city of Konigsberg
(Kaliningrad) crossing all bridges once and only once.

Abdelhamid Lebal Graphs theory October 8, 2024 56 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

Théorème 2:
A multigraph G admits a Eulerian cycle if and only if:
The graph (G ) is connected.
∀x ∈ V , d(x) = 2i/i : integer (all vertices are of even degree)

Abdelhamid Lebal Graphs theory October 8, 2024 57 / 87


Eulerian and Hamiltonian trajectories

Chaı̂ne, chemin, cycle et circuit Eulérien

Exemple: Cycle Eulerien Soit le graphe de la figure suivante:

a
e f

b d c

Figure: Example of an Eulerian cycle

Abdelhamid Lebal Graphs theory October 8, 2024 58 / 87


Eulerian and Hamiltonian trajectories

We have d(a) = 4, d(b) = 4, d(c) = 4, d(d) = 6, d(e) = 4, d(f ) = 4, then


the graph G admits an Eulerian cycle, which is defined as follows:
C = (a, d, c, d, b, d, a, e, b, e, f , c, f , a).

Abdelhamid Lebal Graphs theory October 8, 2024 59 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

Theorem 3:
An oriented graph G admits a Eulerian path joining the vertices x0 and
xk if and only if:
The graph G is connected.
d + (x0 ) = d − (x0 ) + 1 ; d + (xk ) = d − (xk ) − 1
d + (x) = d − (x) ∀x ∈ V \{x0 , xk }

Abdelhamid Lebal Graphs theory October 8, 2024 60 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit


Example 3:
Be the graph G = (V , E ) of the following figure.

a
e
b
f

d
c
Figure: Example of an Eulerian path
Abdelhamid Lebal Graphs theory October 8, 2024 61 / 87
Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

The graph G is connected:


In the grqph G , ze hqve:
a b c d e f
d + (x) 1 3 1 2 2 1
d − (x) 1 3 2 2 1 1
Relation d + (a) = d + (b) = d + (c) = d + (d) = d + (e) = d + (f ) =
between d − (a) d − (b) d − (c)− d − (d) d − (e)+ d − (f )
d + (x) et 1 1
d − (x)
Then; the graph G admits an Eulerian path joining the vertex e and the
vertex c.
The Eulerian path is defined as follows: C = (e, a, b, c, d, b, d, e, b, f , c)

Abdelhamid Lebal Graphs theory October 8, 2024 62 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

Theorem 4
An oriented graph G admits an Eulerian cycle if and only if:
The graph G is connected.
∀x ∈ V , d + (x) = d − (x).

Abdelhamid Lebal Graphs theory October 8, 2024 63 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit


Example 4:
Be the graph G = (X , U) of the following figure.

a
e
b
f
d
c
Figure: Example of an Eulerian path

Abdelhamid Lebal Graphs theory October 8, 2024 64 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

The graph is connected


In the graph G , we have:
a b c d e f
d + (x) 1 3 2 2 2 1
d − (x) 1 3 2 2 2 1
Relation d + (a) = d + (b) = d + (c) = d + (d) = d + (e) = d + (f ) =
between d − (a) d − (b) d − (c) d − (d) d − (e) d − (f )
d + (x) and
d − (x)
We see that ∀x ∈ X , d + (x) = d − (x), then the graph G admits an
Eulerian circuit C ; C = (e, a, b, c, d, b, d, e, b, f , c, e).

Abdelhamid Lebal Graphs theory October 8, 2024 65 / 87


Eulerian and Hamiltonian trajectories

Eulerian chain, path, cycle and circuit

Notes:
1 A non-oriented (oriented) G graph with an Eulerian cycle (circuit) is
called Eulerian graph.
2 A non-oriented (oriented) G graph with an Eulerian chain (path) is
called Semi-Eulerian.

Abdelhamid Lebal Graphs theory October 8, 2024 66 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

A path, chain, circuit, or cycle is said to be Hamiltonian if it passes once


and only once through all the vertices of the graph.
A Hamiltonian path, or Hamiltonian chain, is therefore an elementary
chain of length n − 1.
A graph is called a Hamiltonian if it contains a Hamiltonian cycle
(unoriented case) or a Hamiltonian circuit (oriented case).
A semi-Hamiltonian graph is a graph that contains a Hamiltonian
chain, but no Hamiltonian cycle.

Abdelhamid Lebal Graphs theory October 8, 2024 67 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Example: The travelling salesman problem.


The travelling salesman’s problem consists of finding a route that
allows him to visit all the cities once and only once and then return to
his starting point. The way to model this problem in graph theory is
to find a circuit that passes through all the vertices (cities) once and
only once, i.e., a Hamiltonian circuit.

Abdelhamid Lebal Graphs theory October 8, 2024 68 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Note:
As with Eulerian graphs, there is no known
characterization (necessary and sufficient
condition) for Hamiltonian graphs; it’s a difficult
problem. However, several results are known that
give sufficient conditions for the graph to be
Hamiltonian.

Abdelhamid Lebal Graphs theory October 8, 2024 69 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Theorem-1: Dirac Theorem (1960)


Let G be a simple graph with n vertices, with
n ≥ 3. If for each vertex x of G , deg (x) ≥ n2 ,
then G is Hamiltonian.
∀x ∈ X , deg (x) ≥ n2 .
|X |
∀x ∈ X , deg (x) ≥ 2 =⇒ G is Hamiltonian

Abdelhamid Lebal Graphs theory October 8, 2024 70 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Examples:
x2
x1 x1 x5
x5 x2
x3 x4
x4 x3

∀x ∈ X ; deg (x) ≥ 2.5 =⇒ G is ∀x ∈ X ; deg (x) ≥ 2.5 =⇒ G is


Hamiltonian?. Hamiltonian ?.
Hamiltonian cycle (1,2,5,4,3,1). No Hamiltonian cycle.
Hamiltonian graph.

Abdelhamid Lebal Graphs theory October 8, 2024 71 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Examples:
x2
x1
x3
x5
x4
∀x ∈ X ; deg (x) ≥ 2.5 =⇒ G is Hamiltonian?.
Hamiltonian cycle (x1 , x2 , x3 , x4 , x5 ).
Hamiltonian graph.

Abdelhamid Lebal Graphs theory October 8, 2024 72 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph

Theorem-1: Ore Theorem (1952)


Let G be a simple graph with n vertices, with
n ≥ 3. If deg (u) + deg (v ) ≥ n for any pair (u, v )
of non-adjacent (u, v ) ∈ / U vertices, then the
graph G is Hamiltonian.
∀(x, y ) ∈ X 2 and (x, y ) ∈
/ U,
deg (x) + deg (y ) ≥ |X | =⇒ G is Hamiltonian

Abdelhamid Lebal Graphs theory October 8, 2024 73 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian graph
Examples:
x2 x2
x1 x1
x5 x5
x3 x3
x4 x4
∀(x, y ) ∈ X 2 , (x, y ) ∈/
∀(x, y ) ∈ X 2 , (x, y ) ∈/
U; deg (x) + deg (y ) ≥ n =⇒ G
U; deg (x) + deg (y ) ≥ n =⇒ G
is Hamiltonian?.
is Hamiltonian?.
Hamiltonian cycle
Hamiltonian cycle
(x1 , x2 , x5 , x4 , x3 , x1 ).
(x1 , x2 , x5 , x4 , x3 , x1 ).
Hamiltonian graph
Hamiltonian graph
Hamiltonian graph.
Abdelhamid Lebal Graphs theory October 8, 2024 74 / 87
Eulerian and Hamiltonian trajectories

Hamiltonian graph

Examples:
x2
x6 x1
x3
x5
x4
∀(x, y ) ∈ X 2 , (x, y ) ∈
/ U; deg (x) + deg (y ) ≥ n =⇒ G is Hamiltonian?.
Hamiltonian chain (x6 , x1 , x2 , x3 , x4 , x5 ).

Abdelhamid Lebal Graphs theory October 8, 2024 75 / 87


Eulerian and Hamiltonian trajectories

Hamiltonian grpah

Some properties of a Hamiltonian graph


1 A graph with one of its vertices of degree 1 cannot be a Hamiltonian
graph;
2 The edges linked to a vertex of degree 2 in a Hamiltonian graph must
belong to the Hamiltonian cycle;
3 The complete graphs kn are Hamiltonian.

Abdelhamid Lebal Graphs theory October 8, 2024 76 / 87


Non-graphical representation of a graph (Graph modelisation)

Non-graphical representation of a graph

A number of representations exist to describe a graph. In


particular, they are not equivalent in terms of algorithm
efficiency. The main representations are the vertex-arcs
(or vertex-edges in the non-oriented case) incidence
matrix, the adjacency matrix and the adjacency list.

Abdelhamid Lebal Graphs theory October 8, 2024 77 / 87


Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the vertex-arc: Incidence


matrix

An oriented arc can be represented by a matrix M of order nxm (n = |X |


and m = |U|, called an incidence matrix, which can contain only the
values 0, 1 or −1. Each row of the matrix is associated with a vertex, and
each column with an arc. Thus, a box M[i, j] indicates the relationship
between a vertex and an arc.
1 M[i, j] = 0 means that the vertex and arc are not adjacent,
2 M[i, j] = 1 means that the vertex is the initial end of the arc,
3 M[i, j] = −1 means that the vertex is the terminal end of the arc.

Abdelhamid Lebal Graphs theory October 8, 2024 78 / 87


Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the vertex-arc: Incidence


matrix

Only 2m cells of the matrix are non-zero on m ∗ n cells.


This representation takes up a lot of memory space.
This matrix is not suitable for graphs with loops.
The number of values equal to +1 in a row gives the outer degree
d + (x) of the corresponding vertex x.
The number of values equal to −1 of a line gives the inner degree
d − (x) of the corresponding vertex x.
The sum of each column is equal to 0 (An arc has one origin and one
destination.)
A unoriented graph can be represented using only two values 0 and
1; 0: means that the vertex and the edge are not adjacent and 1:
means that the vertex is an end of the edge.

Abdelhamid Lebal Graphs theory October 8, 2024 79 / 87


Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the vertex-arc: Incidence


matrix
Example
Consider the graph shown in the following figure. The representation of
this graph is given by the following incidence matrix:
u4
b
u1 d
u1 u2 u3 u4 u5 u6 u7
a 1 1 0 0 0 0 0
a u3 u5 u6 b
c
-1
0
0
-1
-1
1
1
0
0
-1
0
0
0
-1
d 0 0 0 -1 1 1 0
e 0 0 0 0 0 -1 1

u2
e The incidence matrix of the graph G

c u7

Figure: A graph G
Abdelhamid Lebal Graphs theory October 8, 2024 80 / 87
Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the adjacency matrix:


vertex-vertex

A graph can be represented by an adjacency matrix of order nxn (n = |X ),


which can contain only the values 0, 1). Each row and column of the
matrix represents a vertex. Thus, a case M[i, j] indicates the relationship
between two vertices.
M[i, j] = 0 means that the two vertices are not connected by a
directed arc (i, j) ∈
/ U,
M[i, j] = 1 means that the two vertices are connected by a directed
arc (i, j) ∈ U.

Abdelhamid Lebal Graphs theory October 8, 2024 81 / 87


Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the adjacency matrix:


vertex-vertex

Example:
The preceding graph G will be represented by the following adjacency
matrix:
a b c d e
a 0 1 1 0 0
b 0 0 0 1 0
c 0 1 0 0 0
d 0 0 1 0 1
e 0 0 1 0 0
The adjacency matrix of the graph G

Abdelhamid Lebal Graphs theory October 8, 2024 82 / 87


Non-graphical representation of a graph (Graph modelisation)

Representation of the graph by the adjacency matrix:


vertex-vertex

The memory space used is : n2 (n: is the order of the graph |X | = n).
Only m cells of the matrix are null on n2 cells.
This representation is efficient in terms of memory space used when
the graph is sufficiently dense ((i.e.) when there are enough arcs).
It allows algorithms to be implemented relatively easily.
Two arcs with the same extremities cannot be represented with this
matrix (only simple graphs are represented).
For weighted graphs, replace 1) by the numerical value of the arc.

Abdelhamid Lebal Graphs theory October 8, 2024 83 / 87


Non-graphical representation of a graph (Graph modelisation)

Graph representation using Linked Lists

A graph can be represented by linked lists. We present one possibility here,


but many others may be suitable. First, a list of vertices is defined, and
each vertex is associated with a list of successor vertices.

Abdelhamid Lebal Graphs theory October 8, 2024 84 / 87


Non-graphical representation of a graph (Graph modelisation)

Graph representation using Linked Lists

Exemple:
The graph shown in the previous figure will be represented as follows.
a b c
b d
c b
d c e
e c

Abdelhamid Lebal Graphs theory October 8, 2024 85 / 87


Non-graphical representation of a graph (Graph modelisation)

Graph representation using Linked Lists

Notes:
This representation is much more efficient in
terms of memory occupied than the two
previous representations.
This structure is flexible. Adding and deleting
arcs or vertices is easier than with matrix
representations.

Abdelhamid Lebal Graphs theory October 8, 2024 86 / 87


Non-graphical representation of a graph (Graph modelisation)

Thank you!

Abdelhamid Lebal Graphs theory October 8, 2024 87 / 87

You might also like