Playing Snake on a Graph

๐Ÿ“… 2025-06-26
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
This paper investigates the solvability of the Snake game on undirected graphs: determining whether there exists a strategy enabling the snake to traverse a simple path, continuously collect apples, and eventually visit all vertices (i.e., the graph is *snake-winnable*). We formally define this problem for the first time and prove its decision version is NP-hard. We fully characterize snake-winnability for odd-order bipartite graphs and 1-connected graphs. We establish that any non-Hamiltonian but snake-winnable graph has girth at most sixโ€”tightness of this bound is demonstrated. We derive several necessary and sufficient conditions, thereby constructing a theoretical framework for the problem. Crucially, we reveal a fundamental distinction between snake-winnable and Hamiltonian graphs: the former is strictly weaker than, yet not equivalent to, the latter. This work extends the modeling scope of graph searching and self-avoiding walks.

Technology Category

Application Category

๐Ÿ“ 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.
Problem

Research questions and friction points this paper is trying to address.

Determine if a graph is snake-winnable is NP-hard
Characterize snake-winnable graphs for specific cases
Explore snake-winnable properties in Hamiltonian graphs
Innovation

Methods, ideas, or system contributions that make the work stand out.

Extends Snake game to arbitrary undirected graphs
Proves NP-hardness for snake-winnable grid graphs
Characterizes snake-winnable odd bipartite graphs
๐Ÿ”Ž Similar Papers
No similar papers found.