16
1 Graph Coloring

1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

Embed Size (px)

Citation preview

Page 1: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

1

Graph Coloring

Page 2: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

2

Definitions

• A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors.

• The minimal number of colors required to color a graph is called the chromatic number and denoted .( )G

Page 3: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

3

The chromatic number of this graph is 3.

To verify that the chromatic number of a graph is k, we must show that the graph cannot be (k-1) colored.

3 is the minimum number of colors required to color this graph

Try coloring with 2 colors

It doesn’t work!

X

X

Page 4: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

4

Coloring a Wheel

( ) 3G

A graph of this form is called a wheel.

In wheels with an odd number of spokes, it’s not possible to alternate colors on the outside, so there must be 3 colors on the outside and then an additional color for the center vertex, thus the chromatic number is 4.

In wheels with an even number of “spokes”, you can alternate colors on the outside, then add an additional color for the center vertex. As is seen in this wheel with 6 spokes, a wheel with an even number of spokes can be 3-colored.

( ) 4G

Page 5: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

5

Example 1•State legislature many committees

•Meet one hour each week

•Schedule meetings that minimize number of hours

•Two committees cannot meet at the same time if they have overlapping membership

•10 committees

Vertices = CommitteesEdges = Overlap in membershipColors = Different meeting times

Page 6: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

6

To model this problem, we can use a vertex for each of the committees and an edge joining 2 vertices if they represent committees with overlapping membership. Then we can color the graph with each color representing a different meeting time.

Solution to Example 1

Page 7: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

7

The chromatic number of this graph is 4, thus 4 meeting times will suffice to schedule committee meetings

without conflict.

We can check this by trying to color the graph with n-1 colors, 3 colors, and it will not work.

Page 8: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

8

If we consider this part of the graph as a wheel with 6 spokes, we know it must be 3-

colored.

Thus, these two vertices can’t be red or blue, but they also cannot be the same color as each other. The final vertex then can be red or blue.

Page 9: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

9

Chromatic Polynomials

The chromatic polynomial of a graph G gives a formula for the number of ways to properly

color G with k colors.

What is the chromatic polynomial of a complete graph on five vertices?

( )kP G

5k

Example

Page 10: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

10

Solution

In a complete graph, each vertex must be a different color. Thus

since there are k possible choices for the first vertex to be colored; then that color cannot be used again, and so the second vertex has k-1 choices, and so on.

5( ) ( 1)( 2)( 3)( 4)kP k k k k k k

k

1k

2k

3k 4k

Page 11: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

11

Deletion Contraction Method

( ) ( ) ( \ )k k kP G P G e P G e

=

Delete an edge Combine

-

2k k-

Page 12: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

12

Deletion Contraction Cont.

Example:

Use deletion contraction method to find the chromatic polynomial of the following graph.

Page 13: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

13

=

-(

=

=

- -(

-

-

-- -( -4 3 3 2 3 2 2

3

( ) ( ( ))

( 1)

k k k k k k k k

k k

- )

)-( ))

Page 14: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

14

Exercise Set upA set of solar experiments is to be made at observatories. Each experiment begins on a given day of the year and ends on a given day (each experiment is repeated for several years). An observatory can perform only one experiment at a time.

The problem is, What is the minimum number of observatories required to perform a given set of experiments annually? Model this scheduling problem as a graph-coloring problem

Page 15: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

15

Problem• Vertices = Experiment

• Edges = Overlapping time interval

• Colors = Observatories needed

Experiment A Sept. 2 to Feb. 3

Experiment B Oct. 15 to April 10

Experiment C Nov 20 to Feb 17

Experiment D Jan. 23 to May 30

Experiment E April 4 to July 28

Experiment F April 30 to July 28

Experiment G June 24 to Sept. 30

Page 16: 1 Graph Coloring. 2 Definitions A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The

16

Solution

A

B

C

D

E

F

G

The chromatic number is 4, so there are 4 observatories needed.