RRikudo is NP-complete
Viet-Ha Nguyen a and K´evin Perrot a,ba Univ. Cˆote d’Azur, CNRS, Inria, I3S, Sophia Antipolis, France b Aix-Marseille Univ., Univ. de Toulon, CNRS, LIS, Marseille, France
Abstract
Rikudo is a number-placement puzzle, where the player is asked to complete aHamiltonian path on a hexagonal grid, given some clues (numbers already placedand edges of the path). We prove that the game is complete for NP , even if thepuzzle has no hole. When all odd numbers are placed it is in P , whereas it is still NP -hard when all numbers of the form 3 k + 1 are placed. We discovered
Rikudo in the game column of local newspaper
Le Progr`es . It has beenimagined a few years ago by two French guys, Paul and Xavier, willing to offer a newchallenge to
Sudoku lovers[1]. The study of the computational complexity of games isquite a tradition now [2, 4, 5, 6, 10, 11, 12, 13, 15, 16, 17], and we could not resist tostate these results. Even if they are not highly technical, some are not trivial.The game consists in placing numbers from 1 to n on the cells of a hexagonal grid,so that the sequence forms a Hamiltonian path (successive numbers must be placed onadjacent cells). Furthermore, some numbers are already placed, and some adjacenciesare given so that the path must follow them.In Section 2 we present the theoretical modelization of Rikudo and the problemsof solving such puzzles, which are proven to be NP -hard in Section 3. Given that thereductions do not make use of numbers already placed on the grid, Section 4 discussesthe complexity under the additional constraint that some fixed fraction α of the numbersare already placed, or that all numbers of the form xk + 1 are already placed for somefixed integer k . As for
Sudoku , every
Rikudo instance one finds in newspapers are solvable. In order tomodel it as a decision problem in complexity theory, we have to create some negativeinstances ( i.e. games that do not admit any solution), and also to create games ofarbitrary size. The original game can be played at .1 a r X i v : . [ c s . D M ] J a n Figure 1: Two examples of
Rikudo games. Player is asked to complete a Hamiltonianpath of numbers ( (cid:33) s ) on a subset of cells ( τ ) from the hexagonal grid (from 1 to n = 61 on the left, from 1 to n = 85 on the righ), given some numbers already placed( m ), following edge-to-edge adjacencies ( ), and respecting the ones indicated by a circle( p ). Solutions in Appendix A.Let us consider the hexagonal grid with pointy orientation , and denote C the set ofcells. Given a subset τ ⊂ C , we associate the loopless graph G τ on vertex set τ withadjacency relation corresponding to pairs of cells sharing an edge. We say that τ is connected whenever G τ is connected. A Rikudo game is a connected finite subset of cells τ and, with n = | τ | and [ n ] = { , . . . , n } , • a partial injective map m : τ → [ n ] (numbers already placed), • a subset of the adjacency relation p ⊆ (given adjacencies).A solution is a bijective map s : τ → [ n ] such that, with symmetric binary relation (cid:33) s on C defined as c (cid:33) s c (cid:48) ⇐⇒ | s ( c ) − s ( c (cid:48) ) | = 1, • (cid:33) s ⊆ (the sequence of numbers forms a Hamiltonian path in G τ ), • s ( c ) = m ( c ) for all cells c in the domain of m (respect given numbers), • p ⊆ (cid:33) s (respect given adjacencies).See some examples on Figure 1.The main problems we are interested in are: Rikudo
Input: a game ( τ, m, p ). Question: does it admit a solution?
Rikudo without holes
Input: a game ( τ, m, p ) such that G C\ τ is connected. Question: does it admit a solution?Observe that both problems are trivially in NP . Let us recall that hexagonal grids follow one of two orientations: pointy or flat . Figure 2: Reduction from
HCH (graph in blue) to
Rikudo , with n = 43. NP -hardness Both reductions will be made from a closely related problem, namely of deciding theexistence of a Hamiltonian cycle in a hexagonal grid graph. In order to avoid ambiguity,we call the six “vertices” of a hexagonal cell, its six corners . A hexagonal grid graph isgiven by a vertex set that is a subset of corners from a unit side length regular hexagonaltiling of the plane, and whose edge set connects vertices that are one unit apart. Theproblem is called
Hamiltonian circuits in hexagonal grid graphs ( HCH ), knownto be NP -complete [8]. Without loss of generality we will consider that the instances of HCH have only vertices of degree two and three (no vertex of degree one).
Theorem 1. Rikudo is NP -hard, even when p = ∅ and m has domain dom ( m ) = { , n } .Proof. The reduction from
HCH is almost trivial, by noting that any hexagonal gridgraph H equals some G τ . Note that the vertices of H correspond to corners of thehexagonal cells, whereas the vertices of G τ correspond to the cells themselves. To aligntwo such graphs, one may consider the graph H from the hexagonal grid with flatorientation, scale up H by a factor of √
3, and align its vertices with the center of cellsin the pointy hexagonal grid to play
Rikudo .The reduction (see Figure 2) then simply consists in the game ( τ, m, p ) with τ theset of cells hosting a vertex of H , p = ∅ , and m defined on only two cells t, t (cid:48) ∈ τ , chosensuch that t t (cid:48) and t has degree 2 in G τ (such a cell always exists), as m ( t ) = 1 and m ( t (cid:48) ) = n where n is the number of vertices in H . We have H = G τ and the Hamiltonianpath of Rikudo is enforced to be a cycle by m , hence the HCH and
Rikudo instancesare identical.The restriction on p and m in Theorem 1 motivates the consideration of Rikudowithout holes , which seems closer to the spirit of the “real”
Rikudo game and requiresmore advanced constructions.
Theorem 2. Rikudo without holes is NP -hard.Proof. Let H be an instance of HCH . Without loss of generality we can consider thatthe vertices of H have degree two or three (hexagonal grid graphs have degree at most3 n Figure 3: Reduction from
HCH (graph in blue) to
Rikudo without holes . Vertexgadgets are hatched in green, edge gadgets are dotted in blue, holes are filled in grey(with the absent vertex and edge gadgets slightly marked) and the Hamiltonian pathsof holes are highlighted in purple. In this example, n = 272.three, and if H has a vertex of degree one then it is trivially impossible to have aHamiltonian cycle). We construct the game ( τ, m, p ) as follows (see Figure 3). First,take H with flat orientation, scale it up by a factor of 2 √
7, rotate it counterclockwiseby an angle of arctan √ , and align its vertices with the common corners of three cellsin the pointy hexagonal grid to play Rikudo . We have that each vertex v of H is at thecorner of three cells c ( v ) , c ( v ) , c ( v ) of the game, and that the middle of each edge e of H is at the center of a cell c ( e ) of the game. Let c ( v ) (respectively c ( v ); c ( v )) denotethe cell adjacent to both c ( v ) , c ( v ) (respectively c ( v ) , c ( v ); c ( v ) , c ( v )) which is not c ( v ) (respectively c ( v ); c ( v )). For all v the six cells c ( v ) , . . . , c ( v ) form an upwardor downward triangle. Consider the set of cells τ (cid:48) obtained by: • for each vertex v of H , add c ( v ) , c ( v ) , c ( v ) , c ( v ) , c ( v ) , c ( v ) to τ (cid:48) , and call thissubset of six cells a vertex gadget ; • for each edge e of H , add the cell c ( e ) to τ (cid:48) , and call this cell an edge gadget .The cells from each finite connected component of G C\ τ (cid:48) is called a hole of τ (cid:48) . The set τ is obtained from τ (cid:48) by adding all the holes of τ (cid:48) . This ensures that G C\ τ is connected.The set of adjacencies p is build from a Hamiltonian path on each hole of τ (cid:48) , whichrequires some additional definitions (see Figure 4). The holes of τ (cid:48) are made of threetypes of cells: v-cells which may have been part of a vertex gadget, e-cells which may have4een part of an edge gadget, and h-cells the remaning cells. For a letter x ∈ { v , h } wecall x-component a connected component of x-cells in G τ (cid:48)(cid:48) . Note that each v-componenthas 6 cells, and each h-component has 13 cells. Given a hole τ (cid:48)(cid:48) of τ (cid:48) , we define the graph H τ (cid:48)(cid:48) whose vertices are the v- and h-components of G τ (cid:48)(cid:48) , and such that two componentsare adjacent when two of their cells are. Remark that H τ (cid:48)(cid:48) is a bipartite connected graph,since we have not considered e-cells. Now we attach each e-cell to a v-component vertexof H τ (cid:48)(cid:48) adjacent to it, according to some map ϑ from the e-cells to the v-components of G τ (cid:48)(cid:48) . For any vertex v of H and the associated vertex gadget, we call each of the followingcouples of cells an access : ( c ( v ) , c ( v )), ( c ( v ) , c ( v )), ( c ( v ) , c ( v )). We associate to τ (cid:48)(cid:48) a set of adjacent accesses , which are the vertex gadget’s access whose cells are adjacentto cells of τ (cid:48)(cid:48) . Among these, the canonical access of τ (cid:48)(cid:48) is the maximal one accordingto some fixed direction ( e.g. the leftmost in our figures). Accesses will be used toplug partial paths together, and we extend their definition to the v-components of τ (cid:48)(cid:48) .Finally, given τ (cid:48)(cid:48) and an adjacent access α , let T ατ (cid:48)(cid:48) be a rooted spanning tree of H τ (cid:48)(cid:48) ,whose root is the h-component of τ (cid:48)(cid:48) adjacent to α (observe that there is a unique suchh-component). Given a vertex t of H τ (cid:48)(cid:48) which is a h-component, let τ (cid:48)(cid:48) [ t ] be the subsetof τ (cid:48)(cid:48) corresponding to the subtree of T ατ (cid:48)(cid:48) rooted at t . We build the Hamiltonian path P ατ (cid:48)(cid:48) along T ατ (cid:48)(cid:48) , from one of the access cell of α to the other, recursively as follows. • For the root r of T ατ (cid:48)(cid:48) , which is a h-component, build the h-basepath depicted onthe left of Figure 5, rotated in order to fit the access α . • For each child s of r , which is a v-component, build the v-basepath depicted on theright of Figure 5, including its associated e-cells t such that ϑ ( t ) = s . • For each child t of s , consider the access β of s to which t is adjacent, and buildrecursively a Hamitlonian path P βτ (cid:48)(cid:48) [ t ] along the subtree T βτ (cid:48)(cid:48) [ t ] . • Finally, plug the pieces together at accesses, by operating the flips illustrated onFigure 6. Remark that by the construction of h-basepath and v-basepath, theseflips are always possible.Now consider, for each hole τ (cid:48)(cid:48) of τ (cid:48) , the path T ατ (cid:48)(cid:48) with α the canonical access of τ (cid:48)(cid:48) , andadd the adjacencies of this path to p .For m , choose an access ( t, t (cid:48) ) of some vertex gadget corresponding to a vertex of H of degree two, such that t, t (cid:48) do not appear in p , and set m ( t ) = 1, m ( t (cid:48) ) = n with n thetotal number of cells in τ .If a cell belongs to two elements of p , i.e. has two enforced adjacencies, then anyHamiltonian path from 1 to n crosses this cell along these adjacencies. Thus, as aconsequence of the definition of p , the game ( τ, m (cid:48) , p ) is equivalent (in terms of decision)to the game ( τ (cid:48) , m (cid:48) , p (cid:48) ), where m (cid:48) is the same as m except that m ( t (cid:48) ) = n (cid:48) with n (cid:48) thetotal number of cells in τ (cid:48) , and where p (cid:48) are the couples of canonical access cells in vertexgadgets for each hole of τ (cid:48) (see Figure 7).Now let us argue that H has a Hamiltonian cycle if and only if the game ( τ (cid:48) , m (cid:48) , p (cid:48) )has a solution. If H has a Hamiltonian cycle, then it is straightforward to constructa solution to the game ( τ (cid:48) , m (cid:48) , p (cid:48) ) respecting the adjacencies given by p , as shown onFigure 8, by starting from the vertex gadget hosting numbers 1 , n and following theHamiltonian cycle on H : for each vertex gadget, construct a Hamiltonian path from on5igure 4: Example construction of p from a Hamiltonian path for one hole τ (cid:48)(cid:48) . Thefunction ϑ is illustrated on each e-cell t with an arrow pointing towards the v-component ϑ ( t ), v- e- and h-cells have slightly marked patterns, v- and h-components hold an orangenode of H τ (cid:48)(cid:48) , edges of a spanning tree T ατ (cid:48)(cid:48) are drawn in orange with the canonical access α hatched in red. Top: the h- and v-basepaths before the flips. Middle: the Hamiltonianpath P ατ (cid:48)(cid:48) obtained after the flips. Bottom: the corresponding adjacencies in p .6igure 5: Left: in purple the h-basepath according to the (canonical) access hatchedin red, other accesses are hatched in pink. Right: in purple the v-basebaths accordingto the number of e-cells attached to the v-component, the three accesses are hatched inthree different colors.Figure 6: Flips operated in order to connect h-basepath and v-basepath (on a downwardtriangle without e-cell in this example), the h-component cells are filled in grey and thev-component access in hatched in cyan. The location of the flip is highlighted. Left:from a h-basepath parent to a v-basepath child. Right: from a v-basepath parent to ah-basepath child. 7 n Figure 7: Game ( τ (cid:48) , m (cid:48) , p (cid:48) ) equivalent to ( τ, m, p ) from Figure 3. n Figure 8: A solution to the game ( τ (cid:48) , m (cid:48) , p (cid:48) ) with only the Hamiltonian path from 1 to n depicted in purple, and the corresponding Hamiltonian cycle on G in red.8 n Figure 9: Hamiltonian path for all the possibilities of vertex and edge gadgets combi-nation (up to rotation), in order to build a solution to the instance ( τ (cid:48) , m (cid:48) , p (cid:48) ) from aHamiltonian cycle on H .edge gadget to the other, and include the third edge gadget to the path if it has notbeen included so far (recall that the vertices of H have degree two or three); the vertexgadget hosting numbers 1 , n has a special pattern (it always corresponds to a vertexof H of degree two). Note that the use of canonical accesses ensures that each vertexgadget has at most one access in p (cid:48) . All the possibilities are presented on Figure 9.If the game ( τ (cid:48) , m (cid:48) , p (cid:48) ) has a solution s , then the order of vertex gadgets induced by (cid:33) s gives a Hamiltonian path in H : • it is only possible to go from one vertex gadget to another vertex gadget by goingover an edge gadget, hence adjacencies of H are respected, • an edge gadget consists of only one cell, thus we cannot use twice an edge of H ,and the degree of every vertex in H is two or three; it follows that we cannot visittwice a vertex of H .Since a solution to the game includes all cells ( i.e. all vertex gadgets) and goes back tothe starting vertex gadget thanks to the positions of 1 and n given by m (cid:48) , we concludethat the corresponding cycle on H is Hamiltonian. Remark 1.
It is a result of [14] that a h-component corresponds to the only finite,2-connected, linearly convex, subgraph of the Archimedean triangular tiling (the graphobtained from the hexagonal grid cells with adajcencies ) which do not have a Hamilto-nian cycle; but in our construction we only need Hamiltonian paths on h-components.
Remark 2.
With almost trivial adaptations of the proof of Theorem 2, one can alsoobtain the NP -hardness when the shape of the game is a hexagon (as on the left ofFigure 1), and with one missing cell at the center, such as in “real” rikudo games. The hardness proofs presented in Section 3 reduce from Hamiltonian cycle problems,and we (almost) do not use the already placed numbers given by m (intuitively, becauseit would have required to have some prior knowledge on the path). It is therefore natural9o ask whether Rikudo games may become easier to solve when it is imposed that somenumbers are initially placed by m ? Given that the reduction leading to Theorem 2 let m have domain dom ( m ) = { , n } , we straightforwardly have that the following variantis still NP -hard. α -Rikudo without holes (for some real constant 0 < α ≤ Input: a game ( τ, m, p ) such that | dom ( m ) | ≥ αn with n = | τ | . Question: does it admit a solution?Indeed, one can construct a game for some n (cid:48) and then do some padding, by placingwith m all the numbers from n (cid:48) + 1 until n = (cid:100) n (cid:48) α (cid:101) .The following question is then of particular interest. k -Rikudo (for some integer constant k ≥ Input: a game ( τ, m, p ) such that dom ( m ) = { xk + 1 | x ∈ N } ∩ [ n ] with n = | τ | . Question: does it admit a solution?In words, it imposes that m places the numbers 1 , k +1 , k +1 , k +1 , . . . i.e. one numberevery k numbers. The total fraction | dom ( m ) | n approaches k , but contrary to α -Rikudo the repartition of numbers is constrained. In the case k = 2 all odd numbers are alreadyplaced and the problem turn out to be in P (Theorem 3), whereas we prove that it is NP -hard for k = 3 (Theorem 4). Theorem 3. 1-over-2-Rikudo is in P .Proof. The holes do not matter in this simple reduction to . Given a game ( τ, m, p )with all odd numbers placed, it is an easy observation that for any pair of already placedintegers x, x + 2 there are at most two possible positions for the number x + 1. Thereduction goes as follows: start by placing all (even) numbers having a unique possibleposition until no such number exist (it corresponds to performing unit propagation).Then for all remaining (even) numbers x , create two variables v x and v x correspondingto the two possible positions. Construct a formula having the following clauses: • v x ∨ v x for each remaining (even) number x , • ¬ v ix ∨ ¬ v jy for each pair of variables corresponding to the same position.The variable creation ensure that the numbers form a path, the first set of clauses ensurethat all remaining numbers are placed, and the second set of clauses ensure that no twonumbers are placed at the same position. Theorem 4. 1-over-3-Rikudo is NP -hard.Proof. We present a reduction from the problem
Planar 1-in-3-SAT (clauses of sizethree, satisfied by exactly one literal), which is proven to be NP -hard in [3]. A formula φ in conjunctive normal form (CNF) is planar when so is the bipartite graph G φ havingone vertex for each variable of φ , one vertex for each clause of φ , and an edge betweena variable x i and a clause c j whenever x i appears in c j . From a planar 3-CNF formula φ (checking planarity can be done in linear time [7]), we slightly modify the graph G φ while preserving planarity: each variable vertex x i is replaced by a binary tree (called10 x x x ¬ ¬ c c Figure 10: Example embedding of the planar formula φ = ( x ∨¬ x ∨ x ) ∧ ( x ∨¬ x ∨ x )and its graph G φ into a flat hexagonal grid. Variables in blue (choice-cells), binary treesin purple (duplicate-cells), negations in red (negation-cells), clauses in orange (clause-cells), edges in green (wire-cells). variable tree ) having as many leaves as occurrence of x i in φ , and each of these leavesis connected to one clause in which x i appears. We also add a negation vertex betweenvariable x i and clause c j if x j appears as ¬ x i in c j . We consider a planar embeddingof this new graph G φ into the graph underlying a flat hexagonal grid ( i.e. vertices of G φ are cells of the grid, and edges follow cell to cell adjacencies). Such an embeddingcan easily be computed in polynomial time (see [9, 18] for reference, but naive greedymethods are enough for our purpose). Finally, for technical reasons to be explained laterin this proof, we scale up the obtained graph on the hexagonal grid by a factor of two.See Figure 10 for an example.A Rikudo game is obtained by replacing each cell of the embedding of G φ by amacrocell for the game, depending on the content of this cell. We distinguish five typesof cells, and five corresponding types of macrocells. The game macrocells are formallydefined on a subset of cells forming a flat hexagon of side length 9, which are assembledside by side to form a Rikudo game. On the sides one row of cells from adjacent macrocellsare merged. Illustrations are presented on Figure 11.
Remark.
When we refer to a solution of a macrocell, we mean to place all the numbersbetween the endpoints of its subpath(s) of numbers (macrocells have one, two or threesubpaths). Furthermore, a solution must place numbers on all game cells within themacrocell ( i.e. except possibly on its sides, precisions are given in the next remark oninput bit). Indeed, if this is not the case then cells left empty within a macrocell will beleft empty in the solution obtained by the assembly of macrocells’ solutions. • The root of each variable tree is called a choice-cell , its macrocell admits two kindsof solutions corresponding to true and false (one bit ). In each solution one of thetwo cells on the top side hosts a number, and the other one does not: in the true solutions the left cell contains a number and the right cell does not, whereas in11he false solutions the left cell does not contain a number and the right cell does.Remark that this is the convention for an output bit, for an input bit it is reversed.
Remark.
More generally, the input and output bits of a macrocell are defined as follows.Let us call number-cell a cell where a number is already placed ( i.e. in dom ( m ) ), and game-cell a cell where the player will place a number ( i.e. in τ \ dom ( m ) ).Consider the row of cells on an output side . In the clockwise order, it has: onenumber-cell, one game-cell A , one number-cell, and one game-cell B . A true (respectively false ) output bit corresponds to cell A (respectively B ) containing a number from thismacrocell, whereas cell B (respectively A ) does not.Symmetrically, consider the row of cells on an input side . In the clockwise order, ithas: one game-cell B , one number-cell, one game-cell A , and one number-cell. A true (respectively false ) input bit corresponds to cell A (respectively B ) containing a numberfrom the adjacent macrocell, whereas cell B (respectively A ) does not. As a consequence,a solution to this macrocell must place a number in cell B (respectively A ), but not incell A (respectively B ).Also observe that the merge of an input side with an output side matches the positionof game-cells and numbers-cells. The assembly of macrocells will be precised just afterthe presentation of all macrocells. • An internal node of a variable tree is called a duplicate-cell , given an input bit onthe bottom side its macrocell admits only solutions which copy this bit to the topleft and top right sides (it has one input and two outputs). In a solution eachvariable tree therefore has the same bit on all its leaves. • A negation vertex is called a negation-cell , given an input bit on the bottom sideits macrocell admits only solutions which flip this bit to the top side (it has oneinput and one output). • A clause vertex is called a clause-cell , it has a solution if and only if exactly oneof the three input bits on its sides is true (it has three inputs). • All other non-empty cells are called wire-cells , given an input bit on one side themacrocells admit only solutions which copy this bit to the other side (it has oneinput and one output).These claims can easily be verified by hand on the figures from Appendix B, for theinterested reader. Macrocells can be rotated (but not reflected, since this corrupts thesubpaths merging). Note that a bit of information reads differently as an input and asan output of a macrocell, and that the subpath endpoints are placed accordingly so thatan output merges an input. Macrocells are directed as the graph G φ from Figure 10.Let us now give precisions on how macrocells are assembled, so that the obtainedgame may have a solution forming only one long path from 1 to n (made by connecting allmacrocell’s subpaths together). One bit of information is transported by two subpathsof numbers. The game path will simply follow the Eulerian path on the doubling tree associated to a spanning tree of G φ . The numbers already placed on two adjacent The doubling tree consists in replacing each edge of the tree by two copies of itself, hence the Eulerianpath corresponds to walking along the contour of the spanning tree.
363 3369 302712 15 2418 21
Choice-macrocell Duplicate-macrocell Negation-macrocell Clause-macrocell Wire-macrocell
72 69 66 63 60 57 54 5148 45 4218
42 39 36 33 30 27 24 2145
21 18 15 12 9 6 3075 Wire-macrocells
Figure 11: Macrocell types, with the rows merged with the adjacent macrocell hashed inred (input/output). Distinct subpaths of numbers are marked with x , x (cid:48) and x (cid:48)(cid:48) startingat 0, 0 (cid:48) and 0 (cid:48)(cid:48) respectively. Choice-macrocell (output on the top), duplicate-macrocell(one input on the bottom and two outputs), negation-macrocell (input on the bottomand output on top), clause-macrocell (three inputs), straight wire-macrocell (input onthe bottom and output on top), and four bending wire-macrocells assembled (from inputon left to output on right). 13acrocells are identified at the merged row of cells on the common side: we can shiftthe numbers on each subpath of one macrocell to match the other, and reverse somesubpath of numbers to be coherent relative to the increasing/decreasing order (in thewalk on the spanning tree the orders of the subpaths of a bit are typically opposite). Onelast macrocell is required for wire-cells corresponding to edges not part of the spanningtree: a cutter-macrocell replaces one of the straight wire-cell on these edges (hence thefactor two scaling creating a straight wire-cell on every edge). See the left of Figure 12,the cutter-macrocell copies the bit from the bottom side to the top side, but the twosubpaths are shunted differently. Finally we choose some start (number 1) and stop(number n ) on a remaining straight wire-cell, as presented in the start-macrocell on theright of Figure 12. Figure 13 presents a spanning tree and the way subpaths of alreadyplaced numbers are assembled.The construction is finished. If φ has a solution then we choose a satisfying assign-ment for the bits of the choice-macrocells, which are copied by duplicate-macrocells andtransported by wire-cells to the clause-macrocells, each of these later having a solution(and the whole play forms a path from 1 to n as detailed in the previous paragraph). If φ has no solution then for any assignment for the bits of the choice-macrocells, these bitsare copied by duplicate-macrocells and transported by wire-macrocells to the clause-macrocells, and at least one of the clause-macrocells does not have exactly one true among the three bits on its input sides, hence the game has no solution.We strongly believe that k -Rikudo is also NP -hard for any k ≥ Rikudo games (we havenegation-macrocells to perform cross-over, and clause-macrocells use some disjunctionand conjunction of bits). The game has some more variants ( e.g. with indications insome cells of the parity of the number to be placed), and it would be interesting to studyhow these new features may or may not embed complexity, i.e. in some sense whethermore clues make the game easier or not.
Acknowledgments
The authors are thankful to Papicri for bringing those games almost daily during FranceCOVID-19 first lockdown.
References [1] Rikudo: dossier de presse. . Ac-cessed December 1st, 2020.[2] J.-F. Baffier, M.-K. Chiu, Y. Diez, M. Korman, V. Mitsou, A. van Renssen,M. Roeloffzen, and Y. Uno. Hanabi is NP-complete, Even for Cheaters who Look14 Figure 12: Cutter-macrocell (left, input on the bottom and output on top) and start-macrocell (right, input on the bottom and output on top, the start is 1 and stop is 12 (cid:48) ,the three subpaths may be shifted independently), replacing straight wire-cells. x x x x ¬ ¬ c c cutterstart Figure 13: Spanning tree and the way subpaths of already placed numbers are as-sembled, for the graph G φ from Figure 10. Blue arrows follow the increasing order ofnumbers, with the start-macrocell and cutter-macrocells (there is only one in this ex-ample) highlighted in red. Starting from number 1 on the start-macrocell, we follow theblue arrows to assign subsequent number sequences to the macrocells’ subpaths, leadingto a unique path from 1 to n (if all macrocells admit a solution).15t Their Cards. In Proceedings of FUN’2016 , volume 49 of
LIPIcs , pages 4:1–4:17,2016.[3] M. E. Dyer and A. M. Frieze. Planar 3DM is NP-complete.
Journal of Algorithms ,7(2):174–184, 1986.[4] S. Even and R. E. Tarjan. A combinatorial problem which is complete in polynomialspace. In
Proceedings of STOC’1975 , pages 66–71, 1975.[5] A. S. Fraenkel, M. R. Garey, D. S. Johnson, T. Schaefer, and Y. Yesha. Thecomplexity of checkers on an N times N board. In
Proceedings of SFCS’1978 , pages55–64, 1978.[6] L. Gual`a, S. Leucci, and E. Natale. Bejeweled, Candy Crush and other match-threegames are (NP-)hard. In
Proceedings of IEEE CIG’2014 , pages 1–8, 2014.[7] J. Hopcroft and R. Tarjan. Efficient planarity testing.
Journal of the ACM ,21(4):549–568, 1974.[8] K. Islam, H. Meijer, Y. N´u˜nez, D. Rappaport, and H. Xiao. Hamilton circuits inhexagonal grid graphs. In
Proceedings of CCCG’2007 , pages 85–88, 2007.[9] G. Kant. Hexagonal grid drawings. In
Proceedings of WG’92 , volume 657 of
LNCS ,pages 263–276, 1993.[10] R. Kaye. Minesweeper is NP-complete.
The Mathematical Intelligencer , 22(2):9–15,2000.[11] M. Lampis and V. Mitsou. The Computational Complexity of the Game of Set andIts Theoretical Applications. In
Proceedings of LATIN’2014 , volume 8392 of
LNCS ,pages 24–34, 2014.[12] D. Lichtenstein and M. Sipser. GO Is Polynomial-Space Hard.
Journal of the ACM ,27(2):393–401, 1980.[13] V.-H. Nguyen, K. Perrot, and M. Vallet. NP-completeness of the game Kingdomino.
Theoretical Computer Science , 822:23–35, 2020.[14] J. R. Reay and T. Zamfirescu. Hamiltonian Cycles in T-Graphs.
Discrete & Com-putational Geometry , 24:497–502, 2000.[15] S. Reisch. Gobang ist PSPACE-vollst¨andig.
Acta Informatica , 13:59–66, 1980.[16] S. Reisch. Hex ist PSPACE-vollst¨andig.
Acta Informatica , 15:167–191, 1981.[17] A. Scott, U. Stege, and I. van Rooij. Minesweeper May Not Be NP-Complete butIs Hard Nonetheless.
The Mathematical Intelligencer , 33(4):5–17, 2011.[18] R. Tamassia. On embedding a graph in the grid with the minimum number ofbends.
SIAM Journal on Computing , 16:421–444, 1974.16
Solutions
Figure 14: Solutions to the games from Figure 1.
B Macrocells from the proof of Theorem 4
Precisions on macrocell solutions, and on the input and outputs bits, are given in thetwo remarks within the proof of Theorem 4.
Figure 15: Choice-macrocells have two kinds of solutions when placing the numbersfrom 0 to 36. On the top side, if the left cell hosts a number and the right cell does notthen the output bit is true , and if the left cell does not host a number and the right celldoes then the output bit is false . 17 true false Figure 16: Given an input bit on the bottom side, duplicate-macrocells have onlysolutions for placing the numbers from 0 to 24, from 0 (cid:48) to 33 (cid:48) and from 0 (cid:48)(cid:48) to 42 (cid:48)(cid:48) , whichcopy the input bit as output bits to the two other sides. The true and false input bitsconsists in a cell on the bottom side which already hosts a number from the adjacentmacrocell. true false Figure 17: Given an input bit on the bottom side, negation-macrocells have onlysolutions for placing the numbers from 0 to 33 and from 0 (cid:48) to 27 (cid:48) , which flip this bitas an output bit to the top side. The true and false input bits consists in a cell on thebottom side which already hosts a number from the adjacent macrocell.18
369 12 1518 21 24 0 true false false false true false false false true true true true true true true false Figure 18: Given three input bits on its sides, the clause-macrocell has a solution ifand only if exactly one bit is true . The six pictures cover all the possibilities: when abit is not indicated it means that regardless of its value the macrocell has no solution(because it already has the two other input bits set to true ).19 true false true false true false true false true false Figure 19: Given an input bit on the bottom side, each wire-macrocell has only solutionswhich copy this bit as an output bit to the other side. The true and falsefalse