Skip to main content
QUICK REVIEW

[Paper Review] Candy Crush is NP-hard

Toby Walsh|arXiv (Cornell University)|Mar 8, 2014
Artificial Intelligence in GamesComputer Science10 references17 citations
TL;DR

This paper proves that the generalized version of the popular puzzle game Candy Crush is NP-hard by reducing 3-SAT to the game's mechanics, demonstrating that achieving a target score within a fixed number of swaps is computationally intractable. The result establishes Candy Crush as part of a class of NP-complete puzzles, with implications for puzzle design and potential use in crowdsourcing hard computational problems.

ABSTRACT

We prove that playing Candy Crush to achieve a given score in a fixed number of swaps is NP-hard.

Motivation & Objective

  • To formally establish the computational complexity of Candy Crush as a puzzle game.
  • To investigate whether achieving a given score within a fixed number of swaps is computationally hard.
  • To explore the implications of NP-hardness for puzzle design and human problem-solving in games.
  • To examine whether the game's structure supports the encoding of NP-complete problems like 3-SAT.
  • To assess the potential for using Candy Crush as a platform for crowdsourcing hard computational problems.

Proposed method

  • Reduced an instance of 3-SAT to the Candy Crush problem using a generalized board with unbounded dimensions.
  • Constructed variable gadgets using purple clusters that simulate truth assignments via vertical chain formation.
  • Designed wire gadgets to propagate truth values across the board using chains of three identical candies.
  • Built clause gadgets that detect satisfaction of logical clauses by creating a large number of chains when satisfied.
  • Ensured that only chains of exactly three candies are formed, avoiding special candies like striped or wrapped ones.
  • Used a neutral background of alternating colored candies to prevent unintended chain formations.

Experimental results

Research questions

  • RQ1Is achieving a target score in Candy Crush within a fixed number of swaps computationally hard?
  • RQ2Can the 3-SAT problem be encoded into the mechanics of Candy Crush using polynomial-time reductions?
  • RQ3Does the structure of Candy Crush allow for phase transitions in problem hardness, similar to other NP-hard problems?
  • RQ4Can the game be used to crowdsource solutions to practical NP-hard problems?
  • RQ5Is the problem of determining a unique solution to a Candy Crush puzzle co-NP-hard?

Key findings

  • The Candy Crush problem is NP-complete, as a valid sequence of swaps serves as a polynomially verifiable witness.
  • The reduction from 3-SAT to Candy Crush is polynomial in size, with the board width O(n + m²) and height O(m³(n + m²)).
  • Satisfying all clauses in the 3-SAT instance results in the maximum score, which exceeds any score obtainable by direct wire manipulation.
  • The maximum score is achieved only when variable gadgets are set in a way that satisfies all clauses, linking solution uniqueness to the unique SAT problem.
  • The Unique Candy Crush problem is co-NP-hard, as it reduces to the complement of the unique SAT problem.
  • The NP-hardness result holds even with partial visibility of the board, as long as the hidden part does not contribute to the score.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.