Possible ways to color vertices

coloringcombinatoricsgraph theory

Considering a graph formed by $4$ verticles connected between them (like it's a circle). Having available $3$ distinct colors, in how many ways is it possible to color the verticles of the graph giving different colors to adjacent verticles?

So $v_1$ is connected to $v_2$ and $v_4$; and $v_3$ is connect to $v_2$ and $v_4$.

My textbook says that the possible ways are $18$ but I don't understand why. Aren't they
$$
3\cdot 2\cdot 2\cdot1 = 12?
$$

Best Answer

Colour in two opposite vertices first.

  • If those vertices receive the same colour (3 ways), the other two vertices can independently be either of the other two colours ($2×2=4$ ways).
  • If those vertices receive different colours ($3×2=6$ ways), the other two vertices must be the third colour.

This gives $3×4+6=18$ ways.

Related Question