Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Coloring.

Similar presentations


Presentation on theme: "Graph Coloring."— Presentation transcript:

1 Graph Coloring

2 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.

3 Origin of the problem

4 Origin of the problem

5 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.

6 University scheduling
Scheduling of exams so that as little time as possible is needed for the university to be open

7 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

8 Register allocation Given a set of available registers, find an assignment of variables to registers Vertices – variables, colors – registers.

9 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.

10 Terminology K-colorable Chromatic Number
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. Note: Each color defines an independent set of vertices ( vertices with no edges between them. ). Note: In order to verify that the chromatic number of a graph is a number k, we must also show that the graph can not be properly colored with k-1 colors. In other words the goal is to show that the (k-1)-coloring we might construct for the graph must force two adjacent vertices to have the same color.

11 Terminology K-chromatic graph Coloring
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 Look at previous example. Simply state that the since we found the chromatic number to be N the graph is N-chromatic.

12 Example For k-colorable: look at example and say that since it has a 6-coloring therefore it is 6-colorable. For chromatic number: Look at previous example. See if students can find a better coloring of G and state its chromatic number. This is a k-chromatic graph! The chromatic number is four. Therefore this a 4-Chromatic Graph

13 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.

14 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.

15 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.

16 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.

17 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.

18 Example Auxiliary Graph
B C A B C

19 Example Auxiliary Graph
B C D E B A E C D A B C D E A C B D E

20 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)

21 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

22 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


Download ppt "Graph Coloring."

Similar presentations


Ads by Google