Spiral Galaxies Puzzles are NP-complete

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Reductions Complexity ©D.Moshkovitz.
P, NP, NP-Complete Problems
Sep 16, 2013 Lirong Xia Computational social choice The easy-to-compute axiom.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Introduction to Algorithms NP-Complete
Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Limitation of Computation Power – P, NP, and NP-complete
Max Cut Problem Daniel Natapov.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
NP-Completeness Lecture for CS 302. Traveling Salesperson Problem You have to visit n cities You want to make the shortest trip How could you do this?
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Discrete Structures & Algorithms The P vs. NP Question EECE 320.
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
NP-complete and NP-hard problems
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
CSCE350 Algorithms and Data Structure
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
All that remains is to connect the edges in the variable-setters to the appropriate clause-checkers in the way that we require. This is done by the convey.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
The Game of Cubic is NP-complete Erich Friedman Stetson University.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
NPC.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 CSE 326: Data Structures: Graphs Lecture 23: Wednesday, March 5 th, 2003.
Construction We constructed the following graph: This graph has several nice properties: Diameter Two Graph Pebbling Tim Lewis 1, Dan Simpson 1, Sam Taggart.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
P & NP.
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
NP-Complete Problems.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Lecture 23 NP-Hard Problems
Presentation transcript:

Spiral Galaxies Puzzles are NP-complete Erich Friedman Stetson University October 2, 2002

Spiral 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.

P and NP P 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.

NP-Completeness NP-complete problems are: A problem is NP-complete if: it is in NP, and the 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 time the hardest such problems

Examples 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?

Spiral Galaxies Puzzles are NP-complete The Main Result of this talk is: The question of whether or not a given Spiral Galaxies 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 gates Since Satisfiability is NP-complete, Spiral Galaxies puzzles are also NP-complete.

The Construction We need: wires variables that can have either truth value way to end a wire that forces it to be TRUE NOT gate AND gate OR gate way to split the signal in a wire way to allow wires to cross

Wires and Signals wires 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 signal a FALSE signal

Variables variables are configurations with two local solutions. A TRUE variable a FALSE variable

Ending Wires to force a TRUE or FALSE signal in a wire, we can end the wire at an appropriate point. forcing a TRUE signal forcing a FALSE signal

NOT Gate the NOT gate is a wire that contains a pair of circles that are only 2 units away.

AND Gate

OR Gate

Letting Wires Cross

Splitting a Signal

Moving Wires to 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.

Filling in the Holes to make the puzzle rectangular, we put a circle in every grid square that is not a part of the circuit.

Summary For 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.

References [1] T. C. Biedl, E. D. Demaine, M. L. Demaine, R. Fleischer, L. Jacobsen, and J. I. Munro, "The Complexity of Clickomania". preprint. [2] J. Culberson, "Sokoban is PSPACE complete." Proc. Internet Conf. Fun with Algorithms (1998), N. S. E. Lodi, L. Pagli, Ed., Carelton Scientific, 65-76. [3] E. D. Demaine and M. Hoffman, "Pushing blocks is NP-complete for non-crossing solution paths". Proc. 13th Canad. Conf. Comput. Geom. (2001), 65-68. [4] E. Friedman, "Corral Puzzles are NP-complete". preprint. [5] E. Friedman, "Cubic is NP-complete". Proc. 2001 Fl. Sectional MAA meeting, David Kerr ,Ed. [6] E. Friedman, ”Pearl Puzzles are NP-complete". preprint. [7] M.R. Garey and D.S. Johnson, Computers and Intractibility: A Guide to the Theory of NP-Completeness. W.H. Freeman, 1979. [8] R. Kaye, "Minesweeper is NP-complete". Mathematical Intelligencer, 22 (2000) 9-15. [9] Nikoli, 91 (2000). [10] 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) 111-137. [11] S. Takahiro, "The Complexities of Puzzles, Cross Sum, and Their ASPs". preprint. [12] Y. Takayuki, "On the NP-completeness of the Slither Link Puzzle". IPSJ SIGNotes Algorithms (2000). [13] N. Ueda and T. Nagao, "NP-completeness Results for Nonogram via Parsimonious Reductions". preprint.