The Three-Color and Two-Color Tantrix(TM) Rotation Puzzle Problems are NP-Complete via Parsimonious Reductions

Holzer and Holzer (Discrete Applied Mathematics 144(3):345--358, 2004) proved that the Tantrix(TM) rotation puzzle problem with four colors is NP-complete, and they showed that the infinite variant of this problem is undecidable. In this paper, we st…

Authors: ** *논문 저자:* - **Holzer, M.** (원 논문 2004) – 참고용 - **Böhm, R.** (본 논문) - **Röhrig

The Three-Color and Two-Color Tantrix(TM) Rotation Puzzle Problems are   NP-Complete via Parsimonious Reductions
The Three-Color and Tw o-Color T an trix TM Rotation Puzzle Problems are NP-Complete via P arsi monious Reductions ∗ Dorothea Baumeister and J¨ org Rothe Institut f ¨ ur Informatik Heinric h-Heine-Univ ersit¨ at D ¨ usseldorf 40225 D ¨ usseldorf, German y June 9, 2008 Abstract Holzer and Holzer [HH04] pr oved that the T an trix TM rotation puzzle problem with four colors is N P-complete, and they show ed t hat the infinite v ariant of this problem is undecidable. In this pap er, we study the three-color and t wo-color T antrix TM rota- tion puzzle pr oblems (3-TRP and 2-TRP) and their v a r iants. Restricting the n umber of allow ed colo rs to three (respec tively , to tw o ) r educes the set of a v a ilable T antrix TM tiles from 5 6 to 14 (resp ectively , to 8). W e pr ov e that 3-TRP and 2-TRP are NP- complete, which answers a question rais e d by Holzer and Holz er [HH04] in the affirma- tive. Since our reductions ar e pa rsimonious , it follows that the pro blems Unique-3-TRP and Unique-2-TRP a re DP-complete under randomized re ductio ns. W e also show that the another- solution problems ass o ciated with 4-TRP, 3-TRP, and 2 -TRP are NP- complete. Finally , we prov e tha t the infinite v ariants of 3-TRP and 2-TRP are unde- cidable. 1 In tro duction The puzzle game T antrix TM , inv ent ed b y Mik e McMana wa y in 1991, is a d omino-lik e strat- egy game play ed with hexagonal tiles in the plane. Eac h tile co nta ins th r ee co lored lines in differen t patterns (see Figure 1). W e are h ere in terested in the v arian t of the T an trix TM rotation pu zzle game w hose aim it is to matc h the line colors of the joint edges for eac h pair of adjacen t tiles, jus t b y rotating the tiles around their axes while their locations remain fixed. This pap er con tin ues the complexit y-theoretic study of suc h p roblems that was initi- ated by Holzer an d Holze r [HH04]. Other results on the complexit y of domino-lik e strategy games can b e foun d, e.g., in Gr¨ adel’s w ork [Gr¨ a90 ]. Ueda and Nagao [UN96] and Y ato and Seta [YS02] p ro vided a framewo rk for studying the problem of finding another solution of an y give n NP pr oblem when some solutions to th is NP p roblem are already known—an ap- proac h particularly appropr iate f or p uzzle games. T an trix TM puzzles ha v e also b een studied with regard to “ev olutionary computation,” see Do w n ing [Do w05]. ∗ Supp orted in part by DFG grants RO 1202/9-3 and RO 1202/ 11-1 , the Europ ean S cience F oun dation’s EUROCORES program LogICC C, and the A lexander v on Hum b oldt F oun d ation’s T ransCoop program. URL: http : // ccc . cs . un i - duesseldo rf . de / ∼ rothe ( J. Rothe). 1 Holzer and Holzer [HH04] d efi ned tw o decision problems asso ciated with four -color T an trix TM rotation puzzles. The first problem’s instances are restricted to a finite n um- b er of til es, and the second problem’s instances are allo w ed to h a v e infinitely man y tiles. They prov ed that th e finite v ariant of this problem is NP-complete and that the infi n ite problem v arian t is undecidable. Th e constr u ctions in [HH04] use tiles with f our colors, just as the original T antrix TM tile s et. Holzer and Holzer p osed the qu estion of wh ether the T an trix TM rotation p uzzle problem remains NP-complete if restricted to only three colors, or if restricted to otherwise reduced tile sets. In this pap er, w e answer this question in the affirmativ e for the three-col or and the t w o-color version of this problem. F or eac h k , 1 ≤ k ≤ 4, T able 1 s u mmarizes the previously k n o wn and our n ew results for k -TRP, the k -color T antrix TM rotation puzzle problem, and its v arian ts. (Al l p roblems are formally defin ed in Section 2.) k k -TRP is Parsimonious? Unique- k - TRP is AS- k -TRP is Inf - k -TRP is 1 in P in P in P decidable (trivial) (trivial) (trivial) (trivial) 2 NP-complete y es DP- ≤ p r an -complete NP-complete undecidable (see Cor. 3.6) (see Thm. 3.5) (see Cor . 3.7) (see Cor . 3.8 ) (see Thm. 3.9) 3 NP- complete yes DP- ≤ p r an -complete NP-complete undecidable (see Cor. 3.3) (see Thm. 3.2) (see Cor . 3.7) (see Cor . 3.8 ) (see Thm. 3.9) 4 NP- complete yes DP- ≤ p r an -complete NP-complete undecidable (see [HH04]) (see [B R07]) (see [BR07]) (see Cor . 3.8 ) (see [HH04]) T able 1: O v erview of complexit y and decidabilit y results for k -TRP and its v arian ts Since the four-color T an trix TM tile set con tains the three-co lor T an trix TM tile set, our new complexit y r esults for 3-TRP imply the p revious r esu lts for 4-TRP (b oth its NP- completeness [HH04] and that satisfiability p arsimoniously reduces to 4-TRP [BR07]). In con trast, the three-co lor T antrix TM tile set do es not con tain the t wo- color T antrix TM tile set (see Figure 2 in S ection 2). Thus, 3-TRP d o es not straight forwardly inh erit its h ardness results from those of 2-TRP, which is wh y b oth red u ctions, the one to 3-TRP and the one to 2 -TRP, ha ve to b e p resen ted. Note that they eac h su b stan tially differ—b oth regarding the subp uzzles constru cted and rega rd ing the arguments sho wing that the constructions are correct—from the previously kn o wn r eductions pr esen ted in [HH04, BR07 ], and we will explicitly illustrate the differences b et w een our n ew and the original subpu zzles. Our redu ctions will b e from a b o olean circuit problem, and we construct a T antrix TM rotation p uzzle that sim ulates th e computation of suc h a circuit, where su itable su b puzzles are u s ed to sim ulate the wires and gates of the circuit. In particular, the previous redu ctions present ed in [HH04, BR07, BR] use McColl’s planar “cross-o ver” circuit with AND and NOT gates to sim u late w ire crossings [McC81] and th ey emplo y Goldschlag er’s log-space transformation from general to planar circuits [Gol77]. W e tak e the same appr oac h in our construction for 2-TRP. In con trast, we sim ulate w ir e crossings in the circu it in the construction f or 3-TRP directly by a new su bpuzzle called CROSS, which w e will introd uce in Secti on 3.1 and whic h will mak e our reduction for 3-TRP significantl y more effici ent compared with the reduction for 3-TRP presente d in a previous version of this pap er [BR]. Note that using the CROSS results in a puzzle with a considerably smaller total num b er of tiles that are needed to simulat e a giv en circuit. 2 Since w e pro vide p arsimonious reductions from the satisfiabilit y pr oblem to 3-TRP and to 2-TRP, our red u ctions preserv e the uniqueness of the solution. Thus, the unique v arian ts of b oth 3-TRP and 2-TRP are DP-complete under p olynomial-time randomized reductions, where DP is th e class of d ifferences of NP s ets. In addition, w e will sho w that our pars imonious reductions f or 3-TRP and 2-TRP also pro vide “another-solution problem reductions” (i.e. , ≤ p asp -reductions, see Section 2.1), and so the “another-solution problems” asso ciated with 3-TRP and 2-TRP are also NP-complete. 1 Moreo ver, since 4-TRP inherits the hardness resu lts for 3-TRP, th e another-solutio n problem asso ciated with 4-TRP is NP-complete as well. Finally , we will prov e that the infinite v arian ts of 3-TRP and 2-TRP are und ecidable, via a circuit construction similar to the one Holzer and Holzer [HH04] used to sho w that the in fi nite 4-TRP problem is und ecidable. W e mentio n in passing that the present pap er differs fr om and extends its preliminary v ersion [BR] in v arious w a ys. First, the pr o of of Theorem 3.2, w hic h w as only sk etc hed in [BR], is giv en here in full length, where w e also displa y the original subp uzzles of Holzer and Holzer [HH04] to allo w comparison and where w e explicitly show the differences betw een the su bpu zzles used in the their original construction (that pro vides a reduction for 4-TRP that is not parsimonious; see [BR07] for a parsimonious r eduction for 4-TRP) and in our new redu ction sho wing 3-TRP NP-complete via a parsimonious reduction. Moreo ver, the pro of o f this r esult f or 3-TRP presented here additionally differs from the one sket c hed in [BR], since the redu ction give n here uses the CR OSS su b puzzle, w hic h—as explained ab o ve —make s the r eduction significan tly more efficien t. Second, w e here pro vide the pro of of T h eorem 3.5, whic h wa s completely omitted in [BR]. Thir d, Corollary 3.8 and the related discussion of the another-solution v arian ts of k - T RP, k ∈ { 2 , 3 , 4 } , are completely new to the current version. This pap er is organized as f ollo ws. Section 2 pro vides the complexit y-theoretic defi- nitions and notat ion used and defin es the k -color T an trix TM rotation puzzle problem and its v ariants. Section 3.1 s ho ws that the three-color T antrix TM rotation puzzle pr oblem is NP-complete via a parsimonious redu ction. T o all o w comparison, the original subpuzzles from Holzer and Holzer’s construction [HH04] are also pr esented in this section. S ection 3.2 present s ou r result that 2-TRP is NP-complete, again via a parsimon ious r eduction. S ec- tion 3.3 is concerned with the complexit y of the unique and infinite v arian ts of the three- color and the t wo -color T antrix TM rotation puzzle pr oblem, and w ith th e corresp ond ing another-solution pr oblems. 2 Definitions and Notation 2.1 Complexit y-Theoretic N otions and Notation W e assume that the reader is familiar with the stand ard notions of complexit y theory , suc h as the complexit y classes P (d eterministic p olynomial time) and NP (nond eterministic p olynomial time); see, e.g., the textbo oks [P ap94, Rot0 5 ]. DP denotes the class of differences 1 Informally stated , an another-solution pr oblem associated with an NP problem A asks, given an instan ce x ∈ A and some solutions y 1 , y 2 , . . . , y n for “ x ∈ A ” ( i.e., th e y i ’s encode accepting computation paths of an NP mac hine solving A on input x ), whether or n ot t here exists another solution, y 6∈ { y 1 , y 2 , . . . , y n } , for “ x ∈ A .” See Ueda and Nagao [UN96] and Y ato and Seta [YS02] for more details and results, and also for a discussion of why t h ese problems are particularly imp ortant for pu zzle games. 3 of any t wo NP sets [PY84]. Note that DP is also kno wn to b e the second lev el of the b o olean hierarc hy ov er NP, see Cai et al. [CGH + 88, CGH + 89]. Let Σ ∗ denote the set of strin gs o v er the al ph ab et Σ = { 0 , 1 } . Given any language L ⊆ Σ ∗ , k L k denotes the num b er of elemen ts in L . W e consider b oth decision problems and function problems. Th e former are formalized as languages wh ose elemen ts are those strings in Σ ∗ that enco de the ye s-instances of the pr ob lem at han d . Regarding the latter, w e fo cus on the co unting problems related to sets in NP. The counti ng version # A of an NP set A maps eac h instance x of A to the n umb er of solutions of x . That is, counting problems are functions from Σ ∗ to N . As an example, the coun ting version #SA T of SA T, the NP-complete satisfiabilit y problem, asks ho w man y s atisfying assignment s a given b o olean formula has. Solutions of NP sets can b e view ed as accepting p aths of NP mac hines. V aliant [V al79 ] defined the fun ction class #P to conta in the fun ctions th at giv e the num b er of accepting paths of some NP mac h in e. In p articular, #SA T is in #P. Another cla ss of problems we consider are the another-solutio n problems (see F o otnote 1 for an in f ormal definition and Definition 2.1 for the another-solution p roblems asso ciated with k -TRP). The complexit y of t wo decision problems, A and B , will here b e compared via the p olynomial-time many-one r e ducib ility : A ≤ p m B if th ere is a p olynomial-time computable function f suc h th at for eac h x ∈ Σ ∗ , x ∈ A if and only if f ( x ) ∈ B . A set B is said to b e NP-complete if B is in NP and ev ery NP set ≤ p m -reduces to B . Man y-one reductions do n ot alw ays pr eserv e the num b er of solutions. A reduction that do es preserv e the n um b er of solutions is said to b e p arsimonious . F ormally , if A and B are an y tw o sets in NP, w e say A p arsimoniously r e duc es to B if there exists a p olynomial-time computable function f suc h th at for eac h x ∈ Σ ∗ , # A ( x ) = # B ( f ( x )). T o compare tw o another-solution problems asso ciated with t w o giv en NP p r oblems, A and B , Ueda and Nagao [UN96] introd uced the follo wing notion of reducibilit y . 2 W e sa y that A ≤ p asp B if A is parsimoniously reducible to B and , in addition, there exists a p olynomial-time computable bijectiv e fun ction from the set of solutions of A to th e set of solutions of B . Let AS- A an d AS- B b e the another-solution problems associated with A and B (see F o otnote 1 for an inform al definition and, sp ecifically , Definition 2.1 for the another-solution pr oblems asso ciated with k -TRP). Ueda and Naga o [UN9 6 ] sho w that if AS- A is NP-complete and A ≤ p asp B , then AS- B is also NP-complete [UN96]. In particular, AS-SA T is kno wn to b e NP-complete [YS02]. V aliant and V azirani [VV86] in tro d uced the follo wing type of r andomize d p olynomial- time many-one r e ducibility : A ≤ p r an B if there exists a p olynomial-time rand omized algo- rithm F and a p olynomial p such that for eac h x ∈ Σ ∗ , if x ∈ A then F ( x ) ∈ B with probabilit y at least 1 /p ( | x | ), and if x 6∈ A then F ( x ) 6∈ B with certaint y . In particular, they pro ve d that the u n ique v ersion of the satisfiabilit y problem, Uniqu e-SA T, is DP-complete under randomized redu ctions; see also Chang, Kadin, and Rohatgi [CK R95] f or f urther related results. 2 They call this notion “parsimonious reduction with the prop erty ( ∗ )” [UN96]. Y ato and Seta [YS02] in- trod uce a similar notion (albeit tailored to the case of function problems), which they d enote by “ p olynomial- time ASP redu ction.” 4 2.2 V arian ts of the T an trix TM Rotation Puzzle Problem 2.2.1 Tile Sets, Color Sequences, and O rien tations The T an trix TM rotation puzzle consists of four different kinds of hexagonal tiles, named Sint , Brid , Chin , and R ond . Eac h tile has thr ee lines colored d ifferen tly , wher e the thr ee colors of a tile are c h osen among four p ossible colors, see Figures 1(a)–(d). Th e original T an trix TM colors are r e d , yel low , blue , and gr e en , whic h we enco d e here as sho wn in Figures 1(e)–(h). The com bin ation of four kind s of tiles having three out of four colors eac h giv es a total of 56 differen t tiles. (a) Sint (b) Brid (c) Chin (d) Rond (e) red (f ) y ellow (g) blue (h) green Figure 1: T antrix TM tile t yp es and the en co d ing of T ant rix TM line colors 2 1 4 3 6 5 8 7 (a) T antrix TM tile set T 2 2 1 5 4 3 8 7 6 11 10 9 14 13 12 (b) T antrix TM tile set T 3 Figure 2: T antrix TM tile sets T 2 (for r e d and blue ) and T 3 (for r e d , ye l low , and blue ) Since we wish to stu d y T ant rix TM rotation puzzle p roblems for whic h the n umb er of allo wed colors is restricted, the set of T antrix TM tiles a v ailable in a give n pr oblem in stance dep end s on which v ariant of the T an trix TM rotation puzzle problem w e are in terested in. Let C b e the set that con tains the four colors r e d , yel low , blue , and gr e en . F or eac h i ∈ { 1 , 2 , 3 , 4 } , let C i ⊆ C b e s ome fixed subset of size i , and let T i denote the set of T antrix TM tiles a v ailable when the line colors for eac h tile are restricte d to C i . F or example, T 4 is th e original T antrix TM tile set con taining 56 tiles, and if C 3 con tains, say , th e three colors r e d , yel low , and blue , then tile set T 3 con tains the 14 tiles sho w n in Figure 2(b). Some more remarks on the tile sets are in order. First, for T 3 and T 4 , w e require the three lines on eac h tile to ha v e d istinct colors, as in the original T antrix TM tile set. F or T 1 and T 2 , h ow ever, this is not p ossible, so we allo w the s ame color b eing used f or more than one of the three lines of any tile. Second, note that we care only ab out th e sequence of colors on a tile, 3 where w e alw ays use the cloc kwise direction to rep r esen t color s equ ences. 3 The reason for th is and th e resulting con ven tions on the tile sets stated in th is paragraph is that our problems refer to the v ariant of the T antrix TM game that seeks, via rotations, to make the line colors match 5 Ho wev er, since different types of tile s can yield the same color sequence, w e will use ju st one suc h tile to rep r esen t the corresp onding co lor sequence. F or example, if C 2 con tains, sa y , the t w o colors r e d and blue , then the color sequence r e d-r e d-blue-blue- b lue-blue (wh ich w e abbreviate as rrbbbb ) can b e represen ted b y a Sint , a Brid , or a R ond eac h h a ving one short r e d arc and t wo blue additional lines, and w e add only one such tile (sa y , the R ond ) to the tile set T 2 . T hat is, th ough there is some freedom in choosing a p articular set of tiles, to b e sp ecific w e fix the tile set T 2 sho wn in Figur e 2(a). Thus, w e ha ve k T 1 k = 1, k T 2 k = 8, k T 3 k = 14, and k T 4 k = 56, regardless of which colors are c hosen to b e in C i , 1 ≤ i ≤ 4. R ond Brid Chin Sint t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 bbrrrr rrbbbb brrbrr rbbrbb rbrrrb brbbbr bbbbbb rrrrrr T able 2: C olor sequences of the tiles in T 2 R ond Brid Chin t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 yrrbby ryybbr yr rybb ryyrbb brrbyy yrbybr rbyryb brybyr Sint t 9 t 10 t 11 t 12 t 13 t 14 brbyyr bybrry ryrbby rbryyb ybyrrb yry bbr T able 3: C olor sequences of the tiles in T 3 T ables 2 and 3 sho w the color sequ ences for the eigh t tiles in T 2 and for the 14 tiles in T 3 that are presen ted in Figures 2(a ) an d 2(b) , resp ectiv ely . T ables 4 and 5 gi ve the six p ossible orient ations for eac h tile in T 2 and in T 3 , which can b e describ ed by p ermuting the color sequences cyclically and wh ere rep etitions of color sequences are omitted. Rega rdin g the latter, note that some of the tiles in T 2 (namely , tiles t 3 , t 4 , t 7 , and t 8 in T able 4) h a v e orien tations that yield iden tical color sequen ces due to symmetry , and so rep etitions can b e omitted. In con trast, no suc h rep etitions o ccur for the 14 tiles in T 3 when p erm uted cyclicall y to yield the six p ossible orien tations (see T able 5 ). Note that, f or example, tile t 7 from T 2 (see T able 4) has the same color sequen ce (namely , bbbbbb ) in eac h of its six orien tations. In Section 3, w e will consider the counting v ersions of T antrix TM rotation puzzle problems and will construct parsimonious reductions. When coun ting the s olutions of T antrix TM rotation puzzles, w e will fo cu s on color sequences only . That is, whenev er some tile (suc h as t 7 from T 2 ) has distinct orientati ons with iden tical color s equ ences, w e will coun t this as just one solution (and disregard suc h rep etitions). In this sense, our reduction to b e pr esen ted in the pro of of Theorem 3.5 w ill b e parsim on ious . on all joi nt edges of adjacent t iles. The ob jective of oth er T antrix TM games is to create lines and lo ops of the same color as long as possible; for problems related t o these T antrix TM game v arian ts, other con ven tions on the sets of allow ed tiles would b e reasonable. 6 Tile Orien tation Num b er 1 2 3 4 5 6 1 bbrrrr rbbrrr rrbbrr rrrbbr rrrrbb brrrrb 2 rrbbbb brrbbb bbrrbb bbbrrb bbbbrr rbbbbr 3 brrbrr rbrrbr rrbrrb 4 rbbrbb brbbrb bbrbbr 5 rbrrrb brbrrr rbrbrr rrbrbr rrrbrb brrrbr 6 brbbbr rbrbbb brbrbb bbrbrb bbbrbr rbbbrb 7 bbbbbb 8 rrrrrr T able 4: C olor sequences of the tiles in T 2 in their six orien tations Tile Orien tation Num b er 1 2 3 4 5 6 1 yrrbby yyrrbb byyrrb bbyyrr rbbyyr rrbbyy 2 ryybbr rryybb brryyb bbrryy ybbrry yybbrr 3 yrrybb byrryb bbyrry ybbyrr rybbyr rrybby 4 ryyrbb bryyrb bbryyr rbbryy yrbbry yyrbbr 5 brrbyy ybrrby yybrrb byybrr rbyybr rrbyyb 6 yrbybr ryrbyb bryrby ybryrb bybryr rbybry 7 rbyryb brbyry ybrbyr rybrby yrybrb byrybr 8 brybyr rbryby yrbryb byrbry ybyrbr rybyrb 9 brbyyr rbrbyy yrbrby yyrbrb byyrbr rbyyrb 10 bybrry ybybrr rybybr rrybyb brryby ybrryb 11 ryrbby yryrbb byryrb bbyryr rbbyry yrbbyr 12 rbryyb brbryy ybrbry yybrbr ryybrb bryybr 13 ybyrrb bybyrr rbybyr rrbyby yrrbyb byrrby 14 yrybbr ryrybb bryryb bbryry ybbryr rybbry T able 5: C olor sequences of the tiles in T 3 in their six orien tations 2.2.2 Definition of the Problems W e now recall some useful n otation that Holzer and Holzer [HH04] int ro d uced in order to formalize pr oblems r elated to the T antrix TM rotation pu zzle. The in stances of such problems are T ant rix TM tiles fir mly arranged in the plane. T o represent their p ositions, we use a t wo - dimensional hexagonal co ordinate system shown in Figure 3. Let T ∈ { T 1 , T 2 , T 3 , T 4 } b e some tile set as d efined ab o ve. Let A : Z 2 → T b e a fun ction mapping p oints in Z 2 to tiles in T , i.e., A ( x ) is the t yp e of the tile located at p osition x . Note that A is a p artial function; throughout this pap er (e xcept in Th eorem 3.9 and its pr o of ), we r estrict our problem instances to fin itely m any giv en tiles, and the regions of Z 2 they co v er ma y ha ve holes (whic h is a difference to th e original T an trix TM game). Define shap e ( A ) to b e the set of p oin ts x ∈ Z 2 for w hic h A ( x ) is defined. F or any t wo distinct p oin ts x = ( a, b ) and y = ( c, d ) in Z 2 , x and y are neigh b ors if and only if ( a = c 7 x y (1 , 1) (0 , 0) ( − 1 , − 1) (1 , 0) (0 , 1) ( − 1 , 0) (0 , − 1) Figure 3: A t wo-dimensional hexagonal co ordinate system and | b − d | = 1) or ( | a − c | = 1 and b = d ) or ( a − c = 1 and b − d = 1) or ( a − c = − 1 and b − d = − 1). F or any t w o p oint s x and y in shap e ( A ), A ( x ) and A ( y ) are s aid to b e neigh b ors exactly if x and y are neigh b ors. W e no w d efine the T an trix TM rotation p uzzle problems we are in terested in , where the parameter k is c hosen f rom { 1 , 2 , 3 , 4 } : Name: k -Color T antrix TM Rotation Puzzle ( k -TRP , for sh ort). Instance: A finite shap e function A : Z 2 → T k , appropr iately encod ed as a string in Σ ∗ . Question: Is th er e a solution to the r otation puzzle defined by A , i.e., does there exist a rotation of the given tiles in shap e ( A ) suc h th at the colors of the lines of an y tw o adjacen t tiles matc h at their join t edge? Clearly , 1-T R P can b e solv ed trivially , so 1-TRP is in P. On the other hand, Holzer and Holzer [HH04] sho we d th at 4-TRP is NP-complete and that the infinite v ariant of 4-TRP is u ndecidable. Baumeister and Rothe [BR07 ] in ve stigated the count ing and the unique v ariant of 4-TRP and, in p articular, pr o vided a parsimonious redu ction from SA T to 4-TRP. In this pap er, w e study the three-color and t w o-color ve rsions of this problem, 3-TRP and 2-TRP, and their count ing, unique, another-solution, and infin ite v arian ts. Definition 2.1 1. A solution to a k -TRP instance A sp e cifie s an orientation of e ach tile in shap e ( A ) such that the c olors of the lines of any two adjac ent tiles match at their joint e dge. L et S ol k - TRP ( A ) denote the set of solutions of A . 2. Define the coun ting version of k - TRP to b e the function # k - T RP mapping fr om Σ ∗ to N such that # k - TR P( A ) = k Sol k - TRP ( A ) k . 3. Define the unique version of k - TRP as Unique - k - TRP = {A | # k - TRP( A ) = 1 } . 4. Define the another-solution pr oblem associated w ith k -TRP as AS - k - TRP = { ( A , y 1 , . . . , y n ) | y 1 , . . . , y n ∈ Sol k - TRP ( A ) and k Sol k - TRP ( A ) k > n } . The ab o v e p roblems are defined for the case of finite prob lem instances. The infinite T an trix TM rotation puzzle pr oblem with k colors (Inf - k -TRP, for short) is d efined exactly as k -TRP, the only difference b eing that the shap e fun ction A is not required to b e fi nite and is represente d b y the encod ing of a T ur ing mac h ine computing A : Z 2 → T k . 8 3 Results 3.1 P arsimonious Reduction from SA T t o 3-TRP Theorem 3.2 b elo w is the main resu lt of this section. Not withstandin g th at our pro of follo ws the general approac h of Holzer and Holzer [HH04], our s p ecific construction and ou r pro of of correctness w ill differ sub stan tially from theirs. W e w ill pro vide a parsimonious reduction from S A T to 3 -TRP. Let Circuit ∧ , ¬ -SA T denote the p roblem of deciding, giv en a b o olean circuit c w ith AND and NOT gates only , whether or not there is a satisfying truth assignmen t to the inpu t v ariables of c . The NP-complete ness of Circu it ∧ , ¬ -SA T w as sho wn b y Co ok [C o o71]. Th e follo wing lemma (state d, e.g., in [BR07]) is straight forward. Lemma 3.1 SA T p arsimoniously r e duc es to Circuit ∧ , ¬ - SA T . Theorem 3.2 SA T p arsimoniously r e duc es to 3 - TRP . Pro of. By Lemma 3.1, it is enough to sho w that Circuit ∧ , ¬ -SA T pars im on ious ly reduces to 3-TRP. The r esulting 3-TRP instance simulat es a b o olean circuit with AND and NOT gates suc h that the num b er of solutions of the r otation puzzle equ als the num b er of satisfying truth assignment s to th e v ariables of the circuit. General remarks on our pro of approac h: The rotation puzzle to b e constru cted from a give n circuit consists of different subp uzzles eac h using only three colors. Th e color gr e en w as emplo y ed by Holzer and Holzer [HH04] only to exclude certain rotations, so w e c ho ose to eliminate this color in our three-color rotation puzzle. Thus, letting C 3 con tain the colors blue , r e d , and yel low , we ha v e th e tile set T 3 = { t 1 , t 2 , . . . , t 14 } , where the enumeration of tiles corresp onds to Figure 2(b). F urth er m ore, our constru ction will b e parsimonious, i.e., there will b e a one-to- one corresp ondence b et we en the solutions of the giv en Circuit ∧ , ¬ -SA T instance and the solutions of the resulting rotation puzzle instance. Note th at p art of our w ork is already done, since some sub puzzles constructed in [BR07 ] use only thr ee colors and they eac h hav e un iqu e s olutions. Ho w eve r, the remaining subp uzzles h av e to b e either mo dified subs tantial ly or to b e constructed completely d ifferently , and the argumen ts of why our mo dified construction is correct d iffers considerably from previous work [HH04 , BR07]. Since it is n ot so easy to exclude un d esired rotations without having the color g r e en a v ailable, le t u s first analyze the 14 tiles in T 3 . F or u, v ∈ C 3 and for eac h tile t i in T 3 , where 1 ≤ i ≤ 14, T able 6 sho ws whic h substr in gs of the form uv o ccur in the color sequence of t i (as indicated b y an • entry in ro w uv and column i ). In the remainder of this p ro of, when s ho wing that our construction is correct, our arguments will often b e based on which substrings do or do not o ccur in th e co lor sequences of certain tiles from T 3 , and T able 6 ma y then b e looked up for con v enience. Holzer and Holzer [HH04] consider a b o olean circuit c on inpu t v ariables x 1 , x 2 , . . . , x n as a sequence ( α 1 , α 2 , . . . , α m ) of computation steps (or “instru ctions”), and w e adopt th is approac h here. F or the i th instruction, α i , w e ha v e α i = x i if 1 ≤ i ≤ n , and if n + 1 ≤ i ≤ m then w e ha ve eit her α i = NOT( j ) or α i = AND( j, k ), where j ≤ k < i . Circuits are ev aluated in the standard wa y . W e w ill rep r esen t the truth v alue true b y the color blue and the truth v alue false b y the color r e d in our r otation puzzle. 9 R ond Brid Chin Sint uv 1 2 3 4 5 6 7 8 9 10 11 12 13 14 bb • • • • • • rr • • • • • • yy • • • • • • br • • • • • • • • • • rb • • • • • • • • • • by • • • • • • • • • • yb • • • • • • • • • • ry • • • • • • • • • • yr • • • • • • • • • • T able 6: S ubstrin gs uv that o ccur in th e color sequences of the tiles in T 3 A tec hnical difficulty in th e construction results from the wir e crossings that circuits can ha ve. T o construct rotatio n puzzles from planar circuits, Holzer and Holze r us e Mc- Coll’s planar “cross-o ver” circuit with AND and NOT gates to sim ulate such wire cross- ings [McC81], and in particular they emplo y Goldschlag er’s log-space transformation f r om general to planar circuits [Gol77 ]. F or the details of this transformation, we refer to Holzer and Holzer’s w ork [HH04]. W e us e a different approac h to o v ercome the difficult y caused b y wire crossings. Our construction will emplo y a new subpuzzle f or this purp ose. Holzer and Holzer’s circuit construction u ses sev eral cross-o ve r circuits, and eac h of them consists of tw elv e AND and nine NOT gates, and in add ition it increases th e num b er of instru ction steps by 14. W e will a v oid this blo w-up b y usin g the CR OSS sub puzzle, whic h ac hieves a direct crossing of tw o adjacen t wir es in our T an trix TM puzzle and thus is muc h more efficien t. F or the sake of comparison, w e also pr esen t the original sub puzzles from Holzer and Holzer’s constru ction ([HH04]) in this section, with the follo w ing con v en tions: Tiles having more than one p ossible orienta tion as well as tiles conta ining gr e e n lines w ill alw ays hav e a grey in s tead of a blac k edging, and mo d ified or inserted tiles in our new subpu zzles will alw a ys b e highligh ted b y ha ving a grey b ac kground. This will illustrate the differences b et wee n our new and the previously kno wn original subpuzzles. Wire subpuzzles: Wires of the circuit are simulate d by the su bpuzzles WIRE, MOVE, and COPY. A v ertical wire is repr esen ted by a WIRE su bpuzzle, whic h is shown in Figure 5. T h e original WIRE subpu zzle from [HH04] (see Figure 4) do es n ot con tain gr e en but it d o es not h a v e a unique solution, while th e WIRE subpuzzle from [BR07], whic h is not d ispla y ed here, ensures the uniqueness of the solution bu t is using a tile with a gr e en line. In the original WIRE su bpu zzle, b oth tiles, a and b , ha v e t w o p ossible orien tations for eac h input color. In serting tw o n ew tiles at p ositions x and y (see Figure 5) makes the solution un ique. If the in put color is blue , tile x m ust con tain one of the follo w ing color-sequence substrin gs for th e edges join t with tiles b and a : ry , rr , yy , or yr . If the input color is r e d , x must con tain one of these s u bstrings: b b , yb , yy , or by . Tile t 12 satisfies the conditions yy an d ry for the input color blue , and the conditions yb and yy for the input color r e d . 10 The solution must no w b e fixed w ith tile y . The p ossible color-sequence sub strings of y at the edges join t with a and b are rr and ry f or the inpu t color blue , and y b and bb for the inpu t color r e d . Tile t 13 has exactly one of these sequences for eac h input color. Thus, the solution for this sub puzzle con tains only three colors and is u nique. IN OUT (a) In: true IN OUT (b) In: false IN a b OUT (c) Scheme Figure 4: Or iginal WIRE subpu zzle, see [HH04 ] IN OUT (a) In: true IN OUT (b) In: false x IN a b OUT y (c) Scheme Figure 5: Th ree-color WIRE subp uzzle The MOVE sub puzzle is needed to mo ve a wire b y t wo p ositions to the left or to the righ t. The original MOVE s ubpu zzle fr om [HH04 ] con tains only three colors but h as sev eral solutions. One solution for eac h inp ut co lor is sho wn in Figure 6, wh ere the tile s with a grey edging ha ve m ore than on e p ossible orienta tion. Ho wev er, the mo dified subpu zzle from [BR07], w h ic h is p resen ted in Figure 7, conta ins also only thr ee colors but has a unique solution. IN OUT (a) In: true IN OUT (b) In: false Figure 6: O r iginal MO VE subp u zzle, s ee [HH04] 11 IN OUT (a) In: true IN OUT (b) In: false Figure 7: Th ree-color MO VE sub p uzzle, see [BR07] The COPY s u bpu zzle is us ed to “split” a wir e in to t wo copies. By th e same argumen ts as ab o v e we can tak e the mo dified COPY s ubpu zzle from [BR07], whic h is pr esen ted in Figure 9. Figure 8 sho ws the original COPY su b puzzle from [HH04]. OUT IN OUT (a) In: true OUT IN OUT (b) In: false Figure 8: Or iginal COPY subp uzzle, see [HH04] OUT IN OUT (a) In: true OUT IN OUT (b) In: false Figure 9: T h ree-color COPY subpu zzle, see [BR07 ] The last subpuzzle needed to simulate the wires of the circuit is our new CROSS sub- puzzle sho wn in Figure 10. This subpuzzle has t wo inputs and t wo outpu ts, and it ensures 12 that the input colors will b e s w app ed at the outputs. This su b puzzle uses only three colors and has unique solutions for eac h com b in ation of inpu t colors. IN OUT IN OUT (a) In: true , true IN OUT IN OUT (b) In: true , fal se IN OUT IN OUT (c) In: false , true IN OUT IN OUT (d) In: false , f alse IN a c OUT b g j h e i k IN d f OUT P S f r a g r e p l a c e m e n t s l 1 m 1 n 1 o 1 p 1 q 1 r 1 s 1 t 1 u 1 l 2 m 2 n 2 o 2 p 2 q 2 r 2 s 2 t 2 u 2 (e) Scheme Figure 10: CR OS S subpuzzle The CR OSS sub puzzle can b e sub divided in to thr ee distinct parts: th e lo w er part con- sisting of tiles a through k , the upp er left p art consisting of tiles l 1 through u 1 , and the upp er right part consisting of tiles l 2 through u 2 . Let u s first consider the up p er left part. Consider the thr ee p ossible colors that can o ccur at the edge of tile j join t with tile m 1 . Case 1: Ass u me that the join t edge of these tw o tiles is blue . One p ossible orienta tion for tile m 1 has yel low at the edge join t with tile l 1 . Th is lea v es t w o p ossible orientat ions for tile l 1 . T he fir st one h as r e d at the ed ge join t with tile n 1 , but n 1 do es n ot con tain 13 the color sequence yr . The s econd p ossible orien tation has yel low at th e edge joint with tile n 1 , but this leads to blue at the edges of tiles m 1 and n 1 with tile o 1 . Since o 1 do es not contai n the color s equ ence bb this is not p ossible either. The orien tation of tile m 1 is no w fixed with r e d at the edge joint with tile l 1 . There are tw o orien tations of tile l 1 , b u t they b oth hav e blue at the edge join t with tile n 1 . In the analysis of the lo wer part w e will see that b oth solutions are n eeded. The first one has yel low at the edge joint with tile j and the second one has blue at this edge. The orienta tion of tile n 1 is fi xed with r e d and blue at the edges joint with tiles m 1 and l 1 . Tile o 1 has a fixed orien tation du e to the co lor-sequence su bstring br at the edges join t with tiles m 1 and n 1 . F or tile p 1 there are t w o orienta tions left, b ecause this tile conta ins the color-sequence sub string rb for the edges joint with tiles o 1 and n 1 , t wice. The fir s t one has r e d at the edge join t with tile r 1 and yel low at the edge joint with tile q 1 . Thus, it is not p osibble that tile r 1 has yel low at the edge join t with tile q 1 , since q 1 do es not contai n the color-sequence sub s tring y y . Neither is it p ossible that r 1 has blue at the edge join t with tile q 1 , b ecause this le ads to the color-sequence substr in g yr at th e edges of tiles r 1 and s 1 with tile t 1 . So the orien tation of tile p 1 is fi xed with blue at the edge join t with tile q 1 and yel low at the edge joint with tile r 1 . Tile r 1 forces the edge j oint with tile q 1 to b e r e d , and s ince s 1 do es not cont ain the color sequence yy , the orient ation of tiles r 1 and s 1 is fi xed with blue at their joint edge. This im m ediately fixes th e orienta tion of all other tiles, and the output color at the left outpu t tile will b e blue . Case 2: Now we assu m e that the join t edge of tiles j and m 1 is r e d . There are t wo p ossible orien tations for tile m 1 . Th e first one has r e d at the edge joint w ith tile l 1 and blue at the ed ge join t w ith tile n 1 . T his is not possib le b ecause then the j oint edge of tiles l 1 and n 1 w ould hav e to b e blue , but tile n 1 do es not con tain the colo r-sequence substring bb . S o the orienta tion of tile m 1 is fi xed with blue at the edge joint with tile l 1 and yel low at th e edges join t w ith tiles n 1 and o 1 . Since n 1 do es not contai n the color-sequence substring yr , the orien tation of tiles l 1 and n 1 is fixed with yel low at their j oin t edge. The join t edge of tiles o 1 and p 1 cannot b e r e d , since p 1 do es not con tain the color-sequence sub string rr for the edges joint with tiles o 1 and n 1 , so the join t edge of tiles o 1 and p 1 is yel low , and their orientati on is fixed. No w , there are t w o p ossible orien tations for tile r 1 . The fi rst one with yel low at the edge joint with tile s 1 is not p ossible, since this would lead to the color-sequence substring yb for tile u 1 at the edges joint w ith tiles r 1 and t 1 . So we fi x the orien tation of tile r 1 with yel low at th e edge join t with tile q 1 . T his also fixes the orien tation of tile q 1 with blue at the edge joint with tile s 1 . The edges of tile t 1 join t w ith tiles r 1 and s 1 are b oth yel low , and th e orien tation of all other tile s is fixed. The output of the subp uzzle’s left output tile will th us b e r e d . Case 3: T he last p ossib le color for the joint edge of tiles j and m 1 is yel low . W e first assume that the edge of tile m 1 join t with tile l 1 is blue . There are t wo p ossible orien tations for tile l 1 . Th e first one has yel low at the edge join t with tile n 1 and th us is not p ossible, since n 1 do es not con tain the color-sequence substring ry . The second one has r e d at the edge join t with tile n 1 . Since th e edge of 14 tile m 1 join t with tile o 1 is r e d , this is not p ossible either, b ecause o 1 do es not conta in the color-sequence substring rb . So the orien tation of tile m 1 is fixed with yel low at the edge join t with tile l 1 . And since tile j do es not con tain the color-sequence substring by , the orient ation of tile l 1 is fixed as we ll The give n co lors at the edges of tiles l 1 and m 1 immediately fix the orien tation of tiles n 1 and o 1 with blue and yel low at the edges joint with tile p 1 , which con tains the color-sequence substrin g by on ly once and so has a fixed orien tation as wel l. No w w e ha v e the same situation as in the previous case, since th e joint edge of tile p 1 with r 1 is blue and th e joint edge of p 1 with tile q 1 is r e d . As to color r e d at the join t edge of tiles j and m 1 this case will also result in a unique solution w ith the output col or r e d at the left output tile. Due to symmetry th e u p p er right part can b e h andled analogously with the upp er left part. All Brid and Chin tiles are the same, and the R ond is rep laced b y the other R ond , and the Si nt tiles are replaced b y the resp ectiv e other Sint tiles ha ving a small arc of the same color. So w e obtain a s ymmetrical sub puzzle and similar argumen ts as for the up p er left part apply . W e now analyze the lo wer part of th is su bpu zzle. W e first consider tiles a , b , and c . If the left in put is blue then there is only one p ossible solution to these tiles. Obviously tiles a and c must ha ve a v ertical blue line, and sin ce tile g do es not con tain the colo r-sequence substring by , the orien tation of these three tiles is fixed with yel low at the edges of tile s b join t with tiles c and a . The orien tation of tile g is fixed as w ell, since it cont ains the color-sequence substring br only once. If the input to this part is r e d , we h a v e a fi xed orien tation with the color-sequence substring ry for the edges joint with tile g b y similar argumen ts. Note that tile g has t wo p ossible solutions left. Since tiles d , e , and f are th e same as tiles a , b , and c , and tile i is a mirrored tile g , the same arguments hold for the righ t inp ut. T o analyze the wh ole lo wer part, we w ill distinguish the follo wing four p ossible pairs of inpu t colors: • First w e assu me that b oth in put colors are b lue (see Figure 10(a)). W e ha ve seen that the orient ation of tiles g and i is fixed with yel low at th eir edges join t w ith tile h , and r e d at their edges join t with tiles j and k , r esp ectiv ely . Th e orienta tion of tile h is fixed with r e d at the edges join t with tiles j and k , and so they are fixed with the color-sequence substring by for the edges joint with tiles l 1 and m 1 and with the color-sequence su b string yb for the edges joint with tiles m 2 and l 2 . In the analysis of the upp er part we h a v e s een, that b oth outpu t colors will b e blue in this case, as desired. • No w, let the righ t inpu t color b e blue and let the left inpu t color b e r e d (see Fi g- ure 10(c)). The t w o p ossible colors for tile g join t with tile h are blue and r e d . The color for the joint edge of tiles i and h is yel low , and sin ce h conta ins the color-sequence substring yxb bu t not yxr , where x stands f or an arbitrary color (c hosen among blue , r e d , and ye l low ), the orienta tion of tiles g and h is fixed. Th is also fixes the orien tation of tiles j and k . Tile j has blue at the ed ges joint with tiles l 1 and m 1 , and (as we ha v e seen in the analysis of th e upp er part) the left outpu t color will b e blue , ju st lik e the righ t input color. The edges of tile k join t with tiles m 2 and l 2 are yel low , and so the right outpu t color will b e r e d , as desired. 15 • The case of blue b eing the left input color and r e d b eing the righ t inpu t color (see Figure 10(b)) is similar to the second case. The output colors will again b e the exc h anged in put colors, as desired. • The last case is that b oth input colors are r e d (see Figure 10( d) ). W e ha v e seen that the tw o p ossib le colors for tiles g and i joint with tile h are blue and r e d . Obviously , they cannot b oth b e blue . If the joint edge of tiles g and h is blue , the join t edges of tiles g and h with j are b oth yel low . This is not p ossible, b ecause th e combinatio n of blue at the join t edge of tiles j and l 1 and r e d at th e join t edge of tile s j and m 1 is not p ossible. Th e case of blue at the edge of tile i joint with tile h is not p ossible due to similar argumen ts for tile k and th e upp er righ t part. So the edges of tiles g and i join t with tile h m ust b oth b e r e d . This leads to r e d at the edges of tile j join t with the u pp er left p art, and tile k join t with the u pp er r igh t p art. W e h a v e already seen that this com bination leads to b oth output colors b eing r e d , as desired. So we ha ve u nique solutions with the desired effect of exchanging the inp ut colors at the output tiles for all four p ossible com bin ations of inpu t colors for the CR OSS sub puzzle. Gate subpuzzles: Th e b o olean gates AND an d NOT are repr esen ted b y the AND and NOT subpuzzles. Both the original four-color NOT subpu zzle from [HH04] (see Figure 11) and the m o dified four-color NOT s u bpuzzle from [BR07 ], whic h is not displa y ed here, use tiles with gr e e n lines to exclude certain rotations. Our three-color NOT subpuzzle is s ho wn in Figure 12 . Tiles a , b , c , and d fr om the original NOT sub puzzle shown in Figure 11 remain unchange d. Tiles e , f , and g in this original NOT su bpuzzle ensur e that the output color will b e correct, sin ce the joint edge of e and b is alwa ys r e d . So for our new NOT subpu zzle in Figure 12, we ha ve to show that the edge b et w een tiles x and b is alw ays r e d , and that we h a v e uniqu e solutions for b oth input colors. First, let th e input color b e blue and su pp ose for a cont radiction that the joint edge of tile s b and x w ere blue . Then the join t edge of tiles b and c would b e yel low . Since x is a tile of t yp e t 13 and so do es not con tain the color-sequence sub string su bstring bb , the edge b et wee n tile s c and x m ust b e yel low . But then the edges of tile w joint with tiles c and x m us t b oth b e blue . This is not p ossible, ho wev er, b ecause w (wh ic h is of t yp e t 10 ) do es not con tain the color-sequence sub string substring bb . So if the input color is blue , the orientat ion of tile b is fixed with yel low at the edge of b join t with tile y , and with r e d at the edges of b joint with tiles c and x . This already ensures that the output color will b e r e d , b ecause tiles c and d b ehav e lik e a WIRE subpu zzle. Tile x do es not con tain the color-sequence substrin g br , so the orien tation of tile c is also fixed with blue at the join t edge of tiles c and w . As a consequence, the joint edge of tiles w and d is yel low , and d ue to the fact that the join t edge of tiles w and x is also yel low , the orien tation of w and d is fixed as w ell. Regarding tile a , the edge joint with tile y can b e yel low or r e d , but tile x has blue at the edge joint with tile y , so the join t edge of tiles y and a is yel low , and the orien tation of all tiles is fixed for the in put color blue . The case of r e d b eing the inp ut color can b e handled analogously . The most complicated figur e (b esides the CROSS) is the AND subpu zzle. T he original four-color version from [HH04] (see Figure 13) us es four tiles with gr e en lines and the mo dified four-color AND su bpuzzle from [BR07], which is not displa y ed here, uses sev en 16 IN OUT (a) In: true IN OUT (b) In: false f g e IN a b c d OUT (c) Sc heme Figure 11: Or iginal NOT subpuzzle, see [HH04] IN OUT (a) In: true IN OUT (b) In: false y x w IN a b c d OUT (c) Scheme Figure 12: Th ree-color NOT subp uzzle tiles with gr e en lines. Figure 14 shows ou r new AND subpu zzle using only three colors and ha ving unique solutions for all four p ossible com b inations of input colo rs. T o analyze this subpu zzle, we sub d ivid e it into a low er and an upp er p art. The lo wer part ends with tile c and has four p ossible solutions (one for eac h com bination of input colors), while the upp er part, w hic h b egins with tile j , has only t wo p ossible solutions (one for eac h p ossible ou tp ut color). Th e lo wer part can again b e sub d ivid ed into th r ee different p arts. The low er left part conta ins the tiles a , b , x , and h . If the inp ut color to th is part is blue (see Figures 14(a) and 14 (b) ), the join t edge of tile s b and x is alw a ys r e d , and since tile x (wh ic h is of t yp e t 11 ) does not cont ain the color-sequence substring rr , the orien tation of tiles a and x is fixed. The orien tation of tiles b and h is also fixed, since h (whic h is of t yp e t 2 ) do es n ot con tain th e color-sequence sub s tring by but the color-sequence substring yy for the edges join t with tiles b and x . By similar argumen ts w e obtain a u nique solution for th ese tiles if the left input color is r e d (see Figures 14(c) and 14(d)). The connecting edge to the rest of the su b puzzle is the joint edge b et we en tiles b and c , and tile b will ha v e the same color at this edge as the left input colo r. Tiles d , e , i , w , and y form the lo we r righ t part. If the input color to this part is blue (see Figures 14(a ) and 14(c)), the join t edge of tiles d and y must b e yel low , since tile y (whic h is of t yp e t 9 ) d o es not con tain the color-sequence substrings rr nor ry for the edges join t with tiles d and e . Th us the join t edge of tiles y and e must b e yel low , since i (which 17 IN OUT IN (a) In: true, true IN OUT IN (b) In: true, false IN OUT IN (c) In: false, true IN OUT IN (d) In: f alse, false h IN a b c j k g l m n OUT f o IN d e p q i (e) Scheme Figure 13: Or iginal AND su bpuzzle, see [HH04] 18 IN OUT IN (a) In: true, true IN OUT IN (b) In: true, false IN OUT IN (c) In: false, true IN OUT IN (d) In: f alse, false x h IN a b v c j k g l m n OUT w u o IN d e y i (e) Scheme Figure 14: Three-col or AND s u bpu zzle is of t yp e t 6 ) d o es not con tain the color-sequence substring bb for the edges join t with tiles y and e . Th is implies th at the tiles i and w also ha ve a fixed orientat ion. If the input colo r to the lo w er righ t part is r e d (see Figures 14 (b) and 14 (d)), a unique solution is obtained b y s im ilar argumen ts. The connection of the lo we r righ t p art to the r est of the subpuzzle is the edge b et we en tiles w and g . If the right input colo r is blue , this edge will also b e blue , and if the right in put color is r e d , this edge will b e yel low . The heart of the AND subpu zzle is its lo we r middle p art, formed by the tiles c and g . The colors at the joint edge b et w een tiles b and c and at the join t edge b et ween tiles w and g determine the orient ation of the tiles c and g u niquely for all four p ossible com binations of input colors. The outpu t of this part is the color at the edge b et wee n c and j . If b oth inpu t colors are blue , this edge will also b e blue , and otherwise this edge will alw a ys b e yel low . The outpu t of the whole AND su bpuzzle will b e r e d if the edge b et we en c a nd j is yel low , and if this edge is blue then the output of the whole subp uzzle will also b e blue . If the input colo r for the upp er p art is blue (see Figure 14(a)), eac h of the tiles j , k , l , m , and n h as a v ertical blu e line. Note that sin ce the colo rs r e d and yel low are symm etrical in these tiles, w e would hav e sev eral p ossible solutions without tiles o , u , and v . How eve r, tile v (wh ich is of t yp e t 9 ) con tains neither rr nor ry for the edges joint with tiles k and j , so the orien tation of the tiles j through n is fixed, except that tile n without tiles o an d u w ould s till ha v e t w o p ossible orienta tions. T ile u (whic h is of t yp e t 2 ) is fixed b ecause of 19 OUT (a) Out: true OUT (b) Out: false a b OUT c (c) Scheme Figure 15: Original BOO L subpu zzle, see [HH04] its color-sequence su bstring yy at the edges joint with l and m , so due to tiles o and u the only color p ossib le at the edge b et we en n and o is yel low , an d w e h a v e a u nique solution. If the input color for the up p er part is yel low (see Figures 14(b)–(d)), we ob tain unique solutions by similar argumen ts. Hence, this n ew AND subpuzzle uses only three colo rs and has unique solutions for eac h of the four p ossible com binations of input colo rs. OUT (a) Out: true OUT (b) Out: false x b c a OUT d (c) Scheme Figure 16: Th ree-color BOOL subp uzzle Input and output subpuzzles: The input v ariables of the b o olean circuit are repre- sen ted by the subp uzzle BOO L. Th e original four-color BOOL sub puzzle from [HH04] is sho wn in Figure 15. Ou r new three-color BOOL su bpuzzle is presented in Figure 16, and since it is completely different from the original su bpu zzle, no tiles are marked h ere. Th is subpu zzle has only tw o p ossib le solutions, one with the outpu t color blue (if the corre- sp ond ing v ariable is true ), and one with th e output color r e d (if the corresp onding v ariable is false ). The original four -color BOO L subp u zzle f rom [HH04] (whic h wa s not mo dified in [BR07]) con tains tiles w ith gr e en lines to exclude certain rotations. Our three-color BOOL sub puzzle do es not con tain any gr e e n lines, b ut it migh t not b e that ob vious that there are only t wo p ossible solutions, one for eac h outpu t color. First, we show that the output color yel low is not p ossible. If the outp u t color w ere yel low , there wo uld b e tw o p ossible orien tations for tile a . In the first orientat ion, the join t edge b etw een a and b is blue . This is not p ossible, h o w ev er, s in ce c (whic h is a Chin , namely a tile of t yp e t 8 ) do es not con tain the color-sequence sub string rr . By a similar argument for tile d , the other orienta tion with the output color yel low is not p ossible either. Second, w e sho w that tile x mak es the solution unique. F or the output colo r blue , there are tw o p ossible orien tations for eac h of the tiles a , b , c , and d . In order to exclude one of these orien tations in eac h ca se, tile x m ust con tain either of the color-sequence su bstrings br or yr at its edges join t with tiles b and c . On the other hand, for the outp ut color r e d , tile x must not con tain the color-sequence substring ry at its edges join t with b and c , b ecause 20 IN (a) TEST-true IN (b) TEST-false d IN a c b (c) Scheme Figure 17: Original TES T subpuzzles, see [HH04] this w ould lea ve t wo p ossible orientat ions for tile d . Tile t 1 satisfies all th ese conditions and mak es the solution of the BOOL subpuzzle unique, while using only three colors. IN (a) TEST-true IN (b) TEST-false d x IN a c b (c) Scheme Figure 18: Th r ee-color TEST subpuzzles Finally , a su bpuzzle is needed to c hec k whether or not the circuit ev aluates to true . This is ac hieved by the subp u zzle T EST-true shown in Figure 18(a) . It has only one v alid solution, n amely that its input color is blue . Just lik e the su b puzzle BOOL, the original four-color TE S T-true sub puzzle from [HH04], whic h is sho wn in Figure 17(a) and whic h w as not mo dified in [BR07], us es gr e en lines to exclude certain rotatio ns. Again, since the new TES T-true subpuzzle is completely differen t from the original subpu zzle, no tiles are mark ed here. Note that in the thr ee-colo r TE ST-true subpuzzle of Figure 18 (a), a and c are the same tiles as a and b in the WIRE subp uzzle of Figure 5. T o ensure that the input color is blue , we ha v e to consider all p ossible co lor-sequence su bstrings at the edges of d join t with c and a , and at the edges of b joint with a and c . F or eac h input colo r, there are four p ossib ilities. Assume that the input color is r e d . Then the p ossible color-sequence sub strings for tile d at the edges joint with c and a are: bb , yb , y y , and by . Similarly , the p ossible color- sequence su bstrings f or tile b at the edges join t with a and c are: yy , yb , b b , and by . Tile t 14 at p osition d exclud es by and yy , while tile t 11 at p osition b excludes yy and yb . Th us, r e d is not p ossible as the inpu t color. The input color yel low can b e excluded b y similar argumen ts. It follo ws that blue is the only p ossible input colo r. I t is clear that the tiles a and c ha v e a v ertical blue line. Due to the fact that neither t 11 nor t 14 con tains the color- sequence su bstrings rr or yy for the edges joint with tiles a and c , t wo p ossible solutions are still left. T he color-sequence substrin gs for these solutions at the edges of x join t with c and d are ry and yr . Since tile t 2 at p osition x conta ins the former but not th e latter sequence, the TES T-true subpuzzle uses only three colors and has a unique solution. (Note: Th e TEST -false subpuzzles in Figures 18(b) and 24(e) will b e needed for a circuit construction in Section 3.3, see Fig ur e 25. In p articular, the three-colo r T E ST- false su bpuzzle in Figure 18(b) is iden tical to the three-color TEST-true su bpuzzle fr om 21 Figure 18(a ) , except that the colors blue and r e d are exc h anged. By the ab o v e argument, the TEST -false sub puzzle h as only one v alid solution, namely that its input color is r e d .) The sh ap es of the su bpuzzles constructed ab o v e ha ve c hanged slig htly . Ho wev er, by Holzer and Holzer’s argument [HH04] ab out the minimal horizon tal d istance b et we en tw o wires and/or gat es b eing at least four, un in tended in teractions b etw een the subp uzzles do not o ccur. T his concludes the pro of of Theorem 3.2. ❑ Theorem 3.2 immediately giv es the follo win g corollary . Corollary 3.3 3 - TRP is NP -c omplete. Since the tile set T 3 is a subset of the tileset T 4 , we hav e 3-TRP ≤ p m 4-TRP. Thus, the hardness results for 3 -TRP and its v arian ts prov en in this pap er immediately are inherited b y 4-TRP and its v ariants, wh ic h provides an alternativ e p r o of of these hardness results for 4-TRP and its v ariants esta blished in [HH04, BR07]. In particular, Corollary 3.4 follo ws from Theorem 3.2 and Corollary 3.3. Corollary 3.4 ([HH04, BR07]) 4 - TRP is NP - c omplete, via a p arsimonious r e duction fr om SA T . 3.2 P arsimonious Reduction from SA T t o 2-TRP In con tr ast to the ab ov e-men tioned fact th at 3-TRP ≤ p m 4-TRP holds trivially , the reduction 2-TRP ≤ p m 3-TRP (wh ic h w e will s h o w to hold d u e to b oth problems b eing NP-complete, see Corollaries 3.3 and 3.6) is not immediatedly s tr aigh tforw ard, sin ce the tile set T 2 is not a sub set of the tile set T 3 (recall Figure 2 in Section 2 ). In this section, w e study 2-TRP and its v ariants. Our main result here is Theorem 3.5 b elo w. Theorem 3.5 SA T p arsimoniously r e duc es to 2 - TRP . Pro of. As in the pro of of Theorem 3.2, we again p ro vide a reduction from Circuit ∧ , ¬ -SA T, but h ere we use McColl’s p lanar cross-o v er circuit [McC81] instead of a CROSS subp uzzle. 4 W e c ho ose our color set C 2 to cont ain th e colors blue and r e d (corresp onding to the truth v alues true and false ), and w e use the tilese t T 2 sho wn in Figure 2(a). T o simulat e a b o olean circuit with AND and NOT gates, w e n o w present the sub puzzles constru cted only with tiles from T 2 . Wire subpuzzles: W e again use Brid tiles with a straigh t blue line to co nstru ct the WIRE subpu zzle with the colors blue and r e d as s ho wn in Figure 19. If the input color is blue , th en tiles a and b m u st hav e a vertica l blue line, so the output color will b e blue . If the input color is r e d , then the edge b et we en a and b m ust b e r e d to o, and it follo ws that the ouput color will also b e r e d . T ile x forces tiles a and b to fix the orientati on of the blue 4 Whether th ere exists an analogous tw o- color CROSS subp uzzle to simplify this construction, is still an open qu estion. 22 line for the input col or r e d . Since we care only ab out distinct color sequences of the tiles (recall the remarks m ade in Sectio n 2.2.1), 5 w e hav e unique solutions for b oth in p ut colors. Note th at this constru ction allo ws w ires of arbitrary heigh t, u nlik e the WIRE subpu zzle constructed in the pr o of of Th eorem 3.2 or th e WIRE s u bpuzzles constructed in [HH04, BR07], whic h all are constru cted so as to ha ve eve n height. T o construct tw o-color WIRE subpu zzles of arbitrary height, tile x of t yp e t 8 in Figure 19 w ould ha v e to b e placed on alternating sides of tiles a , b , etc. in eac h lev el. IN OUT (a) In: true IN OUT (b) In: false x IN a b OUT (c) Scheme Figure 19: Two-c olor WIRE subpu zzle The tw o-color MOVE subpu zzle is sho wn in Figure 20. Just like the WIRE subp uzzle, it consists only of tiles of t yp es t 3 and t 8 (see Figure 2(a)). F or the input color blue , it is ob vious that all tiles must hav e v ertical blue lines and s o the outpu t color is also blue . If the input color is r e d , then the edge b et we en a and b is r e d , to o. Since n either c nor d contai ns the color-sequence su bstring bb , the b lue lines of these four tiles ha v e all the same d irection. The same argument app lies to tiles e and f , and since tiles f , g , and x b ehav e like a WIRE subpu zzle, th e output color will b e r e d in this case. As ab o v e, since we care on ly ab out the color sequences of the tiles, we obtain unique solutions for b oth inp ut colo rs. Note th at Figure 20 sh o ws a mo v e to the right. A mov e to the left can b e m ade symmetrically , simply by mirrorin g this subp uzzle. IN OUT (a) In: true IN OUT (b) In: false IN a b c d e f g OUT x (c) Scheme Figure 20: Two-c olor MO VE subp uzzle 5 By contrast, if w e w ere to count all distinct orientatio ns of t h e tiles even if they hav e identical color sequences, w e w ould obtain tw o solutions each for tiles a and b , and six solutions for tile x , which gives a total of 24 solutions for each input color in th e W I RE subpuzzle. How ever, as argued in S ection 2.2.1, since our fo cus is on th e color sequences, w e hav e u nique solutions and thus a parsimonious reduction from SA T to 2-TRP. 23 OUT IN OUT (a) In: true OUT IN OUT (b) In: false y j k l OUT h i IN a b c d e f g OUT x (c) Scheme Figure 21: Tw o-color C OPY subpuzzle The last subp uzzle needed to simulate the wir es of the b o olean circuit is the COP Y subpu zzle in Figure 21. This sub puzzle is akin to the subpu zzle obtained by mirr orin g the MO VE subpuzzle in b oth directions, 6 so similar argumen ts as ab ov e w ork. Again, since we disregard the rep etitions of color sequences, w e hav e u nique solutions for b oth inpu t colors. Gate subpuzzles: Th e construction of the NOT subpu zzle presented in Figure 22 is similar to the corresp onding subpuzzle with three colors (see Figur e 12). Tiles b and d in the t wo -color version allo w only t wo p ossible orient ations of tile c , one for eac h input color. The first one h as b lue at the edge joint with a and , co nsequently , r e d at the edge joint with e ; the second p ossible orient ation has the same colors exchange d. Since tiles e , f , and x b eha ve lik e a WIRE subpuzzle, the outpu t color will “negate ” the input color, i.e., the output color w ill b e blue if the in put color is r e d , and it will b e r e d if th e inp ut color is blue . Tile x fixes the orien tation of tiles f and e and the orientat ion of tile a is fixed b y tile b . W e again obtain unique solutions, since we focus on color sequen ces. IN OUT (a) In: true IN OUT (b) In: false b x IN a c e f OUT d (c) Sc heme Figure 22: Tw o-color NOT sub puzzle 6 W e here sa y “is akin to. . . ” b ecause the COPY subpuzzle in Figure 21 d iffers from a tru e tw o-sided mirror versio n of MOVE by having a tile of type t 3 at p osition y instead of a t 8 as in p osition x . Why? By the argumen ts for the MO VE sub p uzzle, tile x already fixes the orientation of tiles a through k but not of l (if th e inp ut color is r e d , see Figure 21(b)). The orientation of tile l is then fixed by a t 3 tile at p osition y , since obviously a t 8 w ould not lead to a solution. How ever, it is clear that an argumen t analogous to that for the MOVE subpuzzle shows that all blue lines (except that of g in Figure 21(b)) have the same direction. 24 IN OUT IN (a) In: true, true IN OUT IN (b) In: true, false IN OUT IN (c) In: false, true IN OUT IN (d) In: false, fal se b s IN a c e f g r d t o q u v x OUT i m p w IN h j l n k P S f r a g r e p l a c e m e n t s z 1 z 2 z 3 (e) Scheme Figure 23: Two-c olor AND subpuzzle The AND subp u zzle is again the most complicate d one. T o analyze this subpuzzle, we sub divide it in to three disjoin t parts: 1. The first part consists of the tiles a through g , z 1 , and z 2 . Tiles a th rough f and z 2 form a tw o-color NOT sub puzzle, and tile g passes the color at the edge b et w een tiles f and g on to the edge b et w een tiles g and r . So the n egated left input color will b e at th e edge b et wee n tiles g and r . Tile z 1 fixes the orien tation of tile g to obtain a unique solution for this part of th e subpuzzle. 2. The second p art is formed b y the tiles h through q , and z 3 . Th is part is made from a t w o-color NOT and a t w o-color MO VE subpuzzle to n egate the r igh t input and mo ve it b y t wo p ositions to the left, whic h b oth are slightly m o dified with resp ect to the NOT in Figure 22 and the MOVE in Figure 20. First, the min or d ifferences b et ween the mo v e-to-the-left analog of the MO VE subpuz- zle f rom Figure 20 and this mo difi ed MO VE subp uzzle as part of the AND subp uzzle are the follo wing: (a) tile z 3 is p ositioned to the right of tiles q and u and n ot to their left, and (b) z 3 is a t 3 tile, whereas the tile at p osition x in Figure 20 is of t yp e t 8 . 25 Ho wev er, it is clear that the orien tation of the blue lines of tile s l through q is fixed b y tile k , and z 3 enforces u and q to hav e the same direction of blue lines. Second, the minor d ifference b et wee n the NOT from Figure 22 and this mo difi ed NOT subpu zzle as part of the AND sub puzzle is that tile m is not of t yp e t 8 (as is the x in Figure 22) b ut of t yp e t 3 , since the mo dified NOT and MO VE subp uzzles ha v e b een merged. These c hanges are needed to ensur e that we ge t a suitable height for this part of th e AND sub puzzle. Ho w ev er, it is again clea r that the orien tation of the blue lines of tiles l through q is fixed by tile k . 3. Finally , th e third part, f ormed by the til es r through x , b ehav es lik e a t w o-color subpu zzle simula ting a b o olean NOR gate, which is defined as ¬ ( α ∨ β ) ≡ ¬ α ∧ ¬ β . The tw o inputs to the NO R sub puzzle come fr om the edges betw een g and r and b et wee n q and u . If the left inpu t color (at the edge b et w een g and r ) is r e d , then tiles s and z 1 ensure that the edge b etw een r and t will also b e r e d . If the left input color is blue , then the edge b et w een r and t will b e blue by similar argu m en ts, and sin ce tile t is of t yp e t 3 , it passes this input color on to its join t edge with v in b oth ca ses. The right input to the u pp er part (at th e edge b et w een q and u ) is passed on by tile u to the edge b et wee n u and v . No w , we hav e b oth input colo rs at th e edges b etw een t and v and b et we en u and v . If both of these ed ges are r e d (see Figur e 23(a)), then tile w enforces that the edge b et wee n v and x will b e blue . On th e other hand, if one or b oth of v ’s edges w ith t and u are blue , then v ’s sh ort blue arc must b e at these edges, whic h enforces that the color at the edge b et we en v and x will b e r e d . Finally , tile x passes the color at the edge joint with tile v to the output. With the negated inpu ts of the first and second part, th is sub puzzle b eha v es like an AND gate, i.e., as a wh ole this subpu zzle simulates the computation of the b o olean function AND: ¬ ( ¬ α ∨ ¬ β ) ≡ ¬ ¬ α ∧ ¬¬ β ≡ α ∧ β . Again, s ince we care only ab out the color sequences of the tiles, we obtain unique solutions for eac h pair of input colors. OUT (a) BOOL Out: true OUT (b) BOOL Out: fal se a OUT x (c) BOOL Scheme IN (d) TEST-true IN (e) TEST-fal se IN a (f ) TEST Scheme Figure 24: Two-c olor BOOL and TEST subpu zzles 26 Input and output subpuzzles: The inpu t v ariables of the circuit are sim ulated by the subpu zzle BOOL. Constructing a sub puzzle w ith the only p ossible outputs blue or r e d is quite easy , since all tiles except t 7 and t 8 satisfy this condition. Figures 24(a)–(c ) sh o w our t w o-color BOO L subpu zzle. Note that tile x ensures the uniqu eness of th e solutions. The last step is to c hec k if the output of the w hole circuit is true . This is d on e by the subpu zzle TEST -true shown in Figure 24(d), w hic h s its on top of the subp uzzle simulating the circuit’s output gate. Since tile t 7 con tains only blue lines, the solution is unique. (Note: The su bpuzzle TE ST-false in Figure 24(e) will agai n b e needed in Section 3.3, see Figure 25. It has only r e d lines, so the inp ut is alw a ys r e d and the solution is un ique.) ❑ Theorem 3.5 immediately giv es the follo win g corollary . Corollary 3.6 2 - TRP is NP -c omplete. 3.3 Complexit y of the Unique, Another-Solution, and I nfinite V arian ts of 3-TRP and 2-TRP P arsimonious redu ctions pr eserv e the n umber of solutions and , in particular, the uniqu eness of solutions. Th u s, Th eorems 3.2 and 3.5 imply Corollary 3.7 b elo w that also employs V aliant and V azirani’s r esu lts on the DP-hardness of Unique-SA T und er ≤ p r an -reductions (whic h were defined in Section 2). The pro of of Corollary 3.7 follo ws th e lines of th e pro of of [BR07, Th eorem 6], whic h states th e analogo us result for Uniqu e-4-TRP in place of Unique-3-TRP and Unique-2-TRP. Corollary 3.7 1. Un ique - SA T p arsimoniously r e duc es to the pr oblems Un ique - 3 - TRP and Unique - 2 - TRP . 2. Both Unique - 3 - TRP and Unique - 2 - TRP ar e DP -c omplete u nder ≤ p r an -r e ductions. W e no w turn to the another-solution problems for k -TRP. Corollary 3.8 1. F or e ach k ∈ { 2 , 3 , 4 } , S A T ≤ p asp k - TRP . 2. F or k ∈ { 2 , 3 , 4 } , AS - k - TRP is NP -c omplete. Pro of. In Sections 3.1 and 3.2, we s ho we d a parsim on ious reduction from Circuit ∧ , ¬ -SA T to 3-TRP and 2-TRP. T o pro ve the first p art of th is corollary , w e hav e to s ho w (see Section 2.1 ) that there is a p olynomial-time computable function bijectiv ely mapping the solutions of an y giv en Cir cuit ∧ , ¬ -SA T instance C to the solutions of the k -TRP instance corresp ondin g to C , for eac h k ∈ { 2 , 3 , 4 } . Ho wev er, n ote that a satisfying assignment to the v ariables of the circuit C imm ed iately give s the s olution for th e BOOL sub puzzles according to our reduction for k -TRP, see th e pro of of Theorem 3.5 (for k = 2), of Theorem 3.2 (for k = 3), an d of th e result presented for 4 -T R P in [BR07] (for k = 4). In eac h case, our circuit is constructed as a sequ ence of steps, so the solutions for the BOOL subpuzzles determine the co lor at the input for all subpuzzles at the n ext step, and so on. Since all subpuzzles ha ve unique solutions w e can construct a solution to our puzzle in p olynomial time from b ottom to top usin g the parsimonious reductions men tioned ab o ve . No w, giv en the assignmen t of the v ariables, we ju st h a v e to place the tiles of the 27 AND TEST−true (a) Empty word not accepted AND TEST−false (b) Empty word accepted Figure 25: Two c hoices for the i th la ye r of the infi nite circuit for In f -2-TRP and Inf -3-TRP single subpuzzles according to the determined solution and so sp ecify their orienta tion. Con ve rsely , if w e h a v e a solution of a resulting k -TRP instance for k ∈ { 2 , 3 , 4 } , the outpu t colors at the BOOL sub puzzles giv es the corresp onding s atisfying assignmen t to the v ariables of the circuit. T o p ro v e the second part of C orollary 3.8, note that AS -SA T is NP-complete [YS02], and since th e p arsimonious r eduction from S A T to Circuit ∧ , ¬ -SA T provi des a bijectiv e transf or- mation b et w een these p roblems’ solution sets, AS-Circuit ∧ , ¬ -SA T is also NP-complete . It follo ws immediately , that the problems AS-3-TRP and AS-2-TRP are NP-complete. F ur- thermore, AS-4-TRP inherits the NP-completeness result from AS-3-TRP. ❑ Holzer and Holzer [HH04] p ro v ed that Inf -4-TRP, the infi nite T antrix TM rotation puzzle problem with four colors, is und ecidable, via a reduction f rom (the complement of ) the empt y-w ord problem for T urin g machines. Th e pro of of Theorem 3.9 b elo w uses essen tially the same argumen t bu t is based on our mo dified thr ee-color and tw o-color constructions. Theorem 3.9 Both Inf - 2 - TRP and Inf - 3 - TRP ar e u nde cidable. Pro of. The empty- word problem for T u ring mac hin es asks whether th e empty word, λ , b elongs to the language L ( M ) accepted b y a giv en T ur ing mac hin e M . By Rice’s T heo- rem [Ric53], b oth this problem and its complement are und ecidable. T o reduce the lat ter problem to either Inf -2-TRP or Inf -3-TRP, w e do the f ollo win g. L et M i denote the s im u- lation of a T u ring mac hine M for exactly i steps. Then, M i accepts its input if and only if M accepts the in put within i steps. W e employ another circuit construction that will b e simula ted by a T an trix TM rotation puzzle. First, t w o wires are initialized with the b o olean v alue true . Then, in eac h step, we use either the circuit shown in Figure 25(a) or th e one s h o wn in Figure 25(b). The former circuit is c hosen in step i if λ / ∈ L ( M i ), and the latte r one is chosen in step i if λ ∈ L ( M i ). T o transform this circuit into an In f - k -TRP in stance, wh ere k is either t wo or three, w e use the TEST -tru e s u bpuzzle from either Figure 18(a) or Figure 24(d), rotated by 180 degrees and with the “IN” tile b ecoming an “OUT” tile, in order to in itialize b oth wires w ith the input true . Th en we substitute the single la yers of the circuit b y the su b puzzles describ ed ab o ve , step by step, alw a ys choosing either the circuit from Figure 25(a) (where TEST-true is the subp uzzle f rom Figure 18(a) if k = 3, or from Figure 24(d) if k = 2), or the circuit 28 from Figure 25(b) (wh ere TEST-false is the sub puzzle from Figure 18(b) if k = 3, or from Figure 24(e) if k = 2). Since b oth wir es are initialized with the v alue true , it is obvious that the constructed subpu zzle has a solution if and only if λ / ∈ L ( M ). Note that th e la y out of the circuit is computable, and our reduction will output the enco din g of a T uring mac h ine computing first this circuit la yo ut and then the transformation to the T an trix TM rotation puzzle as describ ed ab o ve . By th is reduction, b oth Inf -2-TRP and Inf -3-TRP are sh own to b e und ecidable. ❑ 4 Conclusions This pap er studied the th r ee-color and t wo- color T antrix TM rotation pu zzle p roblems, 3-TRP and 2-TRP , and their unique, another-solution, and infinite v ariant s. Our main con tribution is th at b oth 3-TRP and 2-TR P are NP-complete via a parsimonious reduc- tion from SA T, w hic h in particular solve s a qu estion raised by Holzer and Holzer [HH0 4]. Since restricting th e num b er of colors to three and t wo , resp ectiv ely , d rastically r educes the n umb er of T antrix TM tiles a v ailable, our constru ctions as w ell as our correctness arguments substanti ally differ from those in [HH04, BR07]. T able 1 in S ection 1 shows that our results giv e a complete picture of the complexit y of k -TRP, 1 ≤ k ≤ 4. An interesti ng question still remaining op en is wh ether the analogs of k -TRP without holes still are NP-complete. Ac kno wledgmen ts: W e are grateful to Markus Holze r and Piotr F aliszewski for inspiring discussions on T an trix TM rotation puzzles, and w e thank T homas Baumeister f or his help with pr o ducing reasonably small figures. W e thank the anon ymou s LA T A 2008 referees for helpful comment s, a nd in p articular the r eferee who let u s kno w that he or she h as also written a program for v erifying th e correctness of our constructions. References [BR] D. Baumeister and J. Rothe. T he thr ee-color and t w o-color Tan trix TM rotation puzzle p r oblems are NP-co mplete via p arsimonious red u ctions. In P r o c e e dings of the 2nd International Confer enc e on L anguage and Automa ta The ory and Applic ations . S pringer-V erlag L e c tu r e Notes in Computer Scienc e . T o app ear. [BR07] D. Baumeister and J. Rothe. Satisfiabilit y parsim on ious ly red uces to the T an trix TM rotation puzzle pr oblem. In Pr o c e e dings of the 5th Confer e nc e on Machines, Computations and Universality , pages 134–145 . Springer-V erlag L e c- tur e Notes in Computer Scienc e #4664 , Septem b er 2007. [CGH + 88] J. Cai, T . Gund er m ann, J. Hartmanis, L. Hemac h andra, V. Sew elson, K. W ag- ner, and G. W ec hsun g. The b o olean h ierarch y I: Structur al prop erties. SIAM Journal on Computing , 17(6) :1232–12 52, 198 8. [CGH + 89] J. Cai, T . Gund er m ann, J. Hartmanis, L. Hemac h andra, V. Sew elson, K. W ag- ner, and G. W ec hsu ng. The b o olean h ierarc h y I I: Applications. SIAM Journal on Computing , 18(1): 95–111, 1989. 29 [CKR95] R. C hang, J. K adin, and P . Rohatgi. On u nique satisfiabilit y and the threshold b ehavio r of r andomized reductions. Journa l of Computer and System Scie nc es , 50(3): 359–373, 1995. [Co o71] S. Co ok. The complexit y of theorem-pro ving p ro cedur es. In P r o c e e dings of the 3r d ACM Symp osium on The ory of Computing , pages 151–158. A CM Press, 1971. [Do w05] K. Downing. T antrix: A m in ute to learn, 100 (genetic algorithm) generat ions to master. Genetic Pr o gr amming and Evolvable Machines , 6(4):381 –406, 2005. [Gol77] L. Goldschlag er. The monotone and planar circuit v alue p roblems are log space complete for P. SIGACT News , 9(2 ):25–29, 1977. [Gr¨ a90] E. Gr¨ adel. Domino games and complexit y . SIAM Journal on Computing , 19(5): 787–804, 1990. [HH04] M. Holzer and W. Holzer. T antrix TM rotation puzzles are intracta ble. Discr ete Applie d Mathematics , 144(3):34 5–358, 2004. [McC81] W. McColl. Planar crosso vers. IEEE T r ansactions on Computers , C-30(3):223 – 225, 1981. [P ap94] C. P apadimitriou. Computatio nal Complexity . Addison-W esley , 1994. [PY84] C. P apadimitriou and M. Y annak akis. The complexit y of facets (and some facets of complexit y). Journal of Computer and System Scienc es , 28(2):24 4–259, 1984. [Ric53] H. Rice. Cla sses of recursiv ely en u merable set s and their decision problems. T r ansactions of the Americ an Mathematic al So ci e ty , 74:358 –366, 1953. [Rot05] J. Rothe. Complexity The ory and Cryptolo gy. An Intr o duction to Crypto c om- plexity . EA T CS T exts in T heoretical Computer S cience. S pringer-V erlag, Berlin, Heidelb erg, New Y ork, 2005. [UN96] N. Ueda and T. Nagao. NP-completeness r esults for NO NO GRAM via parsimo- nious reductions. T ec hnical Report TR96-0008 , T okyo In stitute of T ec hnology , Departmen t of In f ormation Science, T oky o, J apan, Ma y 1996. [V al79] L. V alian t. The complexit y of computing the p ermanen t. The or etic al Computer Scienc e , 8(2):189– 201, 1979. [VV86] L. V alian t and V. V azirani. NP is as easy as detecting un ique solutions. The o- r etic al Computer Scienc e , 47:85 –93, 1986. [YS02] T. Y ato and T. S eta. C omplexit y and completeness of fi nding another solution and its application to puzzles. Joho Shori Gakkai Kenkyu H okoku , 2002(1 03(AL- 87)):9 –16, 2002. 30

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment