Transcription

1 Why Study NP- hardness NP Hardness/Completeness Overview Ron Parr CPS 570 NP hardness is not an AI topic It s important for all computer scienhsts Understanding it will deepen your understanding of AI (and other CS) topics You will be expected to understand its relevance and use for AI problems Eat your vegetables; they re good for you P and NP Scaling P and NP are about decision problems P is set of problems that can be solved in polynomial Hme NP is a superset of P NP is the set of problems that: Have soluhons which can be verified in polynomial Hme or, equivalently, can be solved by a non- determinishc Turing machine in polynomial Hme Roughly speaking: Problems in P are tractable can be solved in a reasonable amount of Hme, and Moore s law helps Some problems in NP might not be tractable 1

2 Isn t P big? P includes O(n), O(n 2 ), O(n 10 ), O(n 100 ), etc. Clearly O(n 10 ) isn t something to be excited about not prachcal Computer scienhsts are very clever at making things that are in P efficient First algorithms for some problems are o_en quite expensive, e.g., O(n 3 ), but research o_en brings this down NP- hardness Many problems in AI are NP- hard (or worse) What does this mean? These are some of the hardest problems in CS IdenHfying a problem as NP hard means: You probably shouldn t waste Hme trying to find a polynomial Hme soluhon If you find a polynomial Hme soluhon, either You have a bug Find a place on your shelf for your Turing award NP hardness is a major triumph (and failure) for computer science theory NP- hardness Why it is a failure: There is a huge class of problems with no known efficient soluhons We have failed, as a community, to either find efficient soluhons or prove that none exist Why it is a triumph: We have a developed a precise language for talking about these problems We have developed sophishcated ways to reason about and categorize the problems we don t know how to solve efficiently We are developing an arsenal of approximahon algorithms for hard problems Understanding the class NP A class of decision problems (Yes/No) SoluHons can be verified in polynomial Hme Examples: Graph coloring: WA Sortedness: [ ] NT SA T Q NSW V 2

3 What is NP hardness? An NP hard problem is at least has hard as the hardest problems in NP The hardest problems in NP are NP- complete (no known poly Hme soluhon) Demonstrate hardness via reduc5on Use one problem to solve another A is reduced to B, if we can use B to solve A: A instance Poly- Hme xformahon poly Hme A solver if B is poly Hme B Solver A instance ReducHons Poly- Hme xformahon poly Hme A solver if B is poly Hme B Solver If B is NP- complete and A is of unknown difficulty, what does this tell us? If A is NP- complete, and B is of unknown difficulty, what does this tell us? Hardness vs. Completeness For something to be NP- complete, must be NP- hard and in NP If something is NP- hard, it could be even harder than the hardest problems in NP Proving completeness is stronger theorehcal result says more about the problem Why care about NP- completeness? Solving any one NP- complete problem gives you the key to all others (via poly Hme xformahon) All NP- complete problems are, in a sense, equivalent Insight into solving any one gives you insight into solving a vast array of problems of extraordinary prachcal and economic significance 3

4 One from Many How would solving a single NP- complete problem in polynomial Hme give you the key to all others? All NP- complete problems can be transformed into each other via polynomial Hme transformahons Poly Hme solver for B can be converted to a poly Hme solver for A since polynomials are closed under addihon SAT: The First NP Complete Problem (Cook 1971)!! (X 1 X! 7 X 13 ) (X! 2 X 12 X 25 )... Want to find an assignment to all variables that makes this expression evaluate to true NP- complete for clauses of size 3 or greater How would you prove this? Other NP- Complete Problems Graph coloring Traveling salesman Knapsack Subset sum P- center (cover n points with p balls) Most formulahons of planning and scheduling problems Vertex Cover Max- clique Etc. Hardness w/o completeness? NP hardness is a weaker claim (says less about the problem) than NP completeness, but NP hard problems might be harder than NP- complete NP hard if an NP complete problem is reducible to it NP completeness = NP hardness + NP membership Consider the problem #SAT How many sahsfying assignments to:!! (X 1 X! 7 X 13 ) (X! 2 X 12 X 25 )... Is this in NP? (Not even a decision problem) Is it NP- hard? 4

6 How To Avoid Embarrassing Yourself NP- Completeness Summary Don t say: I proved that it requires exponenhal Hme. if you really meant: I proved it s NP- Hard/Complete The best soluhon I could come up with takes exponenhal Hme. Don t say: The problem is NP (which doesn t even make sense) if you really meant: The problem NP- Hard/Complete Don t reduce new problems to NP- hard complete problems if you meant to prove the new problem is hard Such a reduchon is backwards. What you really proved is that you can use a hard problem to solve an easy one. Always think carefully about the direchon of your reduchons NP- completeness tells us that a problem belongs to class of similar, hard problems. What if you find that a problem is NP hard? Look for good approximahons with provable guarantees Find different measures of complexity Look for tractable subclasses Use heurishcs try to do well on most cases 6

NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

Complexity Classes P and NP MATH 3220 Supplemental Presentation by John Aleshunas The cure for boredom is curiosity. There is no cure for curiosity Dorothy Parker Computational Complexity Theory In computer

Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

Tetris is Hard: An Introduction to P vs NP Based on Tetris is Hard, Even to Approximate in COCOON 2003 by Erik D. Demaine (MIT) Susan Hohenberger (JHU) David Liben-Nowell (Carleton) What s Your Problem?

Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using

Chapter 1 NP Completeness I By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 "Then you must begin a reading program immediately so that you man understand the crises of our age," Ignatius said solemnly.

276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a $ 1,000,000 prize for the

1 P versus NP, and More Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 If you have tried to solve a crossword puzzle, you know that it is much harder to solve it than to verify

Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

Computational complexity theory Goal: A general theory of the resources needed to solve computational problems What types of resources? Time What types of computational problems? decision problem Decision

The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

Million Dollar Mathematics! Alissa S. Crans Loyola Marymount University Southern California Undergraduate Math Day University of California, San Diego April 30, 2011 This image is from the Wikipedia article

Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes.

Section 2.3 Complexity 2.3.1 2.3 COMPLEXITY disambiguation: In the early 1960 s, Chaitin and Kolmogorov used complexity to mean measures of complicatedness. However, most theoretical computer scientists

The Basics of Graphical Models David M. Blei Columbia University October 3, 2015 Introduction These notes follow Chapter 2 of An Introduction to Probabilistic Graphical Models by Michael Jordan. Many figures

Lecture 19: Introduction to NP-Completeness Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Reporting to the Boss Suppose

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

Quantum and Non-deterministic computers facing NP-completeness Thibaut University of Vienna Dept. of Business Administration Austria Vienna January 29th, 2013 Some pictures come from Wikipedia Introduction

CoNP and Function Problems conp By definition, conp is the class of problems whose complement is in NP. NP is the class of problems that have succinct certificates. conp is therefore the class of problems

Lecture 7: Approximation via Randomized Rounding Often LPs return a fractional solution where the solution x, which is supposed to be in {0, } n, is in [0, ] n instead. There is a generic way of obtaining

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 261 Factoring One last point: we started off this book by introducing another famously hard search problem: FACTORING, the task of finding all prime factors

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

Max Flow, Min Cut, and Matchings (Solution) 1. The figure below shows a flow network on which an s-t flow is shown. The capacity of each edge appears as a label next to the edge, and the numbers in boxes

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the

6.7 Factoring Trinomials: The ac Method 6.7 OBJECTIVES 1. Use the ac test to determine whether a trinomial is factorable over the integers 2. Use the results of the ac test to factor a trinomial 3. For

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP. Explication: In his paper, The Singularity: A philosophical analysis, David Chalmers defines an extendible

CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

Notes on NP Completeness Rich Schwartz November 10, 2013 1 Overview Here are some notes which I wrote to try to understand what NP completeness means. Most of these notes are taken from Appendix B in Douglas

Ian Stewart on Minesweeper It's not often you can win a million dollars by analysing a computer game, but by a curious conjunction of fate, there's a chance that you might. However, you'll only pick up

Factoring Polynomials Hoste, Miller, Murieka September 12, 2011 1 Factoring In the previous section, we discussed how to determine the product of two or more terms. Consider, for instance, the equations

1. LINEAR EQUATIONS A linear equation in n unknowns x 1, x 2,, x n is an equation of the form a 1 x 1 + a 2 x 2 + + a n x n = b, where a 1, a 2,..., a n, b are given real numbers. For example, with x and

CS 05: Algorithms (Grad) Feb 2-24, 2005 Approximating Set Cover. Definition An Instance (X, F ) of the set-covering problem consists of a finite set X and a family F of subset of X, such that every elemennt

n colleges in a set C, m applicants in a set A, where m is much larger than n. each college c i C has a capacity q i - the maximum number of students it will admit each college c i has a strict order i

1. (Chapter 1 supplementary, problem 7): There are 12 men at a dance. (a) In how many ways can eight of them be selected to form a cleanup crew? (b) How many ways are there to pair off eight women at the

The Basics of Building Credit This program was developed to help middle school students learn the basics of building credit. At the end of this lesson, you should know about all of the Key Topics below:»

An introduction to number theory and Diophantine equations Lillian Pierce April 20, 2010 Lattice points and circles What is the area of a circle of radius r? You may have just thought without hesitation

CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson

GRAPH THEORY and APPLICATIONS Trees Properties Tree: a connected graph with no cycle (acyclic) Forest: a graph with no cycle Paths are trees. Star: A tree consisting of one vertex adjacent to all the others.