Trainyard is NP-Hard

Recently, due to the widespread diffusion of smart-phones, mobile puzzle games have experienced a huge increase in their popularity. A successful puzzle has to be both captivating and challenging, and it has been suggested that this features are somehow related to their computational complexity \cite{Eppstein}. Indeed, many puzzle games --such as Mah-Jongg, Sokoban, Candy Crush, and 2048, to name a few-- are known to be NP-hard \cite{CondonFLS97, culberson1999sokoban, GualaLN14, Mehta14a}. In this paper we consider Trainyard: a popular mobile puzzle game whose goal is to get colored trains from their initial stations to suitable destination stations. We prove that the problem of determining whether there exists a solution to a given Trainyard level is NP-hard. We also \href{this http URL}{provide} an implementation of our hardness reduction.

[1]  Giovanni Viglietta Gaming Is a Hard Job, but Someone Has to Do It! , 2013, Theory of Computing Systems.

[2]  Manfred K. Warmuth,et al.  NxN Puzzle and Related Relocation Problem , 1990, J. Symb. Comput..

[3]  Gary William Flake,et al.  Rush Hour is PSPACE-complete, or "Why you should generously tip parking lot attendants" , 2002, Theoretical Computer Science.

[4]  Joseph Culberson,et al.  Sokoban is PSPACE-complete , 1997 .

[5]  Joan Feigenbaum,et al.  Random debaters and the hardness of approximating stochastic functions , 1994, Proceedings of IEEE 9th Annual Conference on Structure in Complexity Theory.

[6]  Stefano Leucci,et al.  Bejeweled, Candy Crush and other match-three games are (NP-)hard , 2014, 2014 IEEE Conference on Computational Intelligence and Games.

[7]  Diogo M. Costa Computational Complexity of Games and Puzzles , 2018, ArXiv.

[8]  Graham Kendall,et al.  A Survey of NP-Complete Puzzles , 2008, J. Int. Comput. Games Assoc..

[9]  Valia Mitsou,et al.  The Computational Complexity of Games and Puzzles , 2013 .

[10]  Erik D. Demaine,et al.  Games, puzzles and computation , 2009 .

[11]  Erik D. Demaine,et al.  Classic Nintendo Games Are (Computationally) Hard , 2012, FUN.