Chapter01 GraphsTheory
Chapter01 GraphsTheory
Abdelhamid Lebal
October 8, 2024
Abdelhamid Lebal
October 8, 2024
1 Introduction
3 Definitions
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
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
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
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
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
Definitions
Definitions
a e
3 5 10 20
2.5 30
b c d f
Figure: Example of weighted graphs
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
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:
Definitions
Note:
Definitions
Definitions
Attention!
Do not confuse the notions of order and degree !!!
Definitions
Example:
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
Definitions
V1 V2 V1 V2
c c
a a
d d
b b
e e
Figure: complete bipartite graph
Figure: Bipartite graph
K2,3
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)}.
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.
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:
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 }.
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
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 ).
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 ).
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.
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).
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
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).
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.
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)
Definitions
e
b d
a
c f
Figure: Path is neither simple nor elementary(a, b, f , d, e, b, c)
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
Definitions
20-Circuit
Note:
Definitions
21-Acyclic graph
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.
Connexity
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
x1 x1
x5 x2
x3 x3
Figure: No-connected graph Figure: Connected graphs
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 ).
D A C
Figure: Schema of the city of Figure: Graph representing the
Konigsberg city of Konigsberg
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)
a
e f
b d c
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 }
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
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).
a
e
b
f
d
c
Figure: Example of an Eulerian path
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.
Hamiltonian graph
Hamiltonian graph
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.
Hamiltonian graph
Hamiltonian graph
Examples:
x2
x1 x1 x5
x5 x2
x3 x4
x4 x3
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.
Hamiltonian graph
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 ).
Hamiltonian grpah
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)
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
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.
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
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.
Thank you!