Skip to main navigation Skip to search Skip to main content

Playing Snake on a Graph

Research output: Working paperPreprintAcademic

28 Downloads (Pure)

Abstract

Snake is a classic computer game, which has been around for decades. Based on this game, we study the game of Snake on arbitrary undirected graphs. A snake forms a simple path that has to move to an apple while avoiding colliding with itself. When the snake reaches the apple, it grows longer, and a new apple appears. A graph on which the snake has a strategy to keep eating apples until it covers all the vertices of the graph is called snake-winnable. We prove that determining whether a graph is snake-winnable is NP-hard, even when restricted to grid graphs. We fully characterize snake-winnable graphs for odd-sized bipartite graphs and graphs with vertex-connectivity 1. While Hamiltonian graphs are always snake-winnable, we show that non-Hamiltonian snake-winnable graphs have a girth of at most 6 and that this bound is tight.
Original languageEnglish
PublisherArXiv.org
DOIs
Publication statusPublished - 26 Jun 2025

Keywords

  • cs.DM

Fingerprint

Dive into the research topics of 'Playing Snake on a Graph'. Together they form a unique fingerprint.
  • Playing Snake on a Graph

    Graafsma, D., Manthey, B. & Skopalik, A., 2026, Graph-Theoretic Concepts in Computer Science: 51st International Workshop, WG 2025, Otzenhausen, Germany, June 11–13, 2025, Revised Selected Papers. Fernau, H. & Kindermann, P. (eds.). 1 ed. Cham: Springer, p. 230-243 14 p. (Lecture Notes in Computer Science; vol. 16124 LNCS).

    Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

Cite this