Pancakes, Puzzles, and Polynomials: Cracking the Cracker Barrel Game Christopher Frost Michael Peck.

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
Advertisements

David Evans CS200: Computer Science University of Virginia Computer Science Class 38: Intractable Problems (Smiley Puzzles.
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?
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
The Brick Wall: NP-Completeness Christopher King Joshua Greenspan.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
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
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 15: Complexity Notes This is selected.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
Class 24: P=NP? David Evans cs302: Theory of Computation University of Virginia Computer Science PS6 (the last one) is.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
David Evans Class 16: NP-Completeness / The Story so Far CS150: Computer Science University of Virginia Computer Science.
“One ring to rule them all” Analogy (sort of) Lord of The Rings Computational Complexity “One problem to solve them all” “my preciousss…”
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
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 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
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 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
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.
The Theory of NP-Completeness
P & NP.
NP-Completeness Yin Tat Lee
Class 14: Intractable Problems CS150: Computer Science
Lecture 22: P = NP? CS200: Computer Science University of Virginia
NP-Complete Problems.
NP-Completeness Yin Tat Lee
NP-Completeness Lecture for CS 302.
Presentation transcript:

Pancakes, Puzzles, and Polynomials: Cracking the Cracker Barrel Game Christopher Frost Michael Peck

2 The Cracker Barrel Game

3 The Cracker Barrel Problem (CB) Given an arbitrarily sized board with some initial configuration of pegs, is there a sequence of jumps such that the board will be left with one remaining peg?

4 How Hard Is It To Solve The Cracker Barrel Game? Straightforward way of solving the peg board puzzle: Try all possible ways to move a peg Look at all possible ways of moving a peg for each of the above moves... Until find a sequence of moves with one peg left or run out of possible moves (no solution) How long will this take to solve? Is this the fastest way?

5 Complexity Measuring complexity: How does the time needed to solve a problem grow as the size of the input to the problem grows? Example: linear-time If the size of the input doubles, the time needed to solve doubles.

6 Complexity: A Look at How Growth Rates Compare

7 P – Polynomial NP – Nondeterministic Polynomial NP-Complete Complexity Classes: The Big Three P NP P=NP or Does P=NP? Are all the problems in NP also in P? The biggest unanswered question in computer science. NP-C Problems that can be solved in n k time Problems that can be verified in n k time Problems that are at least as hard as all other problems in NP

8 Example NP-Complete Problems Protein Folding Traveling Salesperson Map coloring Cracker Barrel?

9 Project Goal Is CB (the Cracker Barrel problem) NP-Complete?

10 Must show two conditions: Problem belongs to NP Is at least as hard as any problem in NP Proving NP-Completeness

11 Example NP-Complete Problem: 3-SAT (x1  x2  x4)  (  x1  x2  x3) Is there an assignment of values to these terms that makes the above expression true? Yes! One solution: If x1 = true and x3 = true, the above expression is true. Expression ClausesTerms

12 Proving NP-Completeness: Solving any problem in NP using CB Reduction: Showing that a known NP- complete problem can be solved using a solver for CB. CB Solver 3-SAT Solver 3-SAT to CB Transformer Answer Input to 3-SAT Solver

13 3-SAT to CB Transformer Represent a logical expression on a peg board. (x1  x2  x4)  (  x1  x2  x3) C 1 C 2 x 1 x 1 x 2 x 4  x 1 x 2 x 3  x 1 x 2 x 3 x 4  x 2  x 3  x 4

14 3-SAT to CB Transformer: Inside The Mysterious Blue Tile x 1 x 1 Blue Tile Goal: Allow green peg across iff yellow has come down. > The Non-transitive Peg Hierarchy of Power a > b: a can jump b, but b can’t jump a = > >

15 3-SAT to CB Transformer

16 > The Non-transitive Peg Hierarchy of Power a > b: a can jump b, but b can’t jump a = > > 3-SAT to CB Transformer: Inside The Grey Tile x 1 x 1 Grey Tile Goal: Allow both the green and yellow peg across at any time.

17 3-SAT to CB Transformer

18 > The Non-transitive Peg Hierarchy of Power a > b: a can jump b, but b can’t jump a = > > 3-SAT to CB Transformer: Which Term? x 1 Term-Area Goal: Allow peg for a pair of terms to represent either the variable or its negation as true. x 1 

19 3-SAT to CB Transformer

20 > The Non-transitive Peg Hierarchy of Power a > b: a can jump b, but b can’t jump a = > > 3-SAT to CB Transformer: Inside The Green Tile Green Tile Goal: Reduce the number of green pegs to one iff every clause had one or more pegs cross the board. C 1 x 1 x 2 x 4

21 Progress and Implications Progress: Our best known CB solver takes exponential time Proved a variation of CB is NP-Complete Implications: Is it possible to create a CB solver that runs in polynomial time? (Given that CB is NP-complete) If so, P=NP If not, P≠NP

22 Questions?