Exercise · ZW-GRAPH-COLORING-007 · ★★☆ Intermediate

In how many ways can a path on 4 vertices be colored with 3 available colors so that adjacent vertices differ?

Choose one option.

Show answer
  • A. 24

Explanation

The first vertex has 3 options and each next one has 2 (anything but the previous color): \(3\cdot2\cdot2\cdot2=24\).

Study Discrete mathematics in ZWMath →

Review the concept: Graph coloring

A proper coloring \(c\) with \(k\) colors of a graph \(G=(V,E)\) assigns to each vertex one of the colors \(1,\dots,k\) so that no two adjacent vertices share a color.

\[c:V\to\{1,\dots,k\},\qquad c(u)\neq c(v)\ \text{ if } \{u,v\}\in E\]

More practice problems: graph coloring

← ZW-GRAPH-COLORING-006 ZW-GRAPH-COLORING-008 →