Three easy deletion games on paths

The node deletion game NODE KAYLES is a two persons perfect information game played on a graph $G$. Players alternate picking a node from the graph $G$; the node and its adjacent nodes are deleted. The first player unable to move loses the game. Deciding the winner of a NODE KAYLES game is $\mathsf{PSPACE}$-complete [1]. Similarly in the EDGE KAYLES [1] game the two players must pick an edge; the edge is deleted along with the two endpoint nodes and the edges incident to its two endpoint nodes. The complexity of finding the winner of a EDGE KAYLES game is unknwon. On the Q&A site cstheory.stackexchange.com I submitted a mix of the two games; I call it the BRIDGES AND ISLANDS game: at each turn each player must pick an edge (a “bridge”) or an isolated node (an “island”); if a player picks a node the node is deleted along with its incident edges, if it picks an edge, the edge is deleted along with its two endpoint nodes and the edges incident to them. Like the other two games, the first player unable to move loses the game. I didn’t succeed in finding the complexity of BRIDGES AND ISLANDS.

However decideng the winner is polynomial time solvable when the three games are played on a path. Here I give a quick proof for EDGE KAYLES; the proof for the other two games is similar. Continue reading

Two bits are enough for a “hard” sum

On Jan 17 I asked the following question on cs.stackexchange.com:

What is the complexity of the following variant of the SUBSET-SUM decision problem?

2-BIT SUBSET SUM: Given an integer $m \geq 0$, and a set of nonnegative integers $A = \{x_1, x_2, …, x_n\}$ such that every $x_i$ has at most $k=2$ bits set to $1$ ($x_i = 2^{b_{i_1}}+2^{b_{i_2}},\;\; b_{i_1},b_{i_2}\geq 0$); is there a subset $A’ \subseteq A$ such that the sum of its elements is equal to $m$ ?

Continue reading

The complexity of the puzzle game Net: rotating wires can drive you crazy

An amateur proof that the puzzle game Net is NP-complete.

Net puzzleAbstract
The puzzle game Net, also known as FreeNet or NetWalk, is played on a grid filled with terminals and wires; each tile of the grid can be rotated and the aim of the game is to connect all the terminals to the central power unit avoiding closed loops and open-ended wires. We prove that Net is NP-complete.

click here to download the paper

Rolling a cube can be tricky

An amateur proof that the rolling cube puzzle is NP-complete.

Abstract
We settle two open problems related to the rolling cube puzzle: Hamil-
tonian cycles are not unique even in fully labeled boards and rolling
cube puzzle is NP-complete in labeled boards without free cells and with
blocked cells.

Rolling a cube can be tricky click here to download the paper

NOTE: another example of two distinct Hamiltonian cycles in a fully labeled board has also been found by Pálvölgyi Dömötör (see this post on mathoverflow).

Have fun with Boulder Dash

An amateur proof that the popular game is NP-hard.

Abstract
Boulder Dash is a videogame created by Peter Liepa and Chris Gray in 1983 and released for many personal computers and console systems under license from First Star Software. Its concept is simple: the main character must dig through caves, collect diamonds, avoid falling stones and other nasties, and finally reach the exit within a time limit. In this report we show that the decision problem “Is an $N\times N$ Boulder Dash level solvable?” is NP-hard. The constructive proof is based on a simple gadget that allows us to transform the Hamiltonian cycle problem on a 3-connected cubic planar graph to a Boulder Dash level in polynomial time.

 click here to download the paper

NOTE: the same result has been proved by G. Viglietta in the paper: Gaming Is a Hard Job, But Someone Has to Do It! ; his proof, which is embedded in a more general and powerful framework that can be used to prove complexity of games, doesn’t require the Dirt element.