You are on page 1of 52

Chapter 4: Vertex Colouring

Chapter s Objectives
Motivation to learn about colouring: 4 Colour Problem. Colouring and Chromatic Number. Results involving Chromatic Number. Greedy Colouring Algorithim. Brooks Theorem Applications

4 Colour Problem (Pg 95 96)


Given a map with divided regions, how many colours do we need so that: Adjacent regions do not share the same colour?

4 Colour Problem (Pg 95 96)


1 3 3 2 1 2

Proven that we need at most 4 colours. Transform this problem into a Graph problem.

4 Colour Problem (Pg 95 96)

Let each region be denoted by a vertex. Two vertices are adjacent to each other if they share common boundary (next to each other).

4 Colour Problem (Pg 95 96)

The problem is reduced to colouring the vertices such that no adjacent vertices share the same colour.

Colouring (Pg 96 99)


Extend this problem to general graphs. A k-colouring of graph G is a way to colour the vertices of G such that (i)At most k colours are used. (ii)Vertices that are adjacent are coloured using different colours. **k is a positive integer**

Colouring (Pg 96 99)


If G has a 3-colouring, then it has a 4colouring. (why?) In general, if G has a m-colouring, then it has an n-colouring where both m, n are positive integers and m < n. Note there might be more than one possible k-colouring for a graph.

Examples (Pg 98-99)


Read Example 4.2.1 Question 4.2.1: A 4 Colouring of G. 3 1 2 1 2

Examples (Pg 98-99)


Question 4.2.1: A 3 Colouring of G. 3 1 2 1 2

Examples (Pg 98-99)


Question 4.2.1: A 2 Colouring of G. 1 1 2 2 1

Examples (Pg 98-99)


G has no 1-colouring because there exists two vertices which are adjacent.

What type of graph contains a 1-colouring?

Examples (Pg 98-99)


Question 4.2.2: A 5-colouring of G 2 1 4 2 1 3

4 3 5

Examples (Pg 98-99)


Question 4.2.2: A 4-colouring of G 2 1 4 2 1 3

4 3 1

Examples (Pg 98-99)


Question 4.2.2: A 3-colouring of G 2 1 3 2 1 3

2 2 1

Examples (Pg 98-99)


No 2-colouring of G because there is a C3. Why? Read Example 4.2.2.

Chromatic Number (Pg 100)


Other than knowing a k-colouring of a graph G, we are also interested in finding out the minimum colours needed to colour a graph. The chromatic number, G (G ), is the minimum value of k such that G admits a k-colouring.

Chromatic Number (Pg 100)


Question 4.2.3: (a) 1 (b) 2 (c) 2 (d) 2 (e) 2 (f) 3 (g) 4 (h) 4

Chromatic Number (Pg 100)


Question 4.2.4: Largest value for G (G ) is n. When will a graph have G (G ) ! n ? Ans: When G is a complete graph.

Chromatic Number (Pg 100)


Question 4.2.5: G ( H ) e G (G ) Proof: Let G (G ) ! k . Since H is a subgraph of G, H is k-colourable. By the definition of G ( H, )

G ( H ) e k ! G (G )

Chromatic number of special graphs ( pg 102)


Result 1: Let G be a graph of order n. G (G ) ! 1 if and only if G is Nn (null graph) Proof (<=): Suppose G is Nn (null graph), then it is obvious that G (G ) ! 1 . (=>): Suppose G is not Nn (null graph), then there exists two vertices which are adjacent. Therefore G (G ) u 2 .

Chromatic number of special graphs ( pg 102)


Result 2: Let G be a graph of order n. G (G ) ! n if and only if G is Kn. Proof (<=): Suppose G is Kn , then it is obvious that G (G ) ! n . (=>): Suppose G is not Kn , then there exists two vertices which are not adjacent. Then we can colour the two vertices with same colour. Hence G (G ) e n  1 .

Chromatic number of special graphs ( pg 102)


Result 2: Example: let G be K4.

G (G ) ! 4

G (H ) ! 3 e 4 1

Chromatic number of bipartite graphs ( pg 102-103)


Let graph G be a cycle of order n, then
2, n even G (G ) ! 3, n odd

Chromatic number of bipartite graphs ( pg 102-103)


Let graph G be a graph. If G contains an odd cycle as subgraph, then G (G ) u 3 .

Result 3: Let G be a graph. G (G ) ! 2 if and only if G is non-empty bipartite.

Chromatic number of bipartite graphs ( pg 102-103)


Proof (<=) : Suppose G is a bipartite, then we label the two partites as X and Y. Since there exists at least a pair of adjacent vertices, G (G ) u 2 Also we can colour vertices in X with one colour, vertices in Y with another colour. Therefore G (G ) ! 2 .

Chromatic number of bipartite graphs ( pg 102-103)


Proof (=>) : Suppose G is not bipartite, then G contains an odd cycle as a subgraph. Hence G (G ) u 3 . Therefore taking the contrapositive of the statement (with the fact that G is nonempty), G (G ) ! 2 G is bipartite.
**Now we can use vertex colouring to test if a graph is bipartite**

Chromatic number of special graphs (pg 104-106)


Result 5: Let G be a graph and p be any positive integer. If G contains Kp as a subgraph then

G (G ) u p
This result is useful in 2 ways: (i) Get a lower bound for G (G ) (ii) We can determine if G contains Kp as a subgraph.

Example 4.3.6 (pg 105-106)


Read Examples 4.3.4, 4.3.5 Example 4.3.6: Since C3 is a subgraph of G, G (G ) u 3

Example 4.3.6 (pg 105-106)


Pick any C3 to colour first, try to keep the number of colours to 3.

Vertex w has no choice but to use 4th colour.

Example 4.3.6 (pg 105-106)


This is a 4-colouring of G.

G (G ) ! 4

Greedy Colouring Algorithim


Colouring method trial & error method. Algorithm to colour vertices in systematic manner. Attempt to approximate G (G ) .

Greedy Colouring Algorithim


Step 1: Label the vertices v1, v2, ..., vn. Step 2: Assign v1 with colour 1 . Step 3: Following the ordering of the vertices, assign each vertex with the minimum colour number such that it does not share the same colours as its neighbour.

Greedy Colouring Algorithim


Example 4.4.1: Step 1: Give the vertices a certain labelling.

Greedy Colouring Algorithim


Step 2: Assign v1 colour 1.

Greedy Colouring Algorithim


Step 3: Assign v2 colour 1 (since v2 and v1 are not adjacent.)

Greedy Colouring Algorithim


Assign v2 colour 2 (since v3 and v1 are adjacent.)

Greedy Colouring Algorithim


Assign v4 colour 3 3

Greedy Colouring Algorithim


Assign v5 colour 4 3

Greedy Colouring Algorithim


According to this particular labelling, we can conclude that

3 e G (G ) e 4
Can G (G ) ! 3?

Greedy Colouring Algorithim


Consider another set of labelling for the vertices

Greedy Colouring Algorithim


Following Greedy Algorithim, we assign the colours to each vertex in the following way: v1 1 v2 2 v3 3 v4 2 v5 3

Greedy Colouring Algorithim


We can conclude that G (G ) ! 3.

Number of colours used by Greedy Colouring Algorithm depends on how we label the vertices. Try Question 4.4.1: G (G ) ! 3.

Brooks Theorem (pg 119)


Greedy Colouring Algorithm gives us an upper bound for G (G ). Colour assigned to a vertex depends on its neighbours. Try our best to assign colours that were used by other vertices.

Brooks Theorem (pg 119)


Worst scenario: A vertex, v has neighbours assigned with all the colours being used.

v : no choice have to use a new colour.

Assign a new colour to v. So the number of colours used is d(v) + 1.

Brooks Theorem (pg 119)


For each vertex v, the largest colour we have to use is d(v) + 1. For a graph G, we will need at most max{ d(vi) + 1 | vi V(G) } = ((G )  1

@ G (G ) e ((G )  1

Applications : Example*
Pg 125: Aim: Find minimum no. of storage rooms CHEMICAL U V W X Y Z INCOMPATIBLE WITH: V, Y U,W,Z V,X,Z W,Y X,U V,W

Applications *
Determine the following: What should vertices represent? Which vertices should be adjacent? What does the colouring represent? What do we want to find?

Applications *
Determine the following: What should vertices represent? Chemicals Which vertices should be adjacent? Incompatible ones (why?) What does the colouring represent? Different rooms What do we want to find? Chromatic number of graph

Applications: Example *
U V W

G
Y

Application: Example *
G has a C3: G (G ) u 3

Brooks theorem: ((G ) ! 3 G (G ) e 4 Is G (G ) ! 3? Find a 3 colouring. Is G (G ) ! 4? Explain why a 3 colouring is impossible.

Applications: Example *
1 U 2 V 3 W

G
2 X Y 1 2 Z

@ G (G ) ! 3

Minimum we need 3 rooms

You might also like