Advertisement

Theory of Computing Systems

, Volume 50, Issue 1, pp 72–92 | Cite as

The Complexity of Flood Filling Games

  • Raphaël Clifford
  • Markus Jalsenius
  • Ashley Montanaro
  • Benjamin Sach
Article

Abstract

We study the complexity of the popular one player combinatorial game known as Flood-It. In this game the player is given an n×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×n boards (those requiring the most moves) and show that the number grows as fast as \(\Theta(\sqrt{c}\, n)\). 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 Ω(n) with high probability.

Keywords

NP-completeness Flood-filling Combinatorial games Percolation 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Berger, E.: Dynamic monopolies of constant size. J. Comb. Theory, Ser. B 83, 191–200 (2001) CrossRefMATHGoogle Scholar
  2. 2.
    Biedl, T.C., Demaine, E.D., Demaine, M.L., Fleischer, R., Jacobsen, L., Munro, J.I.: The complexity of Clickomania. In: More Games of No Chance. MSRI Publications, vol. 42, pp. 389–404. Cambridge University Press, Cambridge (2002) Google Scholar
  3. 3.
    Chayes, L., Winfield, C.: The density of interfaces: A new first-passage problem. J. Appl. Probab. 30(4), 851–862 (1993) MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Demaine, E.D., Hohenberger, S., Liben-Nowell, D.: Tetris is hard, even to approximate. In: Computing and Combinatorics, pp. 351–363 (2003) CrossRefGoogle Scholar
  5. 5.
    Fleischer, R., Woeginger, G.: An algorithmic analysis of the Honey-Bee game. In: Proc. Fun with Algorithms 2010, pp. 178–189 (2010) Google Scholar
  6. 6.
    Flocchini, P., Královič, R., Ružička, P., Roncato, A., Santoro, N.: On time versus size for monotone dynamic monopolies in regular topologies. J. Discrete Algorithms 1, 129–150 (2003) MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Fontes, L., Newman, C.: First passage percolation for random colorings of ℤd. Ann. Appl. Probab. 3(3), 746–762 (1993) MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Hoeffding, W.: Probability inequalities for sums of bounded random variables. J. Am. Stat. Assoc. 58(301), 13–30 (1963) MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    Is this game NP-hard? (May 2009). http://valis.cs.uiuc.edu/blog/?p=2005
  10. 10.
    Iwama, K., Miyano, E., Ono, H.: Drawing borders efficiently. Theory Comput. Syst. 44(2), 230–244 (2009) MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Jiang, T., Li, M.: On the approximation of shortest common supersequences and longest common subsequences. SIAM J. Comput. 24(5), 1122–1139 (1995) MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Kaye, R.: Minesweeper is NP-complete. Math. Intell. 22(2), 9–15 (2000) MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Madras, N., Slade, G.: The Self-Avoiding Walk. Birkhäuser, Basel (1996) CrossRefMATHGoogle Scholar
  14. 14.
    Maier, D.: The complexity of some problems on subsequences and supersequences. J. ACM 25(2), 322–336 (1978) MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    Munz, P., Hudea, I., Imad, J., Smith, R.J.: When zombies attack!: Mathematical modelling of an outbreak of zombie infection. In: Infectious Disease Modelling Research Progress, pp. 133–150. Nova Publ., New York (2009) Google Scholar
  16. 16.
    Peleg, D.: Size bounds for dynamic monopolies. Discrete Appl. Math. 86, 263–273 (1998) MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Räihä, K.-J., Ukkonen, E.: The shortest common supersequence problem over binary alphabet is NP-complete. Theor. Comput. Sci. 16, 187–198 (1981) CrossRefMATHGoogle Scholar
  18. 18.
    Timkovskii, V.G.: Complexity of common subsequence and supersequence problems and related problems. Cybern. Syst. Anal. 25(5), 565–580 (1989) MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2011

Authors and Affiliations

  • Raphaël Clifford
    • 1
  • Markus Jalsenius
    • 1
  • Ashley Montanaro
    • 1
  • Benjamin Sach
    • 1
  1. 1.Department of Computer ScienceUniversity of BristolBristolUK

Personalised recommendations