0% found this document useful (0 votes)
28 views26 pages

Chapitre 2 - Modeling by Graphs

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)
28 views26 pages

Chapitre 2 - Modeling by Graphs

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/ 26

1

Chapter 2: Graph-Based Modeling


2

Introduction
Graphs are used to model various situations, enabling easier manipulation of
objects and their relationships through a natural graphical representation. The
set of mathematical tools developed in graph theory allows for the
demonstration of properties, the derivation of solution methods, algorithms,
and more. For example:

 What is the shortest path (in terms of distance or time) to travel from one
city to another?
 How can we minimize the total length of connections in a circuit?
 Is it possible to make a street one-way without making city travel
impossible?
 How can we organize a scheduling system?
3

Example:
The representation of a communication network, where vertices represent the
centers or nodes of the network and edges represent the links.

Using this "model" of the network, we can ask various questions:

 Does this network allow all nodes to communicate with each other, i.e.,
can one go from any given node to any other, either directly or via
intermediate nodes?
 Given two nodes, find the paths connecting them, particularly the
"shortest path" in terms of the number of intermediate links.
4

Principle of Graph-Based Modeling


 Model the problem structure using a graph: The first step is to
understand the goal of modeling to represent the problem with a graph,
selecting the objects represented by vertices and the relationships
represented by edges or arcs.
 Define an appropriate graph model: Formulate the problem in graph
terms so that the proposed model aids in solving it.
 Solve the problem: First, identify the issue in terms of graph theory
concepts, vocabulary, and notions.
5

Example of Modeling a Situation Using a Graph


If we consider the website example consisting of five pages (Example 1.1
from Chapter 1) and try to model this situation with a graph, we get a directed
graph where the vertices are pages, and an arc represents a link from one
page to another with a single click.

Figure 1: Graph modeling pages and their


relationships.
6

Example of Using a Graph to Solve a Problem


A football league contains nine clubs. When organizing a championship and
for time reasons, it’s decided that each club will only play half of the possible
matches.
7

1) Identifying the teams each team should face in this championship:


To answer this question, we first analyze and understand the problem and
the desired solution. First, identify the objects to be considered as vertices,
and then define the relationship between them. In this example, it’s intuitive
that the vertices represent the nine teams. The relationship, in this case, is
playing a match, which is symmetric (if team x plays with team y, then y
plays with x). Each team must play half the matches, meaning each team
will have four matches (four edges).

Figure 2.2: Graph modeling the teams and the


matches played between them.
8

Formally
Let G=(V,E) where the set of vertices V={1,2,3,4,5,6,7,8,9} represents the
different teams, and the set of edges
E={12,13,18,19,23,24,28,34,39,45,46,56,57,59,67,68,78,79} represents the
different matches.
The order of graph G is G =9, representing the number of teams (vertices).
The size of G is G =18, which is the number of matches (edges). To identify
which teams each team must face in the championship, we simply look for
the neighborhood of each vertex.
 N(1)={2,3,8,9}, N(2)={1,3,4,8}, N(3)={1,2,4,9}, N(4)={2,3,5,6},
N(5)={4,6,7,9}, N(6)={4,5,7,8}, N(7)={5,6,8,9}, N(8)={1,2,6,7},
N(9)={1,3,5,7},
9

x V, dG(x)=4  making G a 4-regular graph



10

2) The first match in the championship is between team 1 and team 8. Using
the graph, we can determine which matches can take place on the same day,
given that each team plays only one match per day.

Figure 3: Matches that can take place on the


first day of the championship.
11

3) Example Variation: If each team must play only three matches, can
such a situation be modeled with a graph?

To calculate the size of the graph (number of edges), we refer to the


Handshake Lemma (Theorem 1.1). Here, each vertex has a degree of 3,
making G a 3-regular graph. Thus, the sum of the degrees of the vertices of
GGG is calculated as follows:

d
9

i 1
G (x i )
= 
i 1
3 = 3  9 = 27

According to the Handshake Lemma, the sum of the degrees of a graph must
be an even number (2m), which contradicts the above result (27 is an odd
number).
Therefore, such a situation cannot be modeled using a graph.
12

Common Application Areas for Graphs


 Game theory
 Transportation network problems (road, water, electricity)
 Network problems (computer, electrical, etc.)
 Social networks
 Web graph
 etc.
13

Some Common Problems in Graph Theory


The concepts studied in the first chapter play a fundamental role in a number
of standard problems in graph theory. In the following, we will present a few
of them as examples.
14

Problem 1 (Map Coloring)

What is the minimum number of colors required to color each Wilaya of the
map of Algeria (Figure 4) in such a way that no two neighboring Wilayas
share the same color?

(a) Map of Algeria without Coloring


(b) Colored Map of Algeria
Figure 4 : Map of the Administrative Division of Algeria
15

Solution to the Problem


To solve this problem, we need to transform the map of Algeria into a graph.
Each Wilaya represents a vertex of the graph, and Wilayas that share a
common border are connected by an edge.
Assigning a color to each Wilaya consists of assigning colors to the vertices
in such a way that no two adjacent vertices (i.e., Wilayas sharing a border)
have the same color. To solve this problem, we will apply graph coloring
techniques.
16

1. Vertex Coloring of a Graph


A coloring (or coloring assignment) of a graph consists of assigning
colors to the vertices such that no two adjacent vertices share the
same color. If the graph is colored using k colors, it is said that the
graph is k-colorable, or that the graph has a k-coloring.
A graph of order n (i.e., a graph with n vertices) can always be colored
using n colors. However, the goal is to use the minimum number of
colors. The minimum number of colors required to color a graph is
called the chromatic number of the graph.
4o mini
17

2. The chromatic number


The chromatic number of a graph GGG, denoted χ(G), is the minimum
number of colors required to color all the vertices of the graph GGG such that
no two adjacent vertices share the same color. This is equivalent to finding
the smallest number of colors that allows for a proper coloring of the graph. It
can also be described as a partition of the vertex set into a minimum number
of independent sets (or stable sets), since vertices of the same color are
not adjacent, making each monochromatic set an independent set.
18

Example

(a) Graph G colored with 5 colors (a) Graph G colored with 3 colors

Figure 5 : Coloriage du graphe G.

 The chromatic number of the graph G is χ(G) = 3.


19

3. Edge Coloring of a Graph


Similarly, edge coloring of a graph G involves assigning colors to the
edges of the graph such that no two adjacent edges share the same
color, using the minimum number of colors possible. We say that G is
k-edge-colorable or that there exists a k-edge coloring of the
graph. The minimum number of colors required for such a coloring is
called the chromatic index of the graph G.
20

4. The chromatic index

The chromatic index χ′(G) of a graph G is the minimum number of


colors needed to color the edges such that no two adjacent edges
have the same color. It is also equivalent to the minimum cardinality
of a partition of the edge set into matchings.
21

Remarks
The structure of a graph imposes certain constraints on its chromatic number:

 The complete graph Kn of order n is n-colorable.


 Any planar graph can be colored with at most four colors (by the Four
Color Theorem).
 Vertices within the same clique must be colored with different colors.
 Vertices within the same independent set (stable set) can all be
colored with the same color.
 If a coloring with k colors is achieved, then χ(G)≤k.
 If G contains a clique of size k, then χ(G)≥k.
22

6. Other Applications of Graph Coloring


Beyond map coloring, graph coloring has numerous applications in various
fields:

 Scheduling: Assigning time slots for tasks or events.


 Exam Organization: Scheduling exams in such a way that no two exams
for students in overlapping groups occur at the same time.
 Conflict Resolution: Addressing situations of incompatibility, such as
"conflicting moods."
 Resource Allocation: Managing the supply to construction sites through
different routes to prevent overlaps or conflicts.
The following example illustrates an application of graph coloring...
23

Transportation of Chemical Products


(A variation of incompatibility problems)
Figure 6 illustrates a graph G that models the incompatibilities between six chemical
products. In this graph, two vertices are adjacent if the corresponding chemical
products are incompatible, meaning that their interaction could lead to catastrophic
consequences. The goal is to transport these chemical products in wagons such that
no two incompatible products are placed in the same wagon. To determine the
minimum number of wagons required for transportation, graph coloring is applied
to solve this problem.
24

Figure 6 : Incompatibility Graph of Chemical Products

To determine the minimum number of wagons required for transporting


different chemical products, we must find an arrangement where no two
incompatible products are placed in the same wagon.
25

More formally, we aim to find a minimal partition of the vertex set into
independent sets (i.e., a minimal vertex coloring), which leads us to
determine the chromatic number of the graph.

We have the independent set S1={P1,P3,P5}, which can be colored the same
color, say red.

Similarly, we have the independent set S2={P2,P4,P6} which can be colored


the same color, say green.

Therefore, we have achieved a minimal coloring of the graph with a chromatic


number χ(G)=2.
26

Figure 7: The graph of chemical incompatibilities with a


minimal coloring of the chemicals.

The minimum number of wagons required to transport the different products


in this case is 2 wagons, such that the first wagon transports the products:
P1, P3, and P5, while the second wagon transports the products: P2, P4, and
P6.

You might also like