The Computational Complexity of Portal and Other 3D Video Games

Authors Erik D. Demaine, Joshua Lockhart, Jayson Lynch

Thumbnail PDF


  • Filesize: 3.25 MB
  • 22 pages

Document Identifiers

Author Details

Erik D. Demaine
  • MIT CSAIL, 32 Vassar Street, Cambridge, MA 02139, USA
Joshua Lockhart
  • Department of Computer Science, University College London, London, WC1E 6BT, UK
Jayson Lynch
  • MIT Computer Science and Artificial Intelligence Laboratory, 32 Vassar Street, Cambridge, MA 02139, USA

Cite AsGet BibTex

Erik D. Demaine, Joshua Lockhart, and Jayson Lynch. The Computational Complexity of Portal and Other 3D Video Games. In 9th International Conference on Fun with Algorithms (FUN 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 100, pp. 19:1-19:22, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


We classify the computational complexity of the popular video games Portal and Portal 2. We isolate individual mechanics of the game and prove NP-hardness, PSPACE-completeness, or pseudo-polynomiality depending on the specific game mechanics allowed. One of our proofs generalizes to prove NP-hardness of many other video games such as Half-Life 2, Halo, Doom, Elder Scrolls, Fallout, Grand Theft Auto, Left 4 Dead, Mass Effect, Deus Ex, Metal Gear Solid, and Resident Evil. These results build on the established literature on the complexity of video games [Aloupis et al., 2014][Cormode, 2004][Forisek, 2010][Viglietta, 2014].

Subject Classification

ACM Subject Classification
  • Theory of computation → Problems, reductions and completeness
  • video games
  • hardness
  • motion planning
  • NP


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


  1. Greg Aloupis, Erik D. Demaine, Alan Guo, and Giovanni Viglietta. Classic Nintendo games are (NP-)hard. In Proceedings of the 7th International Conference on Fun with Algorithms (FUN 2014), Lipari Island, Italy, July 1-3 2014. Google Scholar
  2. Eric Caoili. Portal 2 has sold over 4m copies. Accessed: 2015-08-21.
  3. G. Cormode. The hardness of the Lemmings game, or oh no, more NP-completeness proofs. In Proceedings of Third International Conference on Fun with Algorithms, pages 65-76, 2004. Google Scholar
  4. Erik D. Demaine and Robert A. Hearn. Playing games with algorithms: Algorithmic combinatorial game theory. In Michael H. Albert and Richard J. Nowakowski, editors, Games of No Chance 3, volume 56 of Mathematical Sciences Research Institute Publications, pages 3-56. Cambridge University Press, 2009. Google Scholar
  5. Erik D. Demaine, Susan Hohenberger, and David Liben-Nowell. Tetris is hard, even to approximate. In Proceedings of the 9th International Computing and Combinatorics Conference (COCOON 2003), pages 351-363, Big Sky, Montana, July 25-28 2003. Google Scholar
  6. Erik D. Demaine, Giovanni Viglietta, and Aaron Williams. Super Mario Bros. is harder/easier than we thought. In Proceedings of the 8th International Conference on Fun with Algorithms, La Maddalena, Italy, June 2016. Google Scholar
  7. Michal Forisek. Computational complexity of two-dimensional platform games. In Proceedings International Conference on Fun with Algorithms (FUN 2010), pages 214-227, 2010. Google Scholar
  8. Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., New York, NY, USA, 1979. Google Scholar
  9. Robert A. Hearn and Erik D. Demaine. Games, Puzzles, and Computation. A. K. Peters, Ltd., Natick, MA, USA, 2009. Google Scholar
  10. Alon Itai, Christos H. Papadimitriou, and Jayme Luiz Szwarcfiter. Hamilton paths in grid graphs. SIAM Journal on Computing, 11(4):676-686, 1982. Google Scholar
  11. Graham Kendall, Andrew J. Parkes, and Kristian Spoerer. A survey of NP-complete puzzles. ICGA Journal, 31(1):13-34, 2008. URL:
  12. Gary Peterson, John Reif, and Salman Azhar. Lower bounds for multiplayer noncooperative games of incomplete information. Computers & Mathematics with Applications, 41(7):957-992, 2001. Google Scholar
  13. Walter J. Savitch. Relationships between nondeterministic and deterministic tape complexities. J. Comput. Syst. Sci., 4(2):177-192, 1970. URL:
  14. Klaus Sutner and Wolfgang Maass. Motion planning among time dependent obstacles. Acta Informatica, 26(1-2):93-122, 1988. Google Scholar
  15. Valve Developer Community. P2C., 2013.
  16. Valve Developer Community. Valve map format., 2016.
  17. Tom C. van der Zanden and Hans L. Bodlaender. Pspace-completeness of bloxorz and of games with 2-buttons. In Vangelis Th. Paschos and Peter Widmayer, editors, Algorithms and Complexity - 9th International Conference, CIAC 2015, Paris, France, May 20-22, 2015. Proceedings, volume 9079 of Lecture Notes in Computer Science, pages 403-415. Springer, 2015. URL:
  18. Giovanni Viglietta. Gaming is a hard job, but someone has to do it! Theory of Computing Systems, 54(4):595-621, 2014. Google Scholar
  19. Giovanni Viglietta. Lemmings is PSPACE-complete. Theoretical Computer Science, 586:120-134, 2015. Google Scholar
  20. Wesley Yin-Poole. Portal sells nearly four million. Accessed: 2015-08-21.
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