A proper coloring of a graph assigns a color to every vertex so that no edge joins two vertices of the same color. In konkur problems the "graph" is usually a figure of cells: each cell is a vertex, and two cells are adjacent (joined by an edge) when they share a side. The task is to count how many proper colorings exist with available colors.
The key idea is the multiplication principle: process the vertices in a carefully chosen order, and as you color each one, count how many colors are still legal given the choices already locked in. If those counts do not depend on the specific colors picked earlier — only on how many neighbors are already colored — the total is just the product of the per-vertex counts.
The per-vertex rule
Suppose you are about to color a vertex and exactly of its neighbors have already been colored. To stay proper, must avoid those neighbors' colors. In the cleanest case those neighbors carry distinct colors, so has
Multiplying these counts down a good ordering gives the total number of proper colorings. Two especially common building blocks:
- Pendant (degree-1) vertex. A cell whose only neighbor is colored last-but-one always sees exactly one forbidden color, so it contributes a factor of , no matter how the rest is colored. Strip pendants off and handle them as independent factors.
- A path / tree of vertices. Color a root in ways, then each subsequent vertex has exactly one already-colored neighbor, contributing . A tree (no cycles) therefore has exactly proper colorings.
How to apply
- Build the adjacency graph. Mark which cells share an edge; list the edges.
- Peel off pendants. Every degree-1 vertex multiplies the answer by ; remove it and repeat. This often shrinks the figure to a small core.
- Order the core so each new vertex has few colored neighbors. Color the first vertex in ways; for each later vertex subtract the number of distinctly-colored neighbors already placed.
- Multiply all the factors. Watch for vertices whose two colored neighbors might share a color (then the subtraction changes) — if so, split into cases.
Mini-example: a triangle with a tail
Take a triangle (each pair adjacent) plus a pendant cell attached only to , with colors. Color : ways. Color (neighbor ): ways. Color (neighbors , which are distinct): way. Finally the pendant (one neighbor ): ways. The product is
proper colorings. The triangle forces all three colors, then the tail just avoids its single neighbor.
Exam trick: order matters only for counting, not for the figure — always color a vertex after enough of its neighbors so the choice count is forced and constant. If a vertex's already-colored neighbors could be either equal or different colors, do not write a single ; split into cases (neighbors same vs. different) and add the resulting products.