0% found this document useful (0 votes)
41 views44 pages

Aph Theory - Fundamental Concepts

Graph

Uploaded by

minec4492
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)
41 views44 pages

Aph Theory - Fundamental Concepts

Graph

Uploaded by

minec4492
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/ 44

Graph Theory Course

Licence L2

Z.GUELLIL
Chapter 1
Fundamental Concepts

Z.GUELLIL
History (1/3)
• Euler (1735) mathematical curiosity: Start from one bank, cross the seven bridges of the city of
KÖNESBERG (Germany) once and only once and return to the starting point.

• The Irish mathematician Sir William Hamilton (1805-1865) worked on the travelling salesman
problem.
• Francis Guthrie (1852), a South African mathematician, stated the four-colour problem during a
discussion with his brother, who asked his teacher Auguste De Morgan if any map could be
coloured with four colours so that neighbouring countries had different colours.

3
History (2/3)
• Julius Petersen at the end of the 19th century was interested in spanning
subgraphs, that is, graphs containing all the vertices but only some of the
edges. We saw the emergence of graph factorisation problems in this way. A
spanning subgraph is called a k-factor if each of its vertices has k edges, and
the first theorems were given.
• In the mid-19th century, the British mathematician Arthur Cayley became
interested in trees, a special type of graph that does not have a cycle, i.e. in
which it is impossible to return to a starting point without going in the
opposite direction.

Graph Theory 4
History (3/3)
• But it was only with the Second World War that the practice was organized
for the first time and acquired its name.
• In 1940, Patrick Blackett was called by the British general staff to lead the first
operational research team to solve certain problems such as the optimal
location of surveillance radars.
• From 1946 onwards, TG experienced intense development thanks to
researchers motivated by the resolution of concrete problems.
• Among them, Esdger Djikstra (1959) for the routing problem, Ford and
Fulkerson (1956) for the maximum flow problem .
• Bernard Roy (1958) developed the MPM method for the scheduling problem.

Graph Theory 5
Graph Theory
• Graph theory is a powerful set of tools for modeling and solving real-world
problems.
• Definition :
• A Graph is a collection of vertices (nodes) and edges (links) connecting pairs of vertices.
• A graph is used to describe a set of objects and their relationships, that is to say the links
(edges) between the objects ( nodes /vertices).
• A graph ( G ), denoted as ( G = (X, U) ), is defined by:
• A finite set of vertices ( X ): The fundamental units or points in the graph.
• A finite set of edges/arcs ( U ): Each edge/arc connects a pair of vertices in ( X ).

Give me some examples….

Graph Theory 6
Undirected graph
• An undirected graph G is a pair (V, E).
• V is a (finite) set of objects. The elements of V are called the vertices of the graph.
• E is a subset of VxV . The elements of E are called the edges of the graph.
• An edge "e" of the graph is a pair e=(x , y) = (y, x) of vertices.
• Vertices x and y are the endpoints of the edge.

𝐸 ={……}
𝑉 ={……}
I.2. Degree of a vertex/graph
• Two vertices x and y are adjacent if there exists the edge ( x,y ) in E . The
vertices x and y are then said to be neighbors
• An edge is incident to a vertex x if x is one of its endpoints.
• The degree of a vertex x of G is the number of edges incident to x . It is
denoted d (x) .
• For a simple graph the degree of x also corresponds to the number of vertices
adjacent to x .
• For a simple graph of order n, the degree of a vertex is an integer between 0
and n-1
• A vertex of degree 0 is said to be isolated : it is not connected to any other
vertex.
Example
Vertex Degree
a 1
b 2
c
d 5
e
f
g
h
Degree of a vertex/graph
• Property 1: The sum of the degrees of the vertices of a graph is equal
to 2 times its number of edges. σ𝑥∈𝑉 𝑑(𝑥) = 2 ∗ ||𝐸||

• Property 2: The number of odd-degree vertices in a graph is even.


• The degree of a graph is the maximum degree of all its vertices.
• A graph whose vertices all have the same degree is said to be regular .
• If the common degree is k , then the graph is said to be k-regular.
Subgraph and partial graph
• To characterize the structure of a graph in a less local way, it is
possible to search for remarkable parts of the graph, by restricting
either :
• The set of vertices (subgraph), or
• The set of edges (partial graph).
Subgraph
• Definition : A subgraph is formed from a subset of a graph's vertices and
edges.
• Formally : For a graph G = (V, E)
A subgraph of G is a graph H=(W, E(W) ) such that W is a subset of V , and
E(W) are the edges induced by E on W , that is to say the edges of E whose 2
extremities are vertices of W . ,
E(W)= {(X,Y) ∈ E /, X,Y ∈ W}
• A subgraph of G consists of considering only a part of the vertices of V and
the links induced by E.
• For example, if G represents the daily air connections between the main cities
of the world, a possible subgraph is to restrict itself to the daily connections
between the main European cities.
Partial graph
• A partial graph of G consists of considering only a part of the edges of E.
• Retains all the vertices of the original graph while having a reduced number
of edges.
• The vertex set remains identical to that of the original graph,
• The edge set is a subset, meaning some connections between the vertices
may be missing.
• A partial graph of G =(V, E) is a graph I=(V,F) such that F is a subset of E.
• Example : a possible partial graph is to consider only the daily connections
of less than 3 hours between the main cities of the world.
Complete graph
• Definition: A complete graph is a type of graph in which every pair of
distinct vertices is connected by an edge. In other words, there is an
edge between every two vertices,
• Ensuring that each vertex has a direct connection to every other
vertex in the graph.
• In a complete graph of order n is denoted Kn :
• Each vertex is of degree n-1 .
• The number of edges in a complete graph is: n*(n-1) / 2
Clique
• A clique in a graph is a subset of vertices where each pair of vertices is
directly connected by an edge, forming a complete subgraph.
• It is a maximal complete subgraph:
• Meaning that no more vertices can be added to the clique without losing the
property of complete connectivity.
• In other words, adding more vertices would break the condition that every two
vertices in the clique are adjacent.
• The size of a clique is the number of vertices it contains.
• Example: In a social network, a clique could represent a group of people
who all know each other directly.
Stable (Independent Set)
• A stable or independent set is a subset of vertices such that no two
vertices in the subset are adjacent (i.e., there are no edges between
any pair of vertices in the set). This is the opposite of a clique.
• A stable is a subgraph without edges.
• Applications: Independent sets are relevant in scheduling problems,
where tasks (represented by vertices) that conflict (connected by
edges) cannot be scheduled simultaneously.
• Example : In a map coloring problem, vertices of the same color form
an independent set, as no two adjacent regions can have the same
color.
Example
• 2 cliques of order 3 defined by the sets of vertices { d, g, h } and { d, e, h }
• 4 stable sets of order 4 defined by the sets of vertices { a, b, e, g } and { a, b, h, f } {
a, c, h, f } and { a, b, e, f }
Chain 1/4

• Definition: A chain in G is a sequence having as its elements alternately


vertices and edges, starting and ending with a vertex, and such that each
edge is framed by its endpoints.
• We will say that the chain connects the first vertex of the sequence to
the last vertex.
• The chain has the length of the number of edges in the chain.
Chain (Example) 2/4
• The following graph contains among others
the chains ( v 1, e 1, v 2, e 2, v 3, e 5, v 5) and
( v 4, e 4, v 3, e 2, v 2, e 1, v 1).

• A string is not changed by reversing the order


of the elements in the corresponding
sequence. Thus, the strings ( v 1, e 3, v 3, e 4,
v 4) and ( v 4, e 4, v 3, e 3, v 1) are identical.
Chain (Definition) 3/4
• The distance between two vertices is called the length of the smallest chain
connecting them.
• The diameter of a graph is called the longest distance between two vertices.
• A chain is elementary if each vertex appears in it at most once.
Property: In a graph G of order n
• Any elementary chain is of length at most n- 1
• The number of elementary chains in the graph is finite.
Chain (Definition) 4/4

• A chain is simple if each edge appears at most once.


In the previous graph, (v1, e1, v2, e2, v3) is a simple, elementary chain.
• A chain whose starting and ending vertices are the same is called a closed
chain.
• In the previous graph, (v4, e4, v3, e5, v5, e5, v3, e4, v4) is a closed chain.
Cycle
• A simple closed chain is called a cycle .
In the following graph, the chain (v1, e1, v2, e2, v3, e3, v1) is a cycle.
Connectivity of a graph
• Definition: A graph is connected if and only if there exists a chain
between every pair of vertices.
• If the graph G is not connected, then it appears as a set of connected
graphs.
• Each of these graphs is a particular subgraph of G , called a connected
component .
• A connected Graph has one connected component.
Connectivity of a graph
Definition: A connected component of a graph G is a maximally connected subgraph
G'=(V',E') : it is not possible to add other vertices to V' while preserving the connectivity of
the subgraph.
• A graph with only one connected component is simply a connected graph.
• An isolated vertex (of degree 0) always constitutes a connected component on its own.
• The relation on the vertices "there exists a chain between ..." is an equivalence relation
(reflexive, symmetric and transitive). The connected components of a graph correspond
to the equivalence classes of this relation.
o All vertices within the same connected component are related to each other by the
existence of paths (chains), forming a single equivalence class.
Property: A connected graph G of order n has at least n- 1 edges.
Acyclic graph
A graph in which there are no cycles is said to be acyclic .
• Property 1: If in a graph G every vertex is of degree greater than or equal
to 2, then G has at least one cycle.
oThis simple property implies that a graph without a cycle has at least
one vertex of degree 0 or 1.
• Property 2: An acyclic graph G with n vertices has at most n- 1 edges.
Acyclic graph
• Definition: For a graph G having m edges, n vertices and p connected
components, we define: n( G ) = m − n + p.
• n( G ) is called the cyclomatic number .
• We have an ( G ) > 0 for any graph G .
• n( G ) = 0 if and only if G is cycle-free. C

C D

• m: 4 D
• m: 4 A

•n:3 A •n:5 B

• p : 1 (the graph is connected) B


• p :1 (the graph is connected)
• n( G ) = 3 − 4 + 1 = 0. • n( G ) = 4 − 5 + 1= 2 >0.
• This graph is cycle-free (Acyclic graph)
Directed graph
• A finite digraph G = ( V , E ) is defined by :
• The finite set V = { v1 , v2 , . . . , vn } whose elements are called vertices, and
• The finite set E = { e1 , e2 , . . . , em } whose elements are called arcs .
• An arc “e” of the set E is defined by an ordered pair of vertices.
• When e = ( u , v ), we say that the arc “e” goes from “u” to “v” .
o u is the initial vertex (source or tail) of “e” , and
o v is the final vertex (target or head) of “e”.
Degree of a vertex of a digraph
• In a digraph G = (V, E), for any vertex v ∈ V:
• The in-degree of v, denoted as d⁻(v) or indeg(v), is the number of arcs
coming into v, that is, the number of arcs having v as their final vertex.
o Formally: d⁻(v) = {u ∈ V : (u, v) ∈ E}
• The out-degree of v, denoted as d⁺(v) or outdeg(v), is the number of arcs
going out from v, that is, the number of arcs having v as their initial vertex.
o Formally: d⁺(v) = {u ∈ V : (v, u) ∈ E}
• The total degree of a vertex v is the sum of its in-degree and out-degree.
o d(v) = d⁻(v) + d⁺(v)
Paths and circuits 1/2
• A path leading from vertex a to vertex b is a sequence having as its elements
alternately vertices and arcs, starting and ending with a vertex,
• Every path has at least one arc.
• The distance between two vertices of a digraph is called the length of the
shortest path connecting them.
• If there is no path between vertices x and y , we set d ( x , y ) = ∞.
• A circuit is a directed path that starts and ends at the same vertex, where no
arc is used more than once.
• A circuit with no repeated vertices, except for the starting and ending vertex,
is called a simple circuit.
Paths and circuits 2/2
• example the path ( v 3, e 2, v 2, e 1, v 1).
• d ( v5 , v4 ) = 2, d ( v4 , v5 ) = ∞, d ( v3 , v1 ) = 1.
• The above digraph does not contain a circuit.
Strongly connected digraph
• A digraph is strongly connected , if every ordered pair ( a , b ) of
distinct vertices in the graph is connected by at least one path.
• In other words, every vertex is reachable from every other vertex by
at least one path.
• A strongly connected component is any maximal strongly connected
induced subgraph (maximal means that there is no larger connected
induced subgraph containing the vertices of the component).
Digraphs without circuit
Rank calculation algorithm
• Given: digraph G = ( V , E ) without circuit.
• Theorem : The digraph G is
circuitless if and only if we can • Result: rank r ( v ) of each vertex v Î V of the
assign a number r (v), digraph G .
• The rank of v , at each vertex v • Begin
such that for any arc ( u , v ) of G • r := 0
we have r ( u ) < r ( v ). • X := V
• R : the set of vertices of X with no predecessor in X
• While X is not empty do
• r ( v ) := r for all vertex v Î R
• X := X − R
• R : the set of vertices of X with no predecessor in X
• r := r +1
• End as long as
• END
Graph Representation 1/3
• Incidence matrix ( node -arc): This representation stores the graph as a matrix
of size n x m: one row for each node, and one column for each arc.
• The column corresponding to the arc ( i, j ) we put a “+1” in the row
corresponding to node i and “-1” in the rank corresponding to node j.

(1, 2) (1, 3) (2, 4) (3, 2) (4, 3) (4, 5) (5, 3) (5, 4)


1 1 1
2 -1 0
3 0 -1
4 0 0
5 0 0
Graph Representation 2/3
• Adjacency matrix ( node-node ): It is an n*n matrix. Its ijth element is equal to 1
if the arc ( i, j ) ∈ A and equal to 0 otherwise.
• If we want to store the costs of the arcs and their capacities as well as the
topology of the graph, we can use two matrices of size n*n .

1 2 3 4 5
1 0 1 1 0 0
2 -1 0 -1 1 0
3 -1 1 0 -1 -1
4 0 -1 1 0 1
5 0 0 1 1 0
Graph Representation 3/3
Adjacency Lists: The arc adjacency list A(i) of a node “I” is the set of arcs
emanating from this node i.e. the list of arcs ( i, j ) ∈ A. Similarly, the node
adjacency list of a node “i” is the set of nodes “j” such that ( i, j ) ∈ A.
Representation of undirected graphs
• An arc ( i, j ) belongs to an undirected graph, both pairs ( i, j ) and ( j, i ) must
be included in the representation.
• In the incidence matrix, the column corresponding to arc ( i, j ) will have +1 in
both rows “i” and “j”.
• The adjacency matrix will have +1 in position hij and hji for each arc (i, j ) ∈ A.
• And since the matrix will be symmetrical, we can store its half.
• When an update is made for one arc, we also need to update the other arc as
well.
Special graphs : Eulerian graph
• A Eulerian cycle of a graph G is a cycle passing once and only once through each of the
edges of G .
• A graph is said to be Eulerian if it has an Eulerian cycle.
• More simply, we can say that a graph is Eulerian if it is possible to draw the graph
without lifting the pencil and without passing twice over the same edge.
• Theorem 1 (Euler, 1736) : Graph G(V, E) is Eulerian if and only if G is connected (except
for possible isolated vertices) and the degree of every vertex in G is even.
• Claim 2 G has an Eulerian path iff it is connected and only two of its vertices have odd
degrees.
• Claim 3 Let G(V, E) be a directed graph. G has an Eulerian circuit iff :
o G is connected
o ∀v ∈ V , indegree(v) = outdegree(v)
Special graph: Hamiltonians graph
• We call Hamiltonian cycle of a graph G a cycle passing once and only once
through each of the vertices of G .
• A graph is said to be Hamiltonian if it has a Hamiltonian cycle .
• Properties
• a graph with a vertex of degree 1 cannot be Hamiltonian
• if a vertex in a graph is of degree 2, then the two edges incident to this vertex must be
part of the Hamiltonian cycle
• complete graphs are Hamiltonian .
• Diracs theorem : Given G = (V, E), |V | = n, if the minimum degree(G) ≥ n/2
then G is Hamiltonian.
Special graph: Hamiltonians graph
• Theorem Let
G be a simple graph of order n ≥ 3. If for any pair { x , y } of non-adjacent
vertices, we have d ( x ) + d ( y ) ≥ n , then G is Hamiltonian .
• Corollary Let : G be a simple graph of order n ≥ 3. If for every vertex x of G ,
we have d ( x ) ≥ n/2 , then G is Hamiltonian.
• Indeed, such a graph verifies the conditions of the previous theorem,
because if x and y are not adjacent, we have: d ( x ) + d ( y ) ≥ n/2 + n/2 = n
Special graphs: Planar graphs
• A graph is said to be planar if it can be drawn in the plane such that
its edges do not intersect.
• Definition In a topological planar graph, the areas bounded by edges
that surround them are called "faces".
Special graphs: Planar graphs
Let S be the number of vertices of a topological planar
graph, A its number of edges and F its number of faces.
• Property
1. In any connected topological planar graph, we have
F = A – S + 2.
2. Any connected topological planar graph with S
vertices and whose smallest face has P edges
contains at most (S-2) p/(p-2) edges.
3. Any connected planar graph with S vertices contains
at most 3(S-2) edges.
Special graphs: Planar graphs
• Example:
The graph below cannot be planar since 3(S-2) is 9 while
A is 10.

• Property 4 ( Manori )
Any connected planar graph with S vertices and no
triangles contains at most 2(S-2) edges.
Bipartite graphs
• A bipartite graph is a graph whose set of vertices can be partitioned
into two parts X and Y such that any edge has one endpoint in X and
the other in Y .
• Application example
• a set X ={x1, x2,..., xn } of candidates
• a set Y={y1, y2,..., ym } of jobs
Bipartite graphs
Definition A proper coloring of G is a function associating a color to any vertex
of G , such that no two adjacent vertices have the same color.
• A graph G is k -colorable if there exists a proper coloring of G with k colors.
• A graph is bipartite if it is 2-colorable.
• A graph is bipartite if and only if it does not contain any cycles of odd length .

You might also like