Presentation on theme: "Spiral Galaxies Puzzles are NP-complete"— Presentation transcript:
1Spiral Galaxies Puzzles are NP-complete Erich FriedmanStetson UniversityOctober 2, 2002
2Spiral Galaxies Puzzles puzzles consist of grid of squares and some circles.the object is to divide a puzzle into connected groups of squares that contain one circle, which must be a center of rotational symmetry.
3P and NPP is the set of all yes/no problems which are decidable in polynomial time.NP is the set of all yes/no problems in which a “proof” for a yes answer can be checked in polynomial time.P is a subset of NP.The question whether P=NP is one of the most important open questions in computer science.
4NP-Completeness NP-complete problems are: A problem is NP-complete if: it is in NP, andthe existence of a polynomial time algorithm to solve it implies the existence of a polynomial time algorithm for all problems in NP.NP-complete problems are:easy enough to check in polynomial timethe hardest such problems
5Examples of NP-Completeness Examples of NP-complete problems are:3-Colorability: Can the vertices of a graph G be colored with 3 colors so that every pair of adjacent vertices has different colors?Hamiltonicity: Does a graph G have a circuit that visits each vertex exactly once?Bin Packing: Can we divide N numbers in K sets so that each set has sum less than S?Satisfiability: Are there inputs to a Boolean circuit with AND/OR/NOT gates that make the outputs TRUE?
6Spiral Galaxies Puzzles are NP-complete The Main Result of this talk is:The question of whether or not a given SpiralGalaxies puzzle has a solution is NP-complete.To prove this, we will build arbitrary Boolean circuits in the Spiral Galaxies universe."wires" carry truth values"junctions" in wires simulate logical gatesSince Satisfiability is NP-complete, Spiral Galaxies puzzles are also NP-complete.
7The Construction We need: wires variables that can have either truth valueway to end a wire that forces it to be TRUENOT gateAND gateOR gateway to split the signal in a wireway to allow wires to cross
8Wires and Signalswires are rectangles of height 2 with a circle every 3 units.a wire carries the value TRUE if the solution involves 3x2 rectangles and FALSE if the solution involves alternating 5x2 and 1x2 rectangles.A TRUE signala FALSE signal
9Variables variables are configurations with two local solutions. A TRUE variablea FALSE variable
10Ending Wiresto force a TRUE or FALSE signal in a wire, we can end the wire at an appropriate point.forcing a TRUE signalforcing a FALSE signal
11NOT Gatethe NOT gate is a wire that contains a pair of circles that are only 2 units away.
16Moving Wiresto shift a wire one unit left, we use three consecutive circles each a distance of 2.5 units from the previous one.to shift a wire one unit up, we use three consecutive circles each raised .5 units from the previous one.
17Filling in the Holesto make the puzzle rectangular, we put a circle in every grid square that is not a part of the circuit.
18SummaryFor any given circuit, we can find a Spiral Galaxies puzzle that can be solved if and only if there is a set of inputs to the circuit that make the output TRUE.This Satisfiability problem for circuits is known to be NP-complete.The mapping we gave is polynomial.Therefore whether or not a given Spiral Galaxies puzzle has a solution is also NP-complete.
19References T. C. Biedl, E. D. Demaine, M. L. Demaine, R. Fleischer, L. Jacobsen, and J. I. Munro, "The Complexity of Clickomania". preprint. J. Culberson, "Sokoban is PSPACE complete." Proc. Internet Conf. Fun with Algorithms (1998), N. S. E. Lodi, L. Pagli, Ed., Carelton Scientific, E. D. Demaine and M. Hoffman, "Pushing blocks is NP-complete for non-crossing solution paths". Proc. 13th Canad. Conf. Comput. Geom. (2001), E. Friedman, "Corral Puzzles are NP-complete". preprint. E. Friedman, "Cubic is NP-complete". Proc Fl. Sectional MAA meeting, David Kerr ,Ed. E. Friedman, ”Pearl Puzzles are NP-complete". preprint. M.R. Garey and D.S. Johnson, Computers and Intractibility: A Guide to the Theory of NP-Completeness. W.H. Freeman, 1979. R. Kaye, "Minesweeper is NP-complete". Mathematical Intelligencer, 22 (2000) 9-15. Nikoli, 91 (2000). D. Ratner and M. Warmuth, "Finding a shortest solution for the n x n extension of the 15-puzzle is intractable". J. Symb. Comp. 10 (1990) S. Takahiro, "The Complexities of Puzzles, Cross Sum, and Their ASPs". preprint. Y. Takayuki, "On the NP-completeness of the Slither Link Puzzle". IPSJ SIGNotes Algorithms (2000). N. Ueda and T. Nagao, "NP-completeness Results for Nonogram via Parsimonious Reductions". preprint.