4

Is the decision version (i.e. does a solution exist) of this puzzle NP-hard (for an nxn puzzle)? It feels like it has very local strategies which allow easily solving the instances, but it's not obvious to me that these generalize to larger puzzles. The rules are as follows:

  1. Each tile has exits on some of its edges
  2. Each tile may be rotated but not flipped
  3. All tiles must form a single component in solution where two adjacent are connected if both of them have exits touching
  4. All exits must be connected to an exit on the other tile they face

It's very easy to see that brute force requires exponential time, but constructing a gadget to show that this puzzle is NP-hard seems quite difficult.

Davis Yoshida
  • 371
  • 1
  • 10

1 Answers1

2

In the Linux computer game KPlumber, the objective is to rotate tiles in a raster of squares so as to complete a system of pipes. We give a complexity classification for the original game and various special cases of it that arise from restricting the set of six possible tiles. Most of the cases are NP-complete. One polynomially solvable case is settled by formulating it as a perfect matching problem; other polynomial cases are settled by simple sweepline techniques. Moreover, we show that all the unsettled cases are polynomial time equivalent.

It is tough to be a plumber. Král, Daniel; Majerech, Vladan; Sgall, Jirí; Tichy, Tomass; Woeginger, Gerhard. In: Theoretical computer science, Vol. 313, No. 3, 2004, p. 474-484.

https://doi.org/10.1016/j.tcs.2002.12.002

Hendrik Jan
  • 30,578
  • 1
  • 51
  • 105