Solving the Rubik's Cube Optimally is NP-complete

Authors Erik D. Demaine, Sarah Eisenstat, Mikhail Rudoy

Thumbnail PDF


  • Filesize: 0.64 MB
  • 13 pages

Document Identifiers

Author Details

Erik D. Demaine
Sarah Eisenstat
Mikhail Rudoy

Cite AsGet BibTex

Erik D. Demaine, Sarah Eisenstat, and Mikhail Rudoy. Solving the Rubik's Cube Optimally is NP-complete. In 35th Symposium on Theoretical Aspects of Computer Science (STACS 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 96, pp. 24:1-24:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


In this paper, we prove that optimally solving an n x n x n Rubik's Cube is NP-complete by reducing from the Hamiltonian Cycle problem in square grid graphs. This improves the previous result that optimally solving an n x n x n Rubik's Cube with missing stickers is NP-complete. We prove this result first for the simpler case of the Rubik's Square--an n x n x 1 generalization of the Rubik's Cube--and then proceed with a similar but more complicated proof for the Rubik's Cube case. Our results hold both when the goal is make the sides monochromatic and when the goal is to put each sticker into a specific location.
  • combinatorial puzzles
  • NP-hardness
  • group theory
  • Hamiltonicity


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Stephen A. Cook. Can computers routinely discover mathematical proofs? Proceedings of the American Philosophical Society, 128(1):40-43, 1984. URL:
  2. Cride5. Move count metrics for big cubes - standards and preferences. Speed Solving Forum, August 2010. URL:
  3. Erik D. Demaine, Martin L. Demaine, Sarah Eisenstat, Anna Lubiw, and Andrew Winslow. Algorithms for solving Rubik’s Cubes. In Proceedings of the 19th European Conference on Algorithms, ESA'11, pages 689-700, Berlin, Heidelberg, 2011. Springer-Verlag. URL:
  4. Erik D. Demaine, Sarah Eisenstat, and Mikhail Rudoy. Solving the Rubik’s Cube optimally is NP-complete. arXiv:1706.06708, 2017. URL:
  5. Jeff Erickson. Is optimally solving the n×n×n Rubik’s Cube NP-hard? Theoretical Computer Science Stack Exchange. URL: (version: 2010-10-23).
  6. Alon Itai, Christos H. Papadimitriou, and Jayme Luiz Szwarcfiter. Hamilton paths in grid graphs. SIAM Journal on Computing, 11(4):676-686, November 1982. Google Scholar
  7. Graham Kendall, Andrew J. Parkes, and Kristian Spoerer. A survey of NP-complete puzzles. ICGA Journal, 31:13-34, 2008. Google Scholar
  8. Daniel Ratner and Manfred K. Warmuth. Nxn puzzle and related relocation problem. J. Symb. Comput., 10(2):111-138, 1990. URL:
  9. Wiki. Metric. Speed Solving Wiki, May 2010. URL: