Welsh Powell Graph colouring Algorithm

Last Updated : 26 Nov, 2025

In graph theory, vertex colouring is a way of labelling each vertex such that no two adjacent vertices have the same colour. We need to find out the minimum number of colours required to satisfy this condition, as it is not desirable to use a large variety of colours or labels. To achieve this, we use an algorithm called the Welsh–Powell algorithm, which helps minimise the number of colours required. This algorithm is also used to estimate the chromatic number of a graph. It is an iterative greedy approach.

Chromatic number: A graph G that requires K distinct colours for its proper colouring, and no fewer, is called a K-chromatic graph, and the number K is called the chromatic number of graph G.

Welsh–Powell Algorithm consists of the following steps:

  • Find the degree of each vertex.
  • List the vertices in order of descending degrees.
  • Colour the first vertex with colour 1.
  • Move down the list and colour all the vertices that are not adjacent to the coloured vertex with the same colour.
  • Repeat Step 4 on all uncoloured vertices with a new colour, in descending order of degrees, until all the vertices are coloured.

By starting with the highest-degree vertex, we ensure that the vertex with the highest number of potential conflicts is dealt with as early as possible.

VertexDegree
A2
B2
C1
D4
E2
F2
G3
H5
I3
J3
K5

First, order the list in descending order of degrees. Incase of tie, we can randomly choose any ways to break it. So, the new order will be : H, K, D, G, I, J, A, B, E, F, C Now, Following Welsh Powell Graph colouring Algorithm, H - color Red K - don’t color Red, as it connects to H D - color Red G - don’t color Red, as it connects to H I - don’t color Red, as it connects to H J - don’t color Red, as it connects to H A - don’t color Red, as it connects to H B - don’t color Red, as it connects to D E - colour Red F - don’t color Red, as it connects to E C - don’t color Red, as it connects to D After this, the graph will look like the one below.

Ignoring the vertices already coloured, we are left with : K, G, I, J, A, B, F, C We can repeat the process with the second colour Green K - color green G - don’t color green, as it connects with K I - color green J - don’t color green, as it connects with I A - color green B - don’t color green, as it connects with A F - color green C - color green

Again, ignoring the coloured vertices, we are left with G, J, B Let’s color it with Blue. G - color blue J - color blue B - color blue

The final figure is shown below. Now, we can see that using Welsh Powell’s algorithm we can color the vertices with only 3 types of colors(

chromatic number of this graph is 3

) which is the optimal solution, since this graph contains at least one triangle.

Comment