Graph Coloring: Definition, Algorithm, and Application in Exam Scheduling, Slides of Data Structures and Algorithms

The concept of graph coloring, which is the assignment of colors to vertices in a graph such that no adjacent vertices have the same color. The document also includes an algorithm for finding the chromatic number, the least number of colors required for a proper coloring. An example application of graph coloring is shown in exam scheduling, where the goal is to avoid scheduling exams for students enrolled in conflicting courses on the same day.

Typology: Slides

2012/2013

Uploaded on 04/30/2013

dinpal
dinpal 🇮🇳

3.6

(12)

73 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Graph Coloring
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Graph Coloring: Definition, Algorithm, and Application in Exam Scheduling and more Slides Data Structures and Algorithms in PDF only on Docsity!

Graph Coloring

Definition

  • A coloring of a simple

graph is the

assignment of a color

to each vertex of the

graph so that no two

adjacent vertices are

assigned the same

color.

What is the chromatic number of this graph?

Algorithm

  • Assign color 1 to the vertex with highest degree.
  • Also assign color 1 to any vertex that is not connected to this vertex.
  • Assign color 2 to the vertex with the next highest degree that is not already colored.
  • Also assign color 2 to any vertex not connected to this vertex and that is not already colored.
  • If uncolored vertices remain, assign color 3 to the uncolored vertex with next highest degree and other uncolored, unconnected vertices.
  • Proceed in this manner until all vertices are colored.

Application

  • e.g. Scheduling Final Exams
  • Suppose you want to schedule final exams and,

being very considerate, you want to avoid having

a student do more than one exam a day. We shall

call the courses 1,2,3,4,5,6,7. In the table below a

star in entry ij means that course i and j have at

least one student in common so you can't have

them on the same day. What is the least number

of days you need to schedule all the exams? Show

how you would schedule the exams.

Day Exam 1 1, 5 2 2, 4 3 3, 6 4 7