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. NP-Complete. Clique problem. How many colors are there in Turkey’s map?

3 Origin of the problem

4 Proper 6-coloring Optimal 4-coloring

5 A graph is 2-colorable iff it is bipartite

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

7

8

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

10 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

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

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

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

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

15 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

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

17 Example (cont) A 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.

18 Applications: Sudoku Each cell is a vertex
Each integer label is a “color” A vertex is adjacent to another vertex if one of the following hold: Same row Same column Same 3x3 grid Vertex-coloring solves Sudoku

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

20 Existing Results Vizing's theorem
Vertex degree: number of edges entering into the edge. Any graph with a maximum vertex degree of δ (delta) can be edge colored using at most δ + 1 colors.

21 Example Auxiliary 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. Example Auxiliary Graph A B C A B C

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

23 Approximate Colouring Algorithm
Sort the vertices 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 is O(n2)


Download ppt "Graph Coloring."

Similar presentations


Ads by Google