Graoh Coloring
Graoh Coloring
Graoh Coloring
Mohammed Brahimi
Module distribution concerns raised by students
• Issues
• Multiple difficult modules scheduled in the same term
• Unbalanced distribution of workload between terms
• Goal
• Achieving a balanced load distribution between terms
• Approach:
• Represent modules as vertices
• High-load modules are linked by edges
• Assign colors to terms
• Ensure that difficult and high-load modules are not scheduled in the same term.
1 8
3 5 4
6 2
How to avoid challenging modules in the same term?
1 8
3 5 4
6 2
How to avoid challenging modules in the same term?
Term 1
1 6 8 2
3 7 5 4
Term 2
How to avoid challenging modules in the same term?
• Term 1 Term 1
• Data structure
• Linear Algebra 2 1 6 8 2
• Databases
• Analysis 3
• Term 2
• Architecture 1 7 5 4
3
• Mathematical Logic
• Complexity Term 2
• Probability and Statistics
Problem extension
a) 𝜒(𝐺) = 1 a) 𝜒(𝐺) = 3
• One color is sufficient • + 3 colors are required (presence of triangle)
• Absence of edges • It exists 3-coloring.
b) 𝜒(𝐺) = 2 b) 𝜒(𝐺) = 4
• +1 color is required (presence of edges) • +4 colors are required (presence of 𝑘4 )
• It exists 2-coloring. • It exists 4-coloring.
Subgraphs and the Chromatic Number
• Subgraphs play a crucial role in understanding the chromatic number of a
graph.
The subgraphs with the highest chromatic numbers can provide insights
into the chromatic number of the entire graph.
THEORME 1 (coloring bipartite graph)
A graph is bipartite if and only if it is 𝜒(𝐺)=2
• Intuition
• If the maximum vertex degree of a graph is low, we can determine a tight
upper bound for the chromatic number.
• However, for graphs with a high maximum degree, this theorem becomes less
effective or loses its usefulness.
Proof
• Proof by induction on the number of vertices 𝑛
• The statement is true for 𝐾1 the simple graph with one vertex
• 𝜒 𝐾1 = 1 and 𝑑 = 𝑂.
• We assume that 𝜒 𝐺 ≤ 𝑑 + 1 for all simple graphs 𝐻 with fewer than or equal 𝑛
vertices.
• Intuition
• The theorem does not works for 𝐾𝑛 and 𝐶2𝑘+1
• This theorem provides a stricter upper limit for the chromatic number.
Chromatic Number 𝜒(𝐺) and Bounds
• To determine the chromatic number 𝜒(𝐺) of a graph 𝐺, find an equal upper and
lower bound, which becomes the chromatic number 𝜒(𝐺).
• Intuition:
• For planar graphs, it is possible to color them using 6 colors or fewer.
• Even highly complex planar graphs can be colored using a maximum of 6
colors.
Proof
• Proof by induction on the number of vertices 𝑛
• We aim to prove the same for simple connected planar graphs with
𝑛 + 1 vertices.
Proof
• Let 𝐺 be a simple graph with 𝑛+1 vertices
• Intuition:
• For planar graphs, it is possible to color them using only 5 colors or fewer.
• Even highly complex planar graphs can be colored using a maximum of 5
colors.
Proof
• Proof by induction on the number of vertices 𝑛
• We aim to prove the same for simple connected planar graphs with
𝑛 + 1 vertices.
Proof
• Let 𝐺 be a simple graph with 𝑛+1 vertices
By switching one color to be the same as another color, we created an unassigned color.
Case 3: two colors are connected with a path
The planarity prevents the colors from forming a path due to existing path
Another proof of case 3
• The graph is contracted by removing two edges,
resulting in a planar graph with fewer than 𝑛
vertices.
The vertices of any simple connected planar graph can be colored with four (or
fewer) colours.
Intuition
• It states that only 4 colors are needed to color the regions oof any map.
• Conjectured in the 19th century.
• Proven in 1976 with computer assistance.
• It demonstrates the inherent simplicity within complex spatial configurations.
Greedy Algorithm for Vertex Colouring
• Start with graph G and a list of colors 1, 2, 3, ...
• Step 1:
• Label the vertices as a, b, c, ... in any manner.
• Step 2:
• Identify the uncolored vertex labeled with the earliest letter in the alphabet.
• Color this vertex with the first color from the list that is not used by any adjacent colored vertex.
• Repeat Step 2 until all vertices are colored.
• The number of colors used depends on the labeling chosen for the vertices in Step 1.
Example
Find a vertex colouring of the following
graph G.
• Step 1:
• Label the vertices as a, b, c, ... in any
manner.
• Step 2:
• Identify the uncolored vertex labeled with
the earliest letter in the alphabet.
• Color this vertex with the first color from
the list that is not used by any adjacent
colored vertex.
Example
Find a vertex colouring of the following
graph G.
• Step 1:
• Label the vertices as a, b, c, ... in any
manner.
• Step 2:
• Identify the uncolored vertex labeled with
the earliest letter in the alphabet.
• Color this vertex with the first color from
the list that is not used by any adjacent
colored vertex.
THEORME 6
For any graph G, there is a labelling of the vertices for which the greedy
algorithm yields a vertex colouring with 𝜒(𝐺) colours.
• Proof sketch
• Take any vertex coloring of G with 𝜒(𝐺) colors, denoted by 1, 2, 3, ...
• Sequentially label the vertices colored 1 as a, b, c, ...
• Label the vertices colored 2 starting from the next available label after the last label
used for color 1.
• Continue this labeling pattern for the vertices colored 3, 4, and so on.
• The greedy algorithm assigns colors 1, 2, 3, ... in order.
• As a result, only 𝜒(𝐺) colors are needed for this labeling.
Coloring Problems: Storing Chemicals
• Certain chemicals react violently when they are
in contact.
• The subsets {a, e}, {b, j}, {c}, {d, g}, representing the chemicals in the four
areas.
• In 1976, Appel and Haken provided a proof using nearly 2000 country
configurations and extensive computer analysis.
Even today, no "simple" proof has been discovered for the four-color
problem.
Coloring Problems: Map Colouring
• Objective:
• Assign colors to countries on a map,
ensuring adjacent countries have different
colors.
• Representation:
• Use the geometrical dual to represent
countries as vertices in a graph, with
edges connecting adjacent countries.
• Criteria:
• In each row, column, and
marked 3x3 square, the
numbers 1 to 9 should occur
exactly once.
• It enables the assignment of colors to vertices by representing entities as vertices and their
relationships as edges.
• The goal is to ensure adjacent vertices have different colors, minimizing conflicts.
• Efficient graph coloring algorithms are crucial for optimizing resource allocation and improving
system performance.
• Understanding graph coloring techniques helps solve complex optimization problems in various
domains.