Abstract 1 Introduction 2 Tree-Residue Vertex-Breaking and Hamiltonian Cycle 3 Main Strategy 4 ASP-Completeness of Puzzles References Appendix A Proof of Proposition 8

An ASP-Completeness Framework for Dynasty Puzzles

Kosuke Susukita ORCID University of Hyogo, Kobe, Japan
Abstract

A certain class of pencil-and-paper puzzles shares common rules: given a grid, certain cells must be shaded such that i) no two shaded cells are orthogonally adjacent, and ii) all unshaded cells are orthogonally connected. Such puzzles are sometimes referred to as “dynasty puzzles” within parts of the online puzzle community. We introduce a framework for proving the ASP-completeness (i.e., NP-complete under parsimonious reductions) of various dynasty puzzles. We apply this framework to seven specific dynasty puzzles – Akichiwake, Aquapelago, Ayeheya, Guide Arrow, Heyawake, Hitori, and Kurodoko. As a consequence, for given k solutions of any of these puzzles, deciding whether a distinct solution exists is NP-complete, and counting the number of solutions is #P-complete. Our results strengthen the known result of ASP-completeness for Heyawake and establish the ASP-completeness of the other six puzzles. The main idea is to reconstruct the reduction from the Tree-Residue Vertex-Breaking Problem (TRVB) to the Hamiltonian Cycle Problem introduced by MIT Hardness Group (2024). In our framework, the connectivity of the unshaded cells ensures the connectivity of the shaded cells, allowing the shaded cells to simulate TRVB, which is also an alternative representation of the Hamiltonian cycles under certain conditions.

Keywords and phrases:
ASP-completeness, pencil-and-paper puzzles, dynasty puzzles, Hitori, Kurodoko, Hamiltonian cycle, Tree-Residue Vertex-Breaking
Copyright and License:
[Uncaptioned image] © Kosuke Susukita; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Complexity classes
Acknowledgements:
I am grateful to my supervisor, Assoc. Prof. Junichi Teruyama, for his critical reading of the draft and his helpful suggestions.
Editor:
John Iacono

1 Introduction

A class of pencil-and-paper puzzles shares the following rules:

  • A subset of cells on a grid must be shaded.

  • No two shaded cells may be orthogonally adjacent.

  • All unshaded cells must form a single orthogonally connected component.

Prominent examples include Heyawake, Hitori, and Kurodoko. Such puzzles are referred to as dynasty puzzles.111The term dynasty puzzles is used informally in online puzzle communities; see, e.g., https://puzzles.covering.space/61 (in English) and https://scrapbox.io/puzzle-pedia/Dynasty (in Japanese). Several dynasty puzzles are known to be NP-complete, including Heyawake [5], Hitori [4, Section 9.2], Kurodoko [8], and Yajisan-Kazusan [7].

However, a natural question arises regarding the uniqueness of solutions. The notion of ASP-completeness provides a theoretical framework to analyze the computational complexity of this question. Roughly speaking, this requires reductions that preserve the exact number of solutions, rather than merely their existence. Such reductions are known as parsimonious reductions. A problem is called ASP-complete if it belongs to NP and every problem in NP admits a polynomial-time parsimonious reduction to it [16]. ASP-completeness implies NP-completeness as well as #P-completeness of counting the number of solutions. Moreover, it implies the NP-completeness of the k-ASP – given an instance and its k solutions, find a distinct solution – for any fixed integer k1 [16].

For instance, as noted in [5], the reduction to Heyawake can be easily modified to be parsimonious; thus, Heyawake is ASP-complete. Similarly, the reduction from 3-Dimensional Matching to Yajisan-Kazusan in [7] can be readily verified to be parsimonious. Since 3-Dimensional Matching is known to be ASP-complete [1], this implies that Yajisan-Kazusan is also ASP-complete. However, the known reductions to Hitori and Kurodoko are not parsimonious. In this paper, we introduce a gadget framework useful for designing parsimonious reductions. Applying this framework, we prove the ASP-completeness of the puzzles Akichiwake, Aquapelago, Ayeheya, Guide Arrow, Hitori, and Kurodoko, and also tighten the constraints on the clues for Heyawake.

Our approach is based on the Tree-Residue Vertex-Breaking problem (TRVB) [2], which is closely related to the Hamiltonian Cycle Problem (HCP). In TRVB, we are given a multigraph with designated breakable vertices, and the goal is to break a subset of these vertices such that the resulting graph becomes a tree. Breaking a vertex of degree d consists of replacing it with d vertices of degree 1 corresponding to the endpoints of the incident edges. Under certain conditions, there exists a one-to-one correspondence between the solutions of TRVB and those of HCP [3]. The main idea of our framework is to represent the topological structure of TRVB and HCP by exploiting the diagonal connectivity of shaded cells in dynasty puzzles, and to simulate the reduction from TRVB to HCP on grid graphs introduced in [3]. This correspondence is enforced by the connectivity requirement of unshaded cells.

2 Tree-Residue Vertex-Breaking and Hamiltonian Cycle

In this section, we outline the reductions from the Tree-Residue Vertex-Breaking (TRVB) problem to the Hamiltonian Cycle Problem (HCP) as described in [3].

2.1 Tree-Residue Vertex-Breaking

Definition 1 ([2]).

Let G=(V,E) be a multigraph and let VB and VU be a partition of V. The Tree-Residue Vertex-Breaking problem (TRVB) asks whether it is possible to transform G into a tree by breaking some vertices in VB. The operation of breaking a vertex v of degree d is defined by replacing it with d degree-1 vertices corresponding to the endpoints of its d incident edges. The vertices in VB are called breakable, while the vertices in VU are unbreakable. The problem with the following constraints is denoted as (B,U)-TRVB:

  • For any vVB, deg(v)B.

  • For any vVU, deg(v)U.

TRVB is called planar TRVB if the input graph is planar.

Under certain conditions, TRVB is known to be ASP-complete.

Theorem 2 ([3]).

Planar ({4},{1})-TRVB is ASP-complete.

Theorem 3 ([3]).

Planar ({6},)-TRVB is ASP-complete.

2.2 Hamiltonian Cycle on Grid Graphs

A grid graph is a graph whose vertices are a subset of 2 and whose edges connect pairs of vertices with Euclidean distance one. A grid graph is rectangular if its vertex set is V={1,,m}×{1,,n} for some integers m,n1. We refer to the pair (m,n) as the dimensions of the rectangular grid graph. Furthermore, when we consider a spanning subgraph G of an m×n rectangular grid graph (i.e., G contains all vertices of the grid), we also refer to G as having dimensions m×n.

A Hamiltonian cycle in a graph is a cycle that visits each vertex exactly once. The Hamiltonian Cycle Problem (HCP) asks whether a given graph contains a Hamiltonian cycle. Reference [3] establishes the complexity of HCP on grid graphs and their max-degree-3 subgraphs (i.e., subgraphs where every vertex has degree at most three). We focus on the following two theorems.

Theorem 4 ([3]).

HCP on max-degree-3 spanning subgraphs of directed rectangular grid graphs is ASP-complete.

Theorem 5 ([3]).

HCP on max-degree-3 spanning subgraphs of undirected rectangular grid graphs is ASP-complete.

We sketch a direct reconstruction of the proofs for Theorem 4 based on [3, Theorem 4.6].

Figure 1 illustrates the core idea of the gadgets used in the reduction. This is a degree-4 breakable vertex gadget, with the yellow square in the center representing the vertex itself, and the blue tentacles representing edges. This gadget admits exactly two local configurations compatible with a Hamiltonian cycle: the yellow region is in the interior of the Hamiltonian cycle (Figure 2(a)), or in the exterior (Figure 2(b)). The former corresponds to not breaking the vertex, while the latter corresponds to breaking it. We can embed a planar TRVB instance into a grid graph by replacing each breakable vertex with such a gadget and connecting the tentacles according to the edges of the TRVB instance. By [3, Lemma 2.4], Hamiltonian cycles in the constructed graph correspond one-to-one with the solutions of the original TRVB instance.

Figure 1: An example of gadgets reducing TRVB to HCP.
(a) Unbroken.
(b) Broken.
Figure 2: An example of how the gadgets work.

Proof Outline of Theorem 4.

We first consider (possibly non-spanning) subgraphs of rectangular grid graphs, and then extend the result to spanning subgraphs. We reduce from Planar ({4},{1})-TRVB. The reduction is shown in Figure 3. The yellow rectangles represent breakable degree-4 vertices with exactly two local solutions, and the dead end represents a degree-1 unbreakable vertex. Each black edge is incident to at least one degree-2 vertex, so it must be included in the Hamiltonian cycle. We call these forced edges, while the red edges are optional. As mentioned above, blue faces are in the interior of the cycle, and yellow faces may be either in the interior or exterior depending on the choice of local solutions.

Having obtained an embedding of a TRVB instance into a directed grid graph, it remains only to fill the holes to make it a spanning subgraph. By appropriately placing the gadgets on a 2×2 aligned grid, the holes consist of 2×2 squares, represented by green squares in Figure 3. As shown in Figure 4, we can iteratively fill each 2×2 square hole by branching the tentacles of the adjacent cell. Thus, we can obtain a max-degree-3 spanning subgraph of a directed rectangular grid graph. This completes the reduction from Planar ({4},{1})-TRVB to HCP on max-degree-3 spanning subgraphs of directed rectangular grid graphs.

Figure 3: TRVB gadgets for subgraphs of directed grid graphs, showing two degree-4 breakable vertex gadgets connected by an edge and a degree-1 unbreakable vertex gadget.
Figure 4: Filling holes in the TRVB gadgets.

While a reduction for undirected graphs can be obtained by simply replacing the edges in the gadgets of Theorem 4 with undirected edges, we describe the alternative gadget utilized in the reference. A degree-3 vertex of a subgraph of an undirected grid graph has two collinear edges and one edge in the orthogonal direction. We call the former side edges. In this case, we can configure a gadget such that every degree-3 vertex is incident to a forced side edge.

Proof Outline of Theorem 5.

We reduce from Planar ({6},)-TRVB. The gadget is shown in Figure 5. Like the directed case, the blue tentacles are inside the cycle, and the yellow region may be either inside or outside the cycle, corresponding to whether the vertex is broken or not. The status of the green regions is inverted relative to the yellow regions; that is, if the yellow region is inside, the green region is outside, and vice versa. We connect the tentacles and fill holes in the same way as before. This yields the desired reduction. Indeed, every degree-3 vertex in this gadget is incident to a forced side edge.

Figure 5: A degree-6 breakable vertex gadget for subgraphs of undirected grid graphs.
 Remark 6.

By slightly modifying the hole-filling step, these two results can be extended to rectangular grid graphs with arbitrarily large even side lengths. In particular, we can embed a planar TRVB instance into a rectangular grid graph with side lengths of the form 2(22k1)/3 for a suitable, possibly distinct, integer k (in polynomial time).222It is easy to verify that the value 2(22k1)/3 is an even integer for any positive integer k.

3 Main Strategy

In order to prove the ASP-completeness of dynasty puzzles, we proceed in two main phases. In this section, we focus on the first phase: introducing concrete configurations of shaded cells and the desired functions of the gadgets. In the subsequent section, we address the second phase: showing how to realize these configurations under the rules of each puzzle.

3.1 Simulation of Grid Graphs

The first step of this phase involves simulating grid graphs and Hamiltonian cycles within dynasty puzzles. Figures 6(a) and 6(b) illustrate this simulation.

In Figure 6(a), the red, blue, and yellow cells collectively form an embedding of a grid graph. Within this embedding, the red and blue cells are forced to be shaded (except for the top light-red cell); specifically, the red cells correspond to the vertices of the grid graph, while the blue cells correspond to its faces. Its edges are represented by yellow 2×2 squares, each constrained to contain exactly two shaded cells. Each such square admits exactly two local solutions diagonally connecting either the red cells or the blue cells, corresponding to whether the edge is included in the Hamiltonian cycle or not (Figure 7).

This diagonal connectivity of the colored cells corresponds directly to the topological relationship between the vertices and the faces in the original grid graph: if the edge is in the cycle (Figure 7(a)), the two vertices are directly connected and the two faces are separated by that edge; otherwise (Figure 7(b)), the vertices are disconnected and the faces are connected (i.e., they are on the same side of the cycle).

Now we consider the local constraint that no diagonal chain of red cells terminates at a dead end, that is, no vertex has degree 1. This constraint, in fact, under the rules of dynasty puzzles, is equivalent to the red cells forming a Hamiltonian cycle on the grid graph (since the light-red cell acts as a break, ensuring that a Hamiltonian cycle on the grid graph does not form a loop of shaded cells). While the forward implication is straightforward, the converse is more subtle. Let us now examine this in detail. Suppose, for the sake of contradiction, that the red cells do not form a Hamiltonian cycle. Given the premise that no chain terminates at a dead end, the configuration of red cells is disconnected or, if connected, branches at some point (i.e., has degree at least 3 at some vertex). We consider these two cases separately: If the red cells were disconnected, we could choose a component that does not contain the light-red cell. Then, the blue cells surrounding this component would form a loop, violating the rule that all unshaded cells must form a connected region. Alternatively, if the connected red cells branched at some point, by elementary graph theory we could choose a loop that does not contain the light-red cell. Such a loop would partition the unshaded cells into interior and exterior regions, again violating the connectivity rules.

Figure 6(b) illustrates a configuration of local solutions that collectively form a Hamiltonian cycle. Here, the red cells constitute the resulting cycle, while the blue cells represent the connectivity of faces. As a result, the blocks of diagonally connected blue cells are partitioned by the red cycle into the interior and the exterior.

(a) Grid graph.
(b) Hamiltonian cycle.
Figure 6: An example of a simulation of grid graphs and Hamiltonian cycles on dynasty puzzles. The grid is rotated by 45 from the orthogonal orientation.
(a) Included in the cycle.
(b) Not included in the cycle.
Figure 7: Two possible local configurations for placing two shaded cells in a yellow 2×2 square. Each configuration corresponds to whether the edge is included in the Hamiltonian cycle or not.

3.2 Simulation of Gadgets from TRVB

The second step of this phase is to simulate the gadgets introduced in Section 2 using the framework described above. The color scheme in the gadgets discussed below is identical to that in Figure 6(a).

Figure 8(a) illustrates a configuration of a degree-4 breakable vertex gadget (originally shown in Figure 3) for dynasty puzzles. This gadget functions equivalently to the original, provided that the red cells form a Hamiltonian cycle. As discussed above, this condition is equivalent to the requirement that no diagonal chain of red cells terminates at a dead end. This requirement can be enforced locally; specifically, by constraining each pair of yellow 2×2 squares incident to a common red cell (vertex). Consequently, the reduction operates correctly through such local constraints.

Figure 8(b) illustrates a configuration of a degree-6 breakable vertex gadget (originally shown in Figure 5) for dynasty puzzles. Like the degree-4 gadget, this gadget functions equivalently to the original under the constraints on the pairs of yellow 2×2 squares discussed above. A key property of this configuration is that the squares in each constrained pair are orthogonally adjacent.

(a) Degree-4 breakable vertex.
(b) Degree-6 breakable vertex.
Figure 8: Examples of breakable vertex gadgets for dynasty puzzles. The grid is rotated by 45 clockwise from the orthogonal orientation.

4 ASP-Completeness of Puzzles

In this section, we present the realizations of the reduction for various dynasty puzzles.

The essential components of the reduction are shared across all puzzles: breakable vertices, tentacles, fillers, and apertures. The breakable vertex gadgets and the tentacle structures simulate the corresponding components of the reduction from TRVB to HCP, following the strategy described in Section 3. Specifically, the breakable vertex gadgets admit variable local states, whereas the tentacle structures are fixed. The filler patterns and the aperture structures are auxiliary fixed structures that ensure the parsimony and validity of the reductions.

As illustrated in Figure 6, the embedding of the grid graph into the puzzle board creates four triangular regions between the grid and the board border. The filler patterns are used to populate these regions. Next, consider the light-red cell at the top corner of the red loop (corresponding to the Hamiltonian cycle). This cell breaks the loop of shaded cells, preventing the unshaded cells of the interior and exterior from being disconnected. The aperture structure is used to realize this configuration appropriately for each puzzle. Since the Hamiltonian cycle in the embedded grid graph must visit both edges incident to the top corner vertex, the structures adjacent to the aperture (conceptually, the bottom-left and bottom-right sides of the light-red cell) are determined by fixed tentacles. Furthermore, the region exterior to the embedded grid is determined by the filler patterns. Thus, we construct the aperture structure by modifying the local constraints at this corner to accommodate the gap.

4.1 Guide Arrow

Guide Arrow is a type of dynasty puzzle originally designed by Naoki Inaba [6]. The standard rules of dynasty puzzles apply, together with the following additional rules [12]:

  1. 1.

    Cells with symbols (a star and arrows) must be unshaded.

  2. 2.

    The unshaded cells must form a single rooted tree.

  3. 3.

    A star denotes the root of the tree, and an arrow indicates the direction toward its parent cell.

In particular, this means that unshaded cells cannot form any 2×2 blocks, as such blocks would create cycles. An example of Guide Arrow is shown in Figure 9(a) and its (unique) solution is shown in Figure 9(b).333Playable at https://puzz.link/p?guidearrow/6/6/23nemegdjbhe.

(a) Instance.
(b) Solution.
Figure 9: An instance of Guide Arrow and its solution.

We reduce from Planar ({4},{1})-TRVB, considering the case of directed grid graphs. Light-green cells in Figures 10, 11, 12, 13, 15, and 15 represent cells forced to be unshaded.

Before constructing the gadget, we explain how to represent the directions of the edges in the cycle. First, let us consider the structural constraints of the diagonal chains of shaded cells. As illustrated in Figure 10, there are three topologically distinct configurations of the chains of shaded cells, depending on the directions of unshaded cells on both sides of them (except for cases involving the star). Specifically, these are parallel (Figure 10(a)), clockwise (Figure 10(b)), and counterclockwise (Figure 10(c)). These correspond to the edges, the interior faces, and the exterior face of the framework, respectively. In particular, the directions of unshaded cells in the parallel case correspond to the directions of the edges.

(a) Parallel/Cycle.
(b) Clockwise/Interior.
(c) Counterclockwise/Exterior.
Figure 10: The topological distinction of shaded cells and the correspondence to the framework.

We now present the actual configuration of gadgets. Figure 11 illustrates a concrete example of the configuration of tentacle gadgets. All cells in this gadget are determined unconditionally. Figure 12 illustrates the breakable vertex gadget. Let us show that the gadget admits exactly two local solutions. We first consider one of the chains of red cells in Figure 12, which is directed inward. By the rule governing the directions of unshaded cells, unshaded cells on both sides of the chain must not connect. Therefore, the chain must touch the border of the puzzle board. Since all four chains of red cells share this constraint, the chains do not connect to each other. Note that this constraint is independent of the global layout of the reduction. Under this constraint, it is guaranteed that the only valid solutions are the two depicted in Figure 13. These two solutions are topologically identical to the broken and unbroken states of the breakable vertex (such as Figure 2).

Figure 11: An example of the tentacle gadget in Guide Arrow and the corresponding graph elements.
Figure 12: Realization of the breakable vertex gadget in Guide Arrow. The red cells represent the shaded cells that are sandwiched between parallel unshaded cells toward the gadget.
(a) Unbroken.
(b) Broken.
Figure 13: Two local solutions of the breakable vertex gadget in Guide Arrow, corresponding to the states of the vertex.

Finally, we construct the auxiliary structures. Figure 15 illustrates the filler pattern. This pattern has a recursive structure, allowing it to fill a region whose diagonal length of shaded cells is 2k1. We can rotate this pattern as needed. By Remark 6, the side length of the embedded rectangular grid graph can be set to 2(22l1)/3 for a suitable integer l. It follows that the diagonal length of shaded cells in the triangular regions is 22l+11. Thus, we can fill these regions completely with this pattern. Figure 15 illustrates the aperture structure. This ensures that the shaded cells of both the cycle and the interior can reach the border, preventing the unshaded cells from forming a cycle. The star is placed at the opposite endpoint of the chain corresponding to the cycle.

Figure 14: Filler pattern in Guide Arrow.
Figure 15: Aperture structure in Guide Arrow.

The constructed reduction is parsimonious. Thus, we obtain the following theorem.

Theorem 7.

Guide Arrow is ASP-complete.

4.2 Aquapelago

Aquapelago is a type of dynasty puzzle originally designed by Walker Anderson. The standard rules of dynasty puzzles apply, together with the additional rule that unshaded cells must not form any 2×2 block. A number in a shaded cell indicates the size of its diagonally connected group of shaded cells [10]. An example of Aquapelago is shown in Figure 16(a) and its (unique) solution is shown in Figure 16(b).444Playable at https://puzz.link/p?aquapelago/8/8/2q3zu8j2j.k.

We reduce from Planar ({4},{1})-TRVB, considering the case of directed grid graphs. Light-green cells in Figures 17, 18, and 19 represent cells forced to be unshaded.

For the reduction, we prepare three distinct clue values, denoted by A, B, and C. These values correspond to the blocks of shaded cells in the exterior of the cycle, the cycle itself, and the interior of the cycle, respectively. We will show later that these values are well-defined.

Based on these clues, we construct the reduction. Figure 17 illustrates the breakable vertex gadget. Each undetermined 2×2 area must contain exactly two shaded cells to avoid forming a 2×2 block of unshaded cells, admitting exactly two local solutions. Moreover, assuming that A and C are distinct, the blocks of shaded cells with values A and C must not be connected, ensuring that no chain of shaded cells with value B terminates at a dead end. This behavior matches exactly the condition required for the gadget described in Section 3.2. The tentacles can be constructed by simply placing clues with values corresponding to the components of the grid graph.

(a) Instance.
(b) Solution.
Figure 16: An instance of Aquapelago and its solution.
Figure 17: Realization of the breakable vertex gadget in Aquapelago.

Figure 18 illustrates the filler patterns for the regions between the gadgets and the puzzle board border. We can rotate and reflect this pattern as needed. In light of Remark 6 and the configuration of the embedded grid, the diagonal chain of shaded cells has a period of length 6. The pattern in Figure 18 matches this period, and thus we can fill these regions completely. Next, we illustrate the aperture structure in Figure 19. This structure aligns with the filler pattern.

Figure 18: Filler pattern in Aquapelago.
Figure 19: Aperture structure in Aquapelago.

Finally, we determine the values A, B, and C. Let G be the spanning subgraph of a grid graph constructed from the embedding of the Planar ({4},{1})-TRVB instance, and let 2m and 2n be its dimensions. Every Hamiltonian cycle in G clearly consists of 4mn vertices and 4mn edges. Since each vertex corresponds to one cell and each edge to two cells, it follows that B=12mn1 (accounting for the aperture).

The core of the argument for A and C relies on the following well-known proposition.

Proposition 8.

Let G be a spanning subgraph of an m×n rectangular grid graph. Suppose G has at least one Hamiltonian cycle. Then, the area enclosed by any Hamiltonian cycle is mn/21.

In particular, since the interior faces induce a tree in the dual graph, the number of edges lying strictly inside the cycle is mn/22. For completeness, we provide the proof in Appendix A.

Applying Proposition 8, it follows immediately that C=6mn5. To determine A, we first consider the area outside the cycle. The total area of the entire grid graph is (2m1)(2n1) and the area inside the cycle is 2mn1; thus, the area outside the cycle is 2(m1)(n1). Since the regions outside the cycle connect with each other through the exterior of the grid and form a single tree (in the dual graph), the number of edges completely outside the cycle is 2(m1)(n1). These two facts imply that the number of cells corresponding to these faces and edges is 6(m1)(n1). Next, we consider the boundary of the embedded grid and the filler patterns. In Figure 18, for each side of the embedded grid with length 2l, the length of the diagonal chain of the shaded cells is 6l+1, and the chain is connected to 3l shaded cells in the filler. Since the entire grid graph is of size 2m×2n, the total number of such cells is 18(m+n)5 (accounting for the aperture). Summing these two values, we obtain A=6mn+12m+12n+1. This satisfies the assumption that A, B, and C are distinct.

The constructed reduction is parsimonious. Thus, we obtain the following theorem.

Theorem 9.

Aquapelago is ASP-complete.

4.3 Heyawake

Heyawake is a type of dynasty puzzle originally introduced in Puzzle Communication Nikoli Vol. 39. The board is divided into rectangular regions called rooms. The standard rules of dynasty puzzles apply, together with additional rules concerning the rooms. Specifically, a number in a room indicates the number of shaded cells in that room. Also, a straight line of unshaded cells must not span across three rooms (hereinafter referred to as the three-room constraint) [13]. An example of Heyawake is shown in Figure 20(a) and its (unique) solution is shown in Figure 20(b).555Playable at https://puzz.link/p?heyawake/8/8/b28i4gq6llc0733g1vo0s07g2g12h1h03i.

We reduce from Planar ({6},)-TRVB via the grid graph embedding. Light-green cells in Figures 21, 22, 23, 25, and 25 represent cells forced to be unshaded.

First, we describe the fixed structures used in the embedded grid graph. Figure 21 illustrates the fixed structures of the descending (top-left to bottom-right) orientation. There are two types of structures: vertical and horizontal. Each 1×1 room at the four corners of the structures corresponds to a vertex of the grid graph, and the (vertical or horizontal) 2×4 region consisting of six rooms corresponds to an edge of the grid graph. The structures of the ascending (bottom-left to top-right) orientation can be obtained by reflection. The entire embedding can be tiled by arranging these two types of structures alternately according to parity.

(a) Instance.
(b) Solution.
Figure 20: An instance of Heyawake and its solution.
(c) Vertical.
(d) Horizontal.
Figure 21: The fixed structures in Heyawake.

Based on these structures, we construct the embedding of the grid graph. Figure 22 illustrates the breakable vertex gadget. The validity of this gadget is verified as follows. Let us consider a 2×2 undetermined block structure shown in Figure 23(a). In each row, the two undetermined cells are flanked by unshaded cells across the room boundaries. Due to the three-room constraint, exactly one of the two undetermined cells in each row must be shaded. Consequently, the 2×2 block admits exactly two local diagonal configurations: either descending or ascending (Figure 23(b)). Furthermore, for any pair of adjacent blocks, their diagonal orientations must be consistent, as illustrated in Figure 23(c). This synchronization is again enforced by the three-room constraint; a mismatch would result in a line of unshaded cells spanning three rooms. This behavior matches exactly the condition required for the gadget described in Section 3.2.

The tentacles are constructed by simply placing fixed structures with the corresponding diagonal orientations (descending or ascending).

Figure 22: Realization of the breakable vertex gadget in Heyawake.
(a) Undetermined state.
(b) One local solution.
(c) Chain of solutions.
Figure 23: Local pattern in the breakable vertex gadget of Heyawake.

The filler pattern and the aperture structure are illustrated in Figures 25 and 25. The red 1×1 room in Figure 25 is inserted exclusively at the right corner of the embedded grid graph. The filler pattern admits a unique solution unconditionally, while the aperture admits a unique solution consistent with the solution of the remainder of the instance.

Figure 24: Filler pattern in Heyawake. The red 1×1 room can be arbitrarily inserted or removed.
Figure 25: Aperture structure in Heyawake.

The constructed reduction is parsimonious, and uses only clues of value 1. Thus, we obtain the following theorem.

Theorem 10.

Heyawake is ASP-complete, even if all clues are 1.

Furthermore, we observe that the solution structure is preserved even if we assign 0 to all rooms forced to be completely unshaded and remove all clues of 1. This leads to the following corollary.

Corollary 11.

Heyawake is ASP-complete, even if all clues are 0.

These results strengthen the ASP-completeness of Heyawake shown in [5].

4.4 Ayeheya

Ayeheya is a variant of Heyawake. The standard Heyawake rules apply, together with the additional rule that the shaded cells within each room must be point-symmetric with respect to the room’s center [11]. An example of Ayeheya is shown in Figure 26(a) and its (unique) solution is shown in Figure 26(b).666Playable at https://puzz.link/p?ayeheya/8/8/ikl6a2gk5180007nu07000fg23h1l.

(a) Instance.
(b) Solution.
Figure 26: An instance of Ayeheya and its solution.

While we can apply most gadgets in Section 4.3 directly to Ayeheya, we need to modify the breakable vertex gadget (Figure 22) to ensure the point symmetry condition. We replace each corner of the chain of the 2×2 blocks of undetermined cells in the gadget with the configuration shown in Figure 27. Specifically, we use the configuration in Figure 27(a) for the top-left corner, a 180-degree rotated version for the bottom-right corner, the configuration in Figure 27(b) for the top-right corner, and a 180-degree rotated version for the bottom-left corner.

(a) For the top-left and bottom-right corners.
(b) For the top-right and bottom-left corners.
Figure 27: The modifications of the breakable vertex gadget for Ayeheya. The breakable vertex gadget for Ayeheya is obtained by replacing each corner of Figure 22 with the corresponding configuration.

With this modification, the breakable vertex gadget satisfies the point symmetry condition and remains parsimonious. Thus, we obtain the following theorem.

Theorem 12.

Ayeheya is ASP-complete, even if all clues are at most 3.

4.5 Akichiwake

Akichiwake is a type of dynasty puzzle. The rules are identical to those of Heyawake, except that a number in a room indicates the maximum size of orthogonally connected blocks of unshaded cells in that room (without crossing the boundaries) [9]. An example of Akichiwake is shown in Figure 28(a) and its (unique) solution is shown in Figure 28(b).777Playable at https://puzz.link/p?akichi/8/8/jcr5h8a2gk00007f600c03vg23g1g6047g4.

(a) Instance.
(b) Solution.
Figure 28: An instance of Akichiwake and its solution.

We derive the reduction for Akichiwake from that of Heyawake by replacing every clue 1 with 0. Since all clues of value 1 in the Heyawake construction are placed within 1×1 rooms, this modification preserves the validity of the reduction. Specifically, both a 1×1 room with a clue 1 in Heyawake and a 1×1 room with a clue 0 in Akichiwake must be shaded. Hence, we obtain the following theorem.

Theorem 13.

Akichiwake is ASP-complete, even if all clues are 0.

4.6 Hitori

Hitori is a type of dynasty puzzle first introduced in Puzzle Communication Nikoli Vol. 29. The standard rules of dynasty puzzles apply. Each cell contains a number, and the goal is to shade some cells such that no number appears more than once in each row and column [14]. An example of Hitori is shown in Figure 29(a) and its (unique) solution is shown in Figure 29(b).888Playable at https://puzz.link/p?hitori/6/6/416253643251333162142365151421522634.

We reduce from Planar ({6},)-TRVB via the grid graph embedding. Light-green cells in Figures 30, 32, 32, 33, 35, and 35 represent cells forced to be unshaded.

To begin with, to enforce the configuration of shaded cells in the gadgets, we construct the two-cell-wide perimeter strip shown in Figure 30. On the outer region of the strip, shaded cells are placed in every other cell, while the inner region is entirely unshaded. In particular, the second row from the top is entirely unshaded, forcing this row to consist of distinct numbers. This forces any cell in the subsequent rows containing the same number as the second row (in the same column) to be shaded. We denote these fixed shaded cells by B, and assign a distinct number to each remaining fixed unshaded cell.

(a) Instance.
(b) Solution.
Figure 29: An instance of Hitori and its solution.
Figure 30: Perimeter strip for Hitori.

Next, we construct the reduction. Figure 32 illustrates the breakable vertex gadget. The validity of this gadget is verified as follows. Let us examine the two patterns illustrated in Figures 32 and 33. The former corresponds to the partial pattern appearing in the horizontal chain of 2×2 undetermined blocks, while the latter corresponds to that in the vertical chain.

We first explain the horizontal case illustrated in Figure 32(a). In this row, each number appears twice. Considering the rules of Hitori, unshaded numbers must be unique in each row; thus, at least one of these two instances must be shaded. On the other hand, due to the adjacency constraint of shaded cells, each of the left and right components can contain at most one shaded cell. Consequently, the pattern admits exactly two local configurations, as shown in Figures 32(b) and 32(c). Next, we explain the vertical case illustrated in Figure 33(a). Similarly, in each of the two columns, a number appears twice, necessitating that at least one instance is shaded. Combined with the adjacency constraint of shaded cells, it follows that the pattern admits exactly two local configurations, as shown in Figures 33(b) and 33(c).

Applying this result to each pair of adjacent undetermined blocks in the breakable vertex gadget, we verify that each block admits exactly two diagonal orientations of shaded cells (descending or ascending) and that these orientations must be consistent throughout the gadget. This behavior precisely matches the required condition. Since both global configurations are legal, the breakable vertex gadget is valid.

Figure 31: Realization of the breakable vertex gadget in Hitori. The numbers a to f are all distinct and do not appear elsewhere in the instance.
(a) Undetermined state.
(b) Solution 1.
(c) Solution 2.
Figure 32: Horizontal pattern in the undetermined structure.
(a) Undetermined state.
(b) Solution 1.
(c) Solution 2.
Figure 33: Vertical pattern in the undetermined structure.

The tentacles are constructed by simply placing the fixed shaded cells B. Figures 35 and 35 illustrates the filler pattern and the aperture structure. Since these structures touch the unshaded cells of the perimeter strip on the side illustrated by dotted grid lines, these structures admit a unique solution.

Figure 34: Filler pattern in Hitori. The red 1×1 room can be arbitrarily inserted or removed.
Figure 35: Aperture structure in Hitori.

The values of the clues are bounded by O(mn), where m,n are the dimensions of the embedded grid; thus, these configurations can be constructed in polynomial time. Thus, we obtain the following theorem.

Theorem 14.

Hitori is ASP-complete.

4.7 Kurodoko

Kurodoko is a type of dynasty puzzle first introduced in Puzzle Communication Nikoli Vol. 34. The standard rules of dynasty puzzles apply. A number indicates the total number of unshaded cells visible from that cell in (up to) four directions, including the cell itself [15]. An example of Kurodoko is shown in Figure 36(a) and its (unique) solution is shown in Figure 36(b).999Playable at https://puzz.link/p?kurodoko/8/8/j52y33p33y68j.

(a) Instance.
(b) Solution.
Figure 36: An instance of Kurodoko and its solution.

We reduce from Planar ({6},)-TRVB via the grid graph embedding. Black dots in Figures 37, 38, 40, and 40 represent cells forced to be unshaded.

The breakable vertex gadget is illustrated in Figure 37. The validity of this gadget is verified as follows: let us consider the local pattern illustrated in Figure 38(a). If either the cell above or below the two vertically aligned clues with value 3 were to remain unshaded, both right and left cells of the two 3s must be shaded to satisfy the clues. Now two shaded cells are adjacent vertically, which contradicts the rules. Thus, both the cells above and below the 3s must be shaded. Consequently, one unshaded cell extends either to the right or left direction from each 3. If these unshaded cells both extended in the same direction, again two shaded cells would be adjacent vertically. Therefore, this pattern admits exactly two configurations: Figure 38(b) and its reflection. Applying this logic to all 2×2 undetermined blocks in the gadget, we can see that the gadget functions as intended.

Figure 37: Realization of the breakable vertex gadget in Kurodoko.
(a) Undetermined state.
(b) One local solution.
Figure 38: Local pattern in the breakable vertex gadget of Kurodoko.

The tentacles are constructed by placing clues in all forced unshaded cells, except for those where the clue value would be 4. It can be verified that these clues indeed fix the structure. Figures 40 and 40 illustrates the filler pattern and the aperture structure. These structures admit a unique solution when combined with the tentacles.

Figure 39: Filler pattern in Kurodoko.
Figure 40: Aperture structure in Kurodoko.

Since the reduction uses no clues greater than 3, we obtain the following theorem.

Theorem 15.

Kurodoko is ASP-complete, even if all clues are at most 3.

References

  • [1] Jeffrey Bosboom, Erik D. Demaine, Martin L. Demaine, Adam Hesterberg, Roderick Kimball, and Justin Kopinsky. Path puzzles: Discrete tomography with a path constraint is hard. Graphs Comb., 36(2):251–267, 2020. doi:10.1007/S00373-019-02092-5.
  • [2] Erik D. Demaine and Mikhail Rudoy. Tree-Residue Vertex-Breaking: a new tool for proving hardness. In David Eppstein, editor, 16th Scandinavian Symposium and Workshops on Algorithm Theory, SWAT 2018, Malmö, Sweden, June 18-20, 2018, volume 101 of LIPIcs, pages 32:1–32:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPIcs.SWAT.2018.32.
  • [3] MIT Hardness Group, Josh Brunner, Lily Chung, Erik D. Demaine, Della H. Hendrickson, and Andy Tockman. ASP-completeness of hamiltonicity in grid graphs, with applications to loop puzzles. In Andrei Z. Broder and Tami Tamir, editors, 12th International Conference on Fun with Algorithms, FUN 2024, Island of La Maddalena, Sardinia, Italy, June 4-8, 2024, volume 291 of LIPIcs, pages 23:1–23:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.FUN.2024.23.
  • [4] Robert A. Hearn and Erik D. Demaine. Games, puzzles and computation. A K Peters, 2009.
  • [5] Markus Holzer and Oliver Ruepp. The troubles of interior design—a complexity analysis of the game Heyawake. In Pierluigi Crescenzi, Giuseppe Prencipe, and Geppino Pucci, editors, Fun with Algorithms, 4th International Conference, FUN 2007, Castiglioncello, Italy, June 3-5, 2007, Proceedings, volume 4475 of Lecture Notes in Computer Science, pages 198–212. Springer, 2007. doi:10.1007/978-3-540-72914-3_18.
  • [6] Naoki Inaba. Guide Arrow. Inaba’s Puzzle Laboratory, 2004. Accessed: 2025-12-14 (in Japanese). URL: http://inabapuzzle.com/honkaku/guide.html.
  • [7] Chuzo Iwamoto and Ryo Takaishi. Computational complexity of Yajisan-Kazusan and Stained Glass. IEICE Trans. Inf. Syst., 108(3):201–207, 2025. doi:10.1587/TRANSINF.2024FCP0004.
  • [8] Jonas Kölker. Kurodoko is NP-complete. J. Inf. Process., 20(3):694–706, 2012. doi:10.2197/IPSJJIP.20.694.
  • [9] Rules of akichiwake. URL: https://puzz.link/rules.html?akichiwake.
  • [10] Rules of aquapelago. URL: https://puzz.link/rules.html?aquapelago.
  • [11] Rules of ayeheya. URL: https://puzz.link/rules.html?ayeheya.
  • [12] Rules of guide arrow. URL: https://puzz.link/rules.html?guidearrow.
  • [13] Rules of heyawake. URL: https://puzz.link/rules.html?heyawake.
  • [14] Rules of hitori. URL: https://puzz.link/rules.html?hitori.
  • [15] Rules of kurodoko. URL: https://puzz.link/rules.html?kurodoko.
  • [16] Takayuki Yato and Takahiro Seta. Complexity and completeness of finding another solution and its application to puzzles. IEICE Trans. Fundam. Electron. Commun. Comput. Sci., 86-A(5):1052–1060, 2003. URL: http://search.ieice.org/bin/summary.php?id=e86-a_5_1052.

Appendix A Proof of Proposition 8

Proposition 8. [Restated, see original statement.]

Let G be a spanning subgraph of an m×n rectangular grid graph. Suppose G has at least one Hamiltonian cycle. Then, the area enclosed by any Hamiltonian cycle is mn/21.

We present three different proofs.

Proof 1.

Let C be a Hamiltonian cycle. Consider the dual grid formed by the centers of the m×n unit cells. We regard C as a cycle on this dual grid and orient it counterclockwise. Within each unit cell, C either proceeds straight, turns left (90), or turns right (90). Recall that the interior of C lies to its left. The portion of a unit cell lying inside C has area 1/2 when C proceeds straight, 1/4 when it turns left, and 3/4 when it turns right. Since C is a simple closed curve, it makes exactly four more left turns than right turns. Note that a left turn contributes 1/4 less to the enclosed area than a straight passage (1/2), while a right turn contributes 1/4 more. Therefore, summing over all mn cells, the total area is

mn214×4=mn21.

Proof 2.

Let C be a Hamiltonian cycle, and let H be the subgraph of the grid graph consisting of C and all edges lying in its interior. Let ein and f denote the number of interior edges and the number of bounded faces of H, respectively. The number of vertices is mn, and the number of edges on the boundary (i.e., edges of C) is also mn. Summing the edges incident to each face, we have

4f=mn+2ein,

since each bounded face is a square (incident to 4 edges), each boundary edge is incident to one bounded face, and each interior edge is incident to two. Meanwhile, by Euler’s formula, we have

mn(mn+ein)+(f+1) =2,
ein =f1.

Substituting this into the first equation, we obtain

4f =mn+2(f1),
f =mn21.

The third proof follows immediately from Pick’s theorem.

Theorem 16 (Pick).

Let P be a simple polygon with integer vertex coordinates. Let b and i denote the numbers of lattice points on the boundary and in the interior of P, respectively. Then its area is given by

i+b21.

Proof 3.

Regard the Hamiltonian cycle as a simple polygon with integer vertex coordinates. It passes through all mn vertices of the grid graph, so there are mn lattice points on its boundary and no lattice points in its interior. By Pick’s theorem, the area is 0+mn/21=mn/21.