1.12k likes | 2.6k Views
Graph Coloring. What is Graph Coloring?. Graph Coloring is an assignment of colors (or any distinct marks) to the vertices of a graph. Strictly speaking, a coloring is a proper coloring if no two adjacent vertices have the same color. Origin of the problem. Origin of the problem.
E N D
What is Graph Coloring? • Graph Coloring is an assignment of colors (or any distinct marks) to the vertices of a graph. Strictly speaking, a coloring is a proper coloring if no two adjacent vertices have the same color.
Why Graph Coloring? • Many problems can be formulated as a graph coloring problem including Time Tabling, Scheduling, Register Allocation, Channel Assignment • A lot of research has been done in this area so much is already known about the problem space.
University scheduling • Scheduling of exams so that as little time as possible is needed for the university to be open
Channel Assignment • Find a channel assignment to R radio stations such that no station has a conflict (there is a conflict if they are in vicinity) • Vertices – radio stations, edges – conflict, colors – available channels
Register allocation • Given a set of available registers, find an assignment of variables to registers • Vertices – variables, colors – registers.
Terminology • K-Coloring • A k-coloring of a graph G is a mapping of V(G) onto the integers 1..k such that adjacent vertices map into different integers. • A k-coloring partitions V(G) into k disjoint subsets such that vertices from different subsets have different colors.
Terminology • K-colorable • A graph G is k-colorable if it has a k-coloring. • Chromatic Number • The smallest integer k for which G is k-colorable is called the chromatic number of G.
Terminology • K-chromatic graph • A graph whose chromatic number is k is called a k-chromatic graph. • Coloring • A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors
Example The chromatic number is four. Therefore this a 4-Chromatic Graph
Example • Problem: A state legislature has a number of committees that meet each week for one hour. How can we schedule the committee meetings times such that the least amount of time is used but such that two committees with overlapping membership do not meet at the same time.
Example (cont) An vertex represents a meeting An edge represents a conflict between to meetings The chromatic number of this graph is four. Thus four hours suffice to schedule committee meetings without conflict.
Edge Coloring • Given a graph G=(V,E) how can we color the edges such that edges that share a vertex do not share a color.
Existing Results • Vizing's theorem • any graph with a maximum vertex degree of δ can be edge colored using at most δ + 1 colors. • Vertex degree: number of edges entering into the edge.
Line Graph • An Edge Coloring Problem can be formulated as a Vertex Coloring Problem. • Let L(G) be an auxiliary graph and G be the graphs which we are trying to color. L(G) contains a vertex for every edge in G. There is an edge in L(G) drawn between two vertices if their associated edges in G share a vertex.
A A C B B C Example Auxiliary Graph
A B E C D A B B E A E C D C D Example Auxiliary Graph B A E C D
Approximate Colouring Algorithm • Sort the verices so that degree(v(i))>=degree(v(i+1)) • Colour v(0) • For i=1 to n colour v(i) so that there is no clash • Complexity O(n2)
Maximal independent set algorithm • Problem: What is the largest subset of vertices of V such that no pair of vertices defines an edge of E. • Algorithm: • Repeat until there is no vertex • Begin • Find the maximal independent set (MIS) • Reduce the graph by MIS • End
Find the MIS • Repet until there is no vertex • Begin • Select the vertex with the maximal degree • Include it in MIS and reduce the graph by all the adjacent nodes • End