Presentation on how to chat with PDF using ChatGPT code interpreter
Introduction to Graph and Graph Coloring
1. 1/48
Theoretical Section
Practical Section
INTRODUCTION TO GRAPH AND GRAPH
COLORING PROBLEM
Design Methods and Analysis of Algorithm
Darwish Ahmad Herati
St. Joseph’s College (Autonomous)
Computer Science Department
MSc (Computer Science)
SUPERVISOR
Prof. Ms. Mrinmoyee Bhattacharya
September 1, 2015
Darwish Ahmad Herati Design Methods and analysis of Algorithm
2. 2/48
Theoretical Section
Practical Section
Contents
1 Theoretical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
2 Practical Section
Examples
Implementation
Simulation Technologies
Darwish Ahmad Herati Design Methods and analysis of Algorithm
16. 16/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Terminologies of Graphs:
Spanning Tree of a Graph: A spanning tree of an
undirected graph is a subgraph that contains all the
vertices, and no cycles. If we add any edge to the spanning
tree, it forms a cycle, and the tree becomes a graph.
It is possible to define a spanning tree for directed graphs,
however the definition is rather complicated and will not be
discussed here.
Darwish Ahmad Herati Design Methods and analysis of Algorithm
20. 20/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Terminologies of Graphs:
Chromatic Number: The chromatic number of a graph G
is the smallest number k for which a k-coloring of the
vertices of G is possible.We will use the notation x(G) to
denote the chromatic number of G.
k-coloring: A k-coloring of a graph G is a coloring of the
vertices of G using k colors and satisfying the requirement
that adjacent vertices are colored with different colors.
Optimal Coloring: An optimal coloring of a graph G is a
coloring of the vertices of G using the fewest possible
number of colors.
Darwish Ahmad Herati Design Methods and analysis of Algorithm
21. 21/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Introduction to Graph Coloring
Graph coloring is one of the oldest concepts in the theory
of graphs,
A graph G = (V, E) consists two sets where one is the set
of vertices and another is the set of edges such that each
edges is associated with an un ordered pair of vertices and
graph coloring is one of the most useful models in graph
theory. Graph coloring is the way of coloring the vertices of
a graph with the minimum number of colors such that no
two adjacent vertices share the same color.
Darwish Ahmad Herati Design Methods and analysis of Algorithm
33. 33/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Greedy Algorithm for Graph Coloring:
Step 1. Assign the first color (c1) to the first vertex (v1).
Step 2. Vertex v2 is assigned color c1 if it is not adjacent
to v1; otherwise it gets assigned color c2.
Steps 3,4,...,n. Vertex v1 is assigned the first possible
color in the priority list of colors (i.e. the first color that has
not been assigned to one of the already colored neighbors
of vi ).
Darwish Ahmad Herati Design Methods and analysis of Algorithm
34. 34/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Analysis of Graph Coloring:
An Upper bound on the computing time of MCOLORING
can arrived by finding the number of internal nodes in the
state space tree is:
At each internal node, O(mn) time is spent by Next Value
to determine the children corresponding to legal coloring.
Hence the total time is bounded by:
Darwish Ahmad Herati Design Methods and analysis of Algorithm
36. 36/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Aircraft Scheduling:
Aircraft scheduling: Assume that we have k aircrafts,
and we have to assign them to n flights, where the ith flight
is during the time interval (ai, bi). Clearly, if two flights
overlap, then we cannot assign the same aircraft to both
flights. The vertices of the conflict graph correspond to the
flights, two vertices are connected if the corresponding
time intervals overlap. Therefore the conflict graph is an
interval graph, which can be colored optimally in
polynomial time.
Darwish Ahmad Herati Design Methods and analysis of Algorithm
37. 37/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Making Schedule or Time Table:
Making Schedule or Time Table: Suppose we want to
make am exam schedule for a university. We have list
different subjects and students enrolled in every subject.
Many subjects would have common students (of same
batch, some backlog students, etc). How do we schedule
the exam so that no two exams with a common student are
scheduled at same time? How many minimum time slots
are needed to schedule all exams? This problem can be
represented as a graph where every vertex is a subject
and an edge between two vertices mean there is a
common student. So this is a graph coloring problem
where minimum number of time slots is equal to the
chromatic number of the graph.
Darwish Ahmad Herati Design Methods and analysis of Algorithm
38. 38/48
Theoretical Section
Practical Section
Introduction
History
Definitions
Algorithm
Complexity
Applications
Mobile Radio Frequency Assignment:
Mobile Radio Frequency Assignment: When
frequencies are assigned to towers, frequencies assigned
to all towers at the same location must be different. How to
assign frequencies with this constraint? What is the
minimum number of frequencies needed? This problem is
also an instance of graph coloring problem where every
tower represents a vertex and an edge between two towers
represents that they are in range of each other.
Darwish Ahmad Herati Design Methods and analysis of Algorithm