Table of Contents
Fetching ...

Hexasort -- The Complexity of Stacking Colors on Graphs

Linus Klocker, Simon D. Fink

TL;DR

It is proved that Hexasort is NP-hard, even when restricted to single-color stacks and progressively more constrained classes of graphs, culminating in strong NP-hardness on trees of either bounded height or degree.

Abstract

Many popular puzzle and matching games have been analyzed through the lens of computational complexity. Prominent examples include Sudoku, Candy Crush, and Flood-It. A common theme among these widely played games is that their generalized decision versions are NP-hard, which is often thought of as a source of their inherent difficulty and addictive appeal to human players. In this paper, we study a popular single-player stacking game commonly known as Hexasort. The game can be modelled as placing colored stacks onto the vertices of a graph, where adjacent stacks of the same color merge and vanish according to deterministic rules. We prove that Hexasort is NP-hard, even when restricted to single-color stacks and progressively more constrained classes of graphs, culminating in strong NP-hardness on trees of either bounded height or degree. Towards fixed-parameter tractable algorithms, we identify settings in which the problem becomes polynomial-time solvable and present dynamic programming algorithms.

Hexasort -- The Complexity of Stacking Colors on Graphs

TL;DR

It is proved that Hexasort is NP-hard, even when restricted to single-color stacks and progressively more constrained classes of graphs, culminating in strong NP-hardness on trees of either bounded height or degree.

Abstract

Many popular puzzle and matching games have been analyzed through the lens of computational complexity. Prominent examples include Sudoku, Candy Crush, and Flood-It. A common theme among these widely played games is that their generalized decision versions are NP-hard, which is often thought of as a source of their inherent difficulty and addictive appeal to human players. In this paper, we study a popular single-player stacking game commonly known as Hexasort. The game can be modelled as placing colored stacks onto the vertices of a graph, where adjacent stacks of the same color merge and vanish according to deterministic rules. We prove that Hexasort is NP-hard, even when restricted to single-color stacks and progressively more constrained classes of graphs, culminating in strong NP-hardness on trees of either bounded height or degree. Towards fixed-parameter tractable algorithms, we identify settings in which the problem becomes polynomial-time solvable and present dynamic programming algorithms.
Paper Structure (8 sections, 12 theorems, 5 figures)

This paper contains 8 sections, 12 theorems, 5 figures.

Key Result

theorem 1

Empty Hexasort on two independent edges and a single color is weakly NP-hard.

Figures (5)

  • Figure 1: Example of a Fitting Hexasort game with its graph representation (not showing stack heights). After placing , the green stacks merge, reach $t$ and vanish.
  • Figure 2: Labeled graph $G'$ with red and blue stacks placed. The configuration depicted in (a) cannot lead to an empty graph, while (b) can.
  • Figure 3: Spider graph stack placement progression leading to an empty graph.
  • Figure 4: The spider gadget used in our 3-Partition reduction.
  • Figure 5: A connected graph $G'$ with stacks placed across multiple gadgets excluded by \ref{['lem:strong-connected-config']}.

Theorems & Definitions (24)

  • proof
  • theorem 1
  • proof
  • lemma 1: Forced three-merge
  • proof
  • lemma 2
  • proof
  • lemma 3
  • proof
  • theorem 2
  • ...and 14 more