patternMinor
Are "pipes" puzzles NP-hard?
Viewed 0 times
arehardpipespuzzles
Problem
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:
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.
- Each tile has exits on some of its edges
- Each tile may be rotated but not flipped
- All tiles must form a single component in solution where two adjacent are connected if both of them have exits touching
- 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.
Solution
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
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
Context
StackExchange Computer Science Q#131970, answer score: 2
Revisions (0)
No revisions yet.