computation

Definition

3-Colouring Problem

The 3-colouring problem is a decision problem.

Instance: an undirected graph

Question: Does there exist a colouring of the vertices of with three colours such that adjacent vertices always have different colours?

NP-Membership

The 3-colouring problem is in NP. There are several equivalent ways to show this.

Let

Here, the certificate is a colouring function .

Why this proves NP-membership

A proposed colouring has size polynomial in , and we can verify it in polynomial time by checking for every edge that .

Therefore, the 3-colouring problem has a polynomial-time verifier, so it belongs to NP.

A nondeterministic algorithm may guess one of three colours for each vertex and then check in polynomial time whether the resulting assignment is a valid 3-colouring.

Reductions

Reduction to SAT

Let be an instance of the 3-colouring problem with

For each vertex and each colour , introduce a propositional variable .

The intended meaning is that is true exactly when vertex has colour .

We define a reduction that maps to the SAT instance

where:

ensures that every vertex gets at least one colour,

ensures that no vertex gets two different colours at the same time, and

ensures that adjacent vertices do not receive the same colour.

Therefore, is 3-colourable if and only if is satisfiable.