Light Up is NP-complete

Similar documents
Pearl Puzzles are NP-complete

HIROIMONO is N P-complete

The Complexity of Generalized Pipe Link Puzzles

arxiv: v1 [cs.cc] 7 Mar 2012

Problem Set 4 Due: Wednesday, November 12th, 2014

Lecture 20 November 13, 2014

Herugolf and Makaro are NP-complete

Variations on Instant Insanity

2048 IS (PSPACE) HARD, BUT SOMETIMES EASY

arxiv: v1 [cs.cc] 12 Dec 2017

Zig-Zag Numberlink is NP-Complete

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES

arxiv:cs/ v2 [cs.cc] 27 Jul 2001

Algorithms and Complexity for Japanese Puzzles

Spiral Galaxies Font

Lecture 19 November 6, 2014

Physical Zero-Knowledge Proof: From Sudoku to Nonogram

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

Alessandro Cincotti School of Information Science, Japan Advanced Institute of Science and Technology, Japan

Scrabble is PSPACE-Complete

A comparison of a genetic algorithm and a depth first search algorithm applied to Japanese nonograms

Scrabble is PSPACE-Complete

Technical framework of Operating System using Turing Machines

Fraser Stewart Department of Mathematics and Statistics, Xi An Jiaotong University, Xi An, Shaanxi, China

Faithful Representations of Graphs by Islands in the Extended Grid

The mathematics of Septoku

Kaboozle Is NP-complete, even in a Strip

Tetsuo JAIST EikD Erik D. Martin L. MIT

arxiv: v2 [cs.cc] 29 Dec 2017

A GRAPH THEORETICAL APPROACH TO SOLVING SCRAMBLE SQUARES PUZZLES. 1. Introduction

MULTINATIONAL WAR IS HARD

How hard are computer games? Graham Cormode, DIMACS

Computational complexity of two-dimensional platform games

Exercise 2: OR/NOR Logic Functions

Constructing Simple Nonograms of Varying Difficulty

On the fairness and complexity of generalized k-in-a-row games

depth parallel time width hardware number of gates computational work sequential time Theorem: For all, CRAM AC AC ThC NC L NL sac AC ThC NC sac

Introduction To Automata Theory Languages And Computation Addison Wesley Series In Computer Science

THE ENUMERATION OF PERMUTATIONS SORTABLE BY POP STACKS IN PARALLEL

Even 1 n Edge-Matching and Jigsaw Puzzles are Really Hard

of the hypothesis, but it would not lead to a proof. P 1

The patterns considered here are black and white and represented by a rectangular grid of cells. Here is a typical pattern: [Redundant]

DIGITAL ELECTRONICS. Methods & diagrams : 1 Graph plotting : - Tables & analysis : - Questions & discussion : 6 Performance : 3

Rating and Generating Sudoku Puzzles Based On Constraint Satisfaction Problems

UNO is hard, even for a single player

Generalized Amazons is PSPACE Complete

One-Dimensional Peg Solitaire, and Duotaire

Analysis of Power Assignment in Radio Networks with Two Power Levels

An Exploration of the Minimum Clue Sudoku Problem

Solving Nonograms by combining relaxations

2. Previous works Yu and Jing [2][3] they used some logical rules are deduced to paint some cells. Then, they used the chronological backtracking algo

Who witnesses The Witness? Finding witnesses in The Witness is hard and sometimes impossible

More NP Complete Games Richard Carini and Connor Lemp February 17, 2015

The Complexity of Escaping Labyrinths and Enchanted Forests

Amazons, Konane, and Cross Purposes are PSPACE-complete

Easy Games and Hard Games

A year ago I investigated a mathematical problem relating to Latin squares. Most people, whether knowing it or not, have actually seen a Latin square

CSCI 1590 Intro to Computational Complexity

An Optimal Algorithm for a Strategy Game

Lecture 16 Scribe Notes

Graphs of Tilings. Patrick Callahan, University of California Office of the President, Oakland, CA

arxiv: v2 [cs.cc] 20 Nov 2018

Pattern Avoidance in Unimodal and V-unimodal Permutations

UNO is hard, even for a single playe. Demaine, Erik D.; Demaine, Martin L. Citation Theoretical Computer Science, 521: 5

arxiv: v1 [cs.cc] 12 Jul 2018

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

The Complexity of Flat Origami. Abstract. We study a basic problem in mathematical origami: determine if a given crease

The Computational Complexity of Angry Birds and Similar Physics-Simulation Games

You Should Be Scared of German Ghost

Lecture 1, CS 2050, Intro Discrete Math for Computer Science

Jamie Mulholland, Simon Fraser University

Folding a Paper Strip to Minimize Thickness

arxiv: v1 [cs.gt] 29 Feb 2012

The Mathematics Behind Sudoku Laura Olliverrie Based off research by Bertram Felgenhauer, Ed Russel and Frazer Jarvis. Abstract

arxiv: v1 [cs.cc] 14 Jun 2018

The Hardness of the Lemmings Game, or Oh no, more NP-Completeness Proofs

Latin squares and related combinatorial designs. Leonard Soicher Queen Mary, University of London July 2013

Crease pattern of Mooser's Train removed due to copyright restrictions. Refer to: Fig from Lang, Robert J. Origami Design Secrets: Mathematical

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

Quantified Boolean Formulas: Call the Plumber!

arxiv:math/ v1 [math.co] 22 Aug 2000

Formal Foundation of Digital Design

Solving Japanese Puzzles with Heuristics

arxiv: v1 [cs.cc] 21 Jun 2017

Part I: The Swap Puzzle

Taking Sudoku Seriously

A NUMBER THEORY APPROACH TO PROBLEM REPRESENTATION AND SOLUTION

The Tilings of Deficient Squares by Ribbon L-Tetrominoes Are Diagonally Cracked

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

Universiteit Leiden Opleiding Informatica

HANDS-ON TRANSFORMATIONS: DILATIONS AND SIMILARITY (Poll Code 44273)

Two Parity Puzzles Related to Generalized Space-Filling Peano Curve Constructions and Some Beautiful Silk Scarves

Lumines is NP-complete

Circuit complexity of shuffle

EEE 301 Digital Electronics

Using KenKen to Build Reasoning Skills 1

Mario Kart Is Hard. Citation. As Published Publisher. Version

Basic Science for Software Developers

CHAPTER 3 BASIC & COMBINATIONAL LOGIC CIRCUIT

A MOVING-KNIFE SOLUTION TO THE FOUR-PERSON ENVY-FREE CAKE-DIVISION PROBLEM

Transcription:

Light Up is NP-complete Brandon McPhail February 8, 5 ( ) w a b a b z y Figure : An OR/NOR gate for our encoding of logic circuits as a Light Up puzzle. Abstract Light Up is one of many paper-and-pencil puzzles recently popular in Japan (and now elsewhere). The question, Is this Light Up puzzle solvable? turns out to be very hard to answer in general. We devise a polynomial-time reduction from Circuit-SAT to Light Up to prove that Light Up is NP-complete. We introduce Light Up and illustrate how Boolean circuits can be encoded as Light Up puzzles. These Light Up circuits are constructed from a collection arrangeable circuit gadgets, like the one in Fig.. Introduction Light Up is one of many popular pencil-and-paper puzzles originating in Japan. Most, if not all, paper-and-pencil puzzles consist of a grid of cells, a

list of rules, and some initially specified cells. The objective is to complete the puzzle by shading in sections of the grid in compliance with the rules. ato[3] provides the following list of popular paper-and-pencil puzzles: Nurikabe[3] * Nonogram[9] (or Paint-by-Numbers) * Slither Link[] * Cross Sum[7] (or Kakkuro) * Number Place[7] (or Sudoku) * Heyawake Those marked with a * are known to be NP-complete. According to Ueda and Nagao[9], Nonogram was the first paper-and-pencil puzzle to be proved NP-complete, although various NP-completeness results have been found for paper-and-pencil puzzles since then[3]. By constructing a polynomialtime reduction from Circuit-SAT to Light Up, we present here a new NPcompleteness result for paper-and-pencil puzzles. How to play Light Up Perhaps the best way to learn how to play Light Up is to visit the website of the puzzle s creator, Nikoli, at: http://www.nikoli.co.jp/puzzles/3/inde_tet-e.htm Many more puzzles can be printed out or played online at: http://www.puzzle.jp/letsplay/play_bijutsukan-e.html 3 The decision problem Light Up puzzles seem hard to solve. We characterize the decision problem for Light Up as, Given a Light Up puzzle, does a solution eist? The compleity class P comprises of decision problems we can answer in reasonable (polynomial) time. Those decision problems we can verify in

reasonable (polynomial) time belong to the compleity class NP. A problem is NP-hard if any other problem in NP can be reduced to it. A problem is NP-complete if it is in NP and is NP-hard. Light Up is easily seen to be in NP. Given a Light Up puzzle and a placement of lights, we can quickly determine whether each of the rules has been satisfied. 4 Theorem: Light Up is NP-hard Any problem in NP can be reduced in time polynomial in the size of the inputs to the problem of satisfying Boolean circuits (also known as Circuit-SAT). By demonstrating a polynomial-time reduction of Circuit-SAT to Light Up, it follows that any problem in NP can be reduced to Light Up, that is, Light Up is NP-hard. We present a proof by construction, similar to the techniques used by Kaye[], Friedman[6], and Moore and Robson[4]. Our goal is to model the properties of a Boolean circuit using only the rules of Light Up. Given a Boolean circuit, we will construct a corresponding circuit on a Light Up board in time polynomial in the number of squares in the puzzle grid. Figure : The wire tile (top) allows only two possible places for a light. We can string together wire tiles to propagate a Boolean signal (middle). Note that we can also stretch a wire tile by inserting arbitrarily long regions surrounded by zeros (bottom). 3

5 Proof by construction First, we construct a grid large enough to contain our circuit. Unless otherwise specified, all cells in our grid will be black. As a Boolean circuit consists of distinct gadgets, so too will our Light Up puzzles be divided into separate parts. We refer to each part or gadget as a tile. 5. Wire construction All of our circuits will be constructed on a simple tiling of our gadgets that is consistent with the rules of Light Up. The wire tile has one of two possible states. If the cells are assigned lights, we say the state is true. If instead the cells are assigned lights, we say the state is false. We can string these tiles together to propagate this truth assignment. Note that lining our wires up with the other gadgets in our grid-based circuit is easy, since, as demonstrated in Fig. 3, we can stretch and even bend the wires as we see fit. Figure 3: By introducing a set of corner tiles, we can bend our wires to take more interesting and useful paths. 4

Figure 4: The branch/not gate (top left) allows us to split a wire into a signal and its complement. We can modify the tile in Fig. 4 to produce a NOT gate (bottom) and a branch gate (top right). Figure 5: We can fi terminate both ends of this wire to form a complete Boolean circuit. The on the right forces us to place a light bulb at the beginning of the wire on the left; we have found a satisfying truth assignment for this circuit. 5. Assigning values A Boolean circuit is satisfiable if and only if our Light Up puzzle has a solution. To ensure this bijection, we fi the final output wire to true. The input wires may take on different values, and if we find any placement of lights for them that results in a solution, this will correspond to a satisfying truth assignment for our circuit. Fig. 5 shows a complete Boolean circuit corresponding the Boolean epression consisting only of a single literal. By capping the right end of the wire with a, we ve actually forced the final output to be true. The only satisfying assignment, of course, it to set := true, which in our Light Up puzzle means placing a light bulb in the left end of the wire. If we had capped the wire instead with a, we would have forced the final output of the wire to be false. 5

5.3 Branch and NOT gates We d like to split our wires to allow the output of one gadget to form the input for multiple other gadgets. The gadget in Fig. 4 splits our wire into three wires, but the signal is flipped in the middle outgoing wire. We ll call this our branch/not gate. If we cap the middle outgoing wire of the branch/not gate, we get a branch gate. If we instead cap the top and bottom outgoing wires of the branch/not gate, we are left with just a NOT gate. ( ) w a b a b z y w w a b a b y z y y z y z y y a b a b w w w w w w w Figure 6: Given inputs and y, the OR/NOR gate (left) outputs both the elusive NOR and inclusive OR of the inputs. Capping one of these outputs produces an OR gate (middle) or an OR gate (right). 5.4 The OR gate The OR/NOR gate, like the branch/not gate, is a two-for-one logic gate. Given two input wires (we ll label them and y), the OR/NOR gate outputs both the eclusive NOR ( y) = ( y) ( y) and the inclusive OR y. We can of course cap one of these two outgoing wires to transform the OR/NOR gate into just an NOR gate or just an inclusive OR gate. 6

Figure 7: From OR gates like the one in Fig. 6, we can construct a wire crossing. 5.5 Important details Our circuit lies in a plane, so we need to either describe eplicitly how wires should cross without interacting or show that wire crossing aren t necessary. As it turns out, we already have sufficient gadgetry to build a wire crossing. From an NOR gate and a NOT gate, we can build an OR gate. We can then use 3 branch and 3 OR gates to allow two wires to cross. 5.6 An eample construction At this point, we have enough gadgetry to embed all possible Boolean circuits in Light Up puzzles. As an eample, a satisfying assignment can be found for the Boolean epression (( y) z) if and only if the Light Up puzzle in Fig. 5.6 has a solution. 7

Figure 8: The Boolean epression (( y) z) is satisfiable if and only if this puzzle has a solution. References [] L. Auslander and S. Parter. On Imbedding Graphs in the Sphere. J. Math. Mechanics, ():57 53, 96. [] Therese C. Biedl, Erik D. Demaine, Martin L. Demaine, Rudolf Fleischer, Lars Jacobsen, and J.Ĩan Munro. The Compleity of Clickomania, July. preprint. [3] Stephen A. Cook. The compleity of theorem-proving procedures. In Proceedings of the 3rd Annual ACM Symposium on Theory of Comput- 8

ing, pages 5 58, New ork, New ork, 97. Association for Computing Machinery, ACM Press. [4] H. de Frayssei, J. Pach, and R. Pollack. How to draw a planar graph on a grid. Combinatorica, ():4 5, 99. [5] Erik D. Demaine, Robert A. Hearn, and Michael Hoffman. Push--F is PSPACE-Complete, August. [6] Erich Friedman. Spiral Galaies Puzzles are NP-complete. Technical report, Stetson University,. [7] Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, 979. [8] John P. Hayes. Digital System Design and Microprocessors. McGraw- Hill, 984. [9] John E. Hopcroft and Jeffrey D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 979. [] Richard M. Karp. Reducibility among combinatorial problems. In Compleity of Computer Computations, pages 85 3, New ork, New ork, 97. Plenum Press. [] Richard Kaye. Minesweeper is NP-complete. The Mathematical Intelligencer, ():9 5,. [] Richard Kaye. Some Minesweeper Configurations. Technical report, The University of Birmingham, August. http://for.mat.bham.ac.uk/r.w.kaye. [3] Brandon McPhail. The compleity of puzzles: NP-completeness results for Nurikabe and Minesweeper. Reed College, 3. Undergraduate Thesis. [4] C. Moore and J.M. Robson. Hard Tiling Problems with Simple Tiles. Discrete & Computational Geometry, 6(4):573 59,. [5] Christos H. Papadimitriou. Computational Compleity. Addison-Wesley, 994. 9

[6] Michael Sipser. Introduction to the Theory of Computation. PWS Publishing Company, 997. [7] Seta Takahiro. The Compleities of Puzzles, Cross Sum, and their Another Solution Problems (ASP). The University of Tokyo,. Undergraduate Thesis. [8] Alan Turing. On computable numbers, with an application to the Entscheidungsproblem. Proceedings of the London Mathematical Society, Series, 4(3):3 65, 936. [9] Nobuhisa Ueda and Tadaaki Nagao. NP-completeness Results for NONOGRAM via Parsimonious Reductions. Technical report, Tokyo Institute of Technology, 996. [] L.G. Valiant and V.V. Vazirani. NP Is As Easy As Detecting Unique Solutions, 985. [] Thomas Ryan Wilson. NP Completeness: Why Some Problems Are Hard. Reed College, 995. Undergraduate Thesis. [] Takayuki ato. On the NP-completeness of the Slither Link Puzzle. In IPSJ SIGNotes ALgorithms, pages 5 3,. [3] Takayuki ato. Compleity and Completeness of Finding Another Solution and its Application to Puzzles. Master s thesis, The University of Tokyo, 3.