How Hard Are Color Sort Puzzles?

How these color puzzle numbers were measured

Every number in this report is computed by a script from the levels we publish, not typed by hand. Sort levels store the shortest solution our solver found, so "moves" means that solution, not a proven minimum. "Stuck" is the share of 30 random playthroughs per level that ended with no legal move left: a player who picks any legal move and never returns to a position already seen. The color flood figures come from 100 random boards per size with 6 colors, solved by our beam search and by a greedy player.

Water sort: moves and dead ends by number of colors

In water sort, each extra color adds a tube and roughly three to five moves. The bigger change is how unforgiving the board becomes: up to 5 colors almost any sensible play finishes, but from 8 colors on a random player gets stuck on about 72% of boards, and from 9 colors on nearly every time.

Water sort, 105 levels, 2 empty tubes each
ColorsTubesLevelsMoves (avg)Moves (range)Random play stuck
35155–50%
4659.88–110%
57101513–171%
681517.816–2119%
792021.419–2445%
8101624.623–2672%
9111328.625–3098%
10121031.629–3399%
1214739.637–42100%
141684542–47100%

Ball sort needs more moves than water sort

Ball sort uses the same tubes and colors, but each move carries one ball. A run of three same-colored layers that water sort moves in one pour takes three ball moves. The gap widens with more colors, and random play gets stuck much earlier.

Average moves in the stored solution, same number of colors
ColorsWater sortBall sortBall / water
3511220%
49.814.4147%
51516.9113%
617.820.9117%
721.425.4119%
824.630.1122%
928.634119%
1031.640.1127%
1239.651.7131%
144562.3138%
Ball sort, 105 levels
ColorsLevelsMoves (avg)Moves (range)Random play stuck
311111–1150%
4514.413–1668%
51016.914–1981%
61520.919–2393%
72025.423–2899%
81630.128–32100%
9133429–37100%
101040.136–43100%
12751.746–58100%
14862.356–72100%

Color flood: the greedy move loses

The natural strategy in color flood is to take whichever color adds the most cells right now. Our test pitted that greedy player against a beam search solver on the same boards. Greedy play was behind on every board, and the gap grew with the board.

6 colors, 100 random boards per size
BoardSolver (avg)Solver (range)Greedy (avg)Extra moves
12×121816–2122.9+4.9
14×1420.415–2426.4+6
16×1622.620–2629.8+7.2
18×1825.121–3133.9+8.8

The daily board gives you the solver's move count plus a few spare moves (none on Sunday), so greedy play usually runs out. The color flood strategy guide shows what to do instead.

Gradient puzzles: more tiles, closer colors

Gradient levels grow from a 4×5 board to 8×10, and the fewest swaps rises from 3 to 75. At the same time neighboring tiles get closer in color: the smallest step between neighbors falls from about 0.062 to 0.026 in OKLab units, the perceptual color space we use to mix the tiles.

By difficulty tier (1 = tutorial, 10 = hardest)
TierBoardMovable tilesFewest swapsSmallest step
14×5630.062
24×611.25–70.052
35×618.511–120.046
45×725170.04
56×731.321–250.036
66×837.328–310.032
77×953.843–460.03
87×1061.853–590.027
97×1066620.028
108×1076750.026

What researchers have proved about sort and flood puzzles

The numbers in this report describe the levels on this site. The general picture comes from two papers on the complexity of these puzzles. For water sort and ball sort:

We then show that these puzzles are NP-complete.

Ito, Kawahara, Minato, Otachi, Saitoh, Suzuki, Uehara, Uno, Yamanaka and Yoshinaka, “Sorting Balls and Water: Equivalence and Computational Complexity”, FUN 2022 (arXiv:2202.09495)

For flood fill games like color flood, where c is the number of colors:

We show that finding the minimum number of flooding operations is NP-hard for c>=3 and that this even holds when the player can perform flooding operations from any position on the board.

Clifford, Jalsenius, Montanaro and Sach, “The Complexity of Flood Filling Games”, Theory of Computing Systems, 2012 (arXiv:1001.4420)

For this reason, our sort levels and our daily color flood both rely on search programs rather than a formula, and why the flood move limit is a solver's best effort, not a proven minimum.

Spike levels in our color puzzles

Every fifth level in water sort, ball sort and the gradient puzzle is a spike. In the sort puzzles a spike averages 12 colors against 7.1 for the other levels. The level after a spike drops back down so you can breathe.

Questions and answers

How many moves does a water sort puzzle take?
On our levels, about 5 moves with 3 colors and about 45 moves with 14 colors, counting the shortest solution our solver found. Every pour counts as one move.
Is ball sort harder than water sort?
It takes more moves. With the same number of colors, ball sort needs 13% to 120% more moves than water sort on our levels, because each move carries one ball instead of a whole run of one color.
Why do I keep getting stuck in water sort?
Because most moves are traps once there are enough colors. A player who picks any legal move at random gets stuck on 72% of our water sort boards with 8 colors, and on 98% or more from 9 colors up.
Is taking the biggest area the best color flood strategy?
No. Always taking the color that adds the most cells needed 4.9 more moves than our solver on 12×12 boards and 8.8 more on 18×18 boards, averaged over 100 boards per size.

Sources

  1. Ito, Kawahara, Minato, Otachi, Saitoh, Suzuki, Uehara, Uno, Yamanaka and Yoshinaka, “Sorting Balls and Water: Equivalence and Computational Complexity”, FUN 2022 (arXiv:2202.09495)
  2. Clifford, Jalsenius, Montanaro and Sach, “The Complexity of Flood Filling Games”, Theory of Computing Systems, 2012 (arXiv:1001.4420)
  3. Björn Ottosson, “A perceptual color space for image processing” (2020)

Play next

More guides