The Complexity of Escaping Labyrinths and Enchanted Forests

Authors Florian D. Schwahn, Clemens Thielen

Thumbnail PDF


  • Filesize: 3.74 MB
  • 13 pages

Document Identifiers

Author Details

Florian D. Schwahn
  • Department of Mathematics, University of Kaiserslautern, Paul-Ehrlich-Str. 14, D-67663 Kaiserslautern, Germany
Clemens Thielen
  • Department of Mathematics, University of Kaiserslautern, Paul-Ehrlich-Str. 14, D-67663 Kaiserslautern, Germany

Cite AsGet BibTex

Florian D. Schwahn and Clemens Thielen. The Complexity of Escaping Labyrinths and Enchanted Forests. In 9th International Conference on Fun with Algorithms (FUN 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 100, pp. 30:1-30:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


The board games The aMAZEing Labyrinth (or simply Labyrinth for short) and Enchanted Forest published by Ravensburger are seemingly simple family games. In Labyrinth, the players move though a labyrinth in order to collect specific items. To do so, they shift the tiles making up the labyrinth in order to open up new paths (and, at the same time, close paths for their opponents). We show that, even without any opponents, determining a shortest path (i.e., a path using the minimum possible number of turns) to the next desired item in the labyrinth is strongly NP-hard. Moreover, we show that, when competing with another player, deciding whether there exists a strategy that guarantees to reach one's next item faster than one's opponent is PSPACE-hard. In Enchanted Forest, items are hidden under specific trees and the objective of the players is to report their locations to the king in his castle. Movements are performed by rolling two dice, resulting in two numbers of fields one has to move, where each of the two movements must be executed consecutively in one direction (but the player can choose the order in which the two movements are performed). Here, we provide an efficient polynomial-time algorithm for computing a shortest path between two fields on the board for a given sequence of die rolls, which also has implications for the complexity of problems the players face in the game when future die rolls are unknown.

Subject Classification

ACM Subject Classification
  • Theory of computation → Shortest paths
  • Theory of computation → Representations of games and their complexity
  • board games
  • combinatorial game theory
  • computational complexity


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


  1. E. D. Demaine and R. A. Hearn. Playing games with algorithms: Algorithmic combinatorial game theory, 2001. URL:
  2. C. Dodaro, M. Alviano, W. Faber, N. Leone, F. Ricca, and M. Sirianni. The birth of a WASP: Preliminary report on a new ASP solver. In Proceedings of the 26th Italian Conference on Computational Logic (CILC), pages 99-113, 2011. Google Scholar
  3. D. Eppstein. Computational complexity of games and puzzles. Accessed: 2018-04-16.
  4. M. R. Garey and D. S. Johnson. Computers and Intractability (A Guide to the Theory of NP-Completeness). W.H. Freeman and Company, New York, 1979. Google Scholar
  5. G. Kendall, A. J. Parkes, and K. Spoerer. A survey of NP-complete puzzles. ICGA Journal, 31(1):13-34, 2008. Google Scholar
  6. M. J. Kobbert. Das verrückte Labyrinth. Ravensburger, 1986. Google Scholar
  7. F. Le Gall. Powers of tensors and fast matrix multiplication. In Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 296-303, 2014. Google Scholar
  8. M. Matschoss and A. Randolph. Sagaland. Ravensburger, 1981. Google Scholar
  9. C. Papadimitriou. Computational Complexity. Addison Wesley, 1993. Google Scholar
  10. Spiel des Jahres e.V. Spiel des Jahres. URL:
  11. R. P. Stanley. Enumerative Combinatorics. Wadsworth Publ. Co., 1986. Google Scholar
  12. L. J. Stockmeyer and A. K. Chandra. Provably difficult combinatorial games. SIAM Journal on Computing, 8(2):151-174, 1979. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail