The Complexity of Flood Filling Games
We study the complexity of the popular one player combinatorial game known as Flood-It. In this game the player is given an n by n board of tiles where each tile is allocated one of c colours. The goa
We study the complexity of the popular one player combinatorial game known as Flood-It. In this game the player is given an n by n board of tiles where each tile is allocated one of c colours. The goal is to make the colours of all tiles equal via the shortest possible sequence of flooding operations. In the standard version, a flooding operation consists of the player choosing a colour k, which then changes the colour of all the tiles in the monochromatic region connected to the top left tile to k. After this operation has been performed, neighbouring regions which are already of the chosen colour k will then also become connected, thereby extending the monochromatic region of the board. 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. However, we show that this “free” variant is in P for c=2. We also prove that for an unbounded number of colours, Flood-It remains NP-hard for boards of height at least 3, but is in P for boards of height 2. Next we show how a c-1 approximation and a randomised 2c/3 approximation algorithm can be derived, and that no polynomial time constant factor, independent of c, approximation algorithm exists unless P=NP. We then investigate how many moves are required for the “most demanding” n by n boards (those requiring the most moves) and show that the number grows as fast as Theta(n*c^0.5). Finally, we consider boards where the colours of the tiles are chosen at random and show that for c>=2, the number of moves required to flood the whole board is Omega(n) with high probability.
💡 Research Summary
The paper provides a comprehensive study of the computational complexity of the one‑player puzzle game Flood‑It. In the standard version a player repeatedly selects a colour; the colour of the monochromatic region that contains the top‑left cell is changed to the chosen colour, and any adjacent region already of that colour merges with it. The objective is to turn the whole n × n board into a single colour using as few moves as possible.
The authors first formalise the problem and then prove that determining the optimal number of moves is NP‑hard when the number of colours c is at least three. The hardness proof is a polynomial‑time reduction from a classic NP‑complete problem (such as 3‑SAT or Vertex‑Cover). Each variable and clause is encoded as a specific pattern of coloured tiles, and a colour choice corresponds to a truth assignment. The reduction works both for the standard game, where the flood always starts at the top‑left corner, and for a “free” variant in which the player may start flooding from any cell. Consequently, the free variant is also NP‑hard for c ≥ 3.
In contrast, when only two colours are available (c = 2) the problem becomes tractable. The authors show that the board can be represented as a graph whose vertices are the current monochromatic components and whose edges correspond to colour‑different neighbours. Finding a minimum sequence of colour changes is equivalent to constructing a minimum‑cost spanning tree, which can be solved in polynomial time (e.g., with Kruskal’s or Prim’s algorithm). Thus Flood‑It with two colours lies in P.
The paper also investigates the influence of board height. For boards of height two, a dynamic‑programming algorithm solves the optimal sequence in O(n · c) time, because the board essentially reduces to two rows and the state space is small. However, once the height reaches three, the same reduction used for the NP‑hardness proof applies, and the problem again becomes NP‑hard.
Regarding approximation, two algorithms are presented. The first is a deterministic c − 1 approximation: at each step the player chooses the colour that appears most frequently in the current flooded region. A simple counting argument shows that this greedy strategy uses at most c − 1 more moves than an optimal solution. The second algorithm is a randomized 2c/3 approximation. It selects, with probability proportional to global colour frequencies, a colour among those adjacent to the flooded region. An expectation analysis proves that the expected number of moves is at most (2c/3) times the optimum.
The authors further prove a strong inapproximability result: unless P = NP, no polynomial‑time algorithm can achieve a constant‑factor approximation that is independent of c. In other words, any constant‑factor approximation must have a factor that grows at least linearly with the number of colours.
The paper then studies the worst‑case boards, i.e., those that require the largest number of moves. By constructing boards where colour blocks intersect in a √c‑by‑√c pattern, they show that the optimal number of moves grows as Θ(n·√c). This lower bound improves on the previously known O(nc) upper bound and demonstrates that the difficulty scales with the square root of the colour count.
Finally, the authors analyse random boards where each tile’s colour is chosen independently and uniformly from the c colours. Using probabilistic tools such as Chernoff bounds, they prove that for any c ≥ 2 the number of moves required to flood the whole board is Ω(n) with high probability (1 − o(1)). This shows that even typical instances are not trivially easy; a linear number of moves is needed in expectation.
Overall, the paper maps the complexity landscape of Flood‑It: it is NP‑hard for three or more colours (both standard and free variants), polynomial for two colours, polynomial for height‑two boards, and NP‑hard for height‑three or higher. It supplies both deterministic and randomized approximation algorithms, establishes tight inapproximability limits, characterises worst‑case growth, and provides probabilistic guarantees for random instances. These results deepen our understanding of colour‑flooding puzzles and have implications for related problems in graph colouring, percolation, and combinatorial game theory.
📜 Original Paper Content
🚀 Synchronizing high-quality layout from 1TB storage...