15-251 Great Theoretical Ideas in Computer Science for Some.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

Polynomial-time reductions We have seen several reductions:
Great Theoretical Ideas in Computer Science.
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Lecture 21 NP-complete problems
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSE373: Data Structures & Algorithms Lecture 24: The P vs. NP question, NP-Completeness Nicki Dell Spring 2014 CSE 373 Algorithms and Data Structures 1.
Discrete Structures & Algorithms The P vs. NP Question EECE 320.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Computational problems, algorithms, runtime, hardness
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
NP and NP-completeness
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Complexity Theory: The P vs NP question Lecture 28 (Dec 4, 2007)
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Great Theoretical Ideas in Computer Science.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
P vs NP: what is efficient computation? Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 29Dec 8, 2005Carnegie Mellon.
Polynomial-time reductions We have seen several reductions:
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
MA/CSSE 473 Day 38 Problems Decision Problems P and NP.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Instructor: Shengyu Zhang 1. Tractable While we have introduced many problems with polynomial-time algorithms… …not all problems enjoy fast computation.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
COMPSCI 102 Introduction to Discrete Mathematics.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
COMPSCI 102 Introduction to Discrete Mathematics.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
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.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NPC.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
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.
Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 28Dec 7th, 2006Carnegie Mellon University Complexity Theory: the P.
Great Theoretical Ideas in Computer Science.
The NP class. NP-completeness
NP and NP-completeness
Great Theoretical Ideas in Computer Science
NP-Completeness Yin Tat Lee
NP-Completeness Yin Tat Lee
Great Theoretical Ideas In Computer Science
Presentation transcript:

Great Theoretical Ideas in Computer Science for Some

Complexity Theory: The P vs NP question Lecture 27 (Nov 23, 2010)

$$$

The $1M Questions The Clay Mathematics Institute Millenium Prize Problems 1.Birch and Swinnerton-Dyer Conjecture 2.Hodge Conjecture 3.Navier-Stokes Equations 4.P vs NP 5.Poincaré Conjecture 6.Riemann Hypothesis 7.Yang-Mills Theory  solved!

The P versus NP problem Is perhaps the biggest open problem in computer science (and mathematics!) today. (Even featured in the TV show NUMB3RS) But what is the P-NP problem?

Sudoku 3 x 3 x 3

Sudoku 3 x 3 x 3

Sudoku 4 x 4 x 4

Sudoku 4 x 4 x 4

Sudoku n x n x n... Suppose it takes you S(n) to solve n x n x n V(n) time to verify the solution Fact: V(n) = O(n 2 x n 2 ) Question: is there some constant c such that S(n)  n c ?

n x n x n... P vs NP problem = Does there exist an algorithm for n x n x n Sudoku that runs in time p(n) for some polynomial p( ) ?

The P versus NP problem (informally) Is proving a theorem much more difficult than checking the proof of a theorem?

Let’s start at the beginning…

Hamilton Cycle Given a graph G = (V,E), a cycle that visits all the nodes exactly once

The Problem “HAM” The Set “HAM” Input: Graph G = (V,E) Output:YES if G has a Hamilton cycle NO if G has no Hamilton cycle HAM = { graph G | G has a Hamilton cycle }

AND NOT Circuit-Satisfiability Input: A circuit C with one output Output:YES if C is satisfiable NO if C is not satisfiable

The Set “SAT” SAT = { all satisfiable circuits C }

Bipartite Matching Input: A bipartite graph G = (U,V,E) Output:YES if G has a perfect matching NO if G does not

The Set “BI-MATCH” BI-MATCH = { all bipartite graphs that have a perfect matching }

Sudoku Input: n x n x n sudoku instance Output:YES if this sudoku has a solution NO if it does not The Set “SUDOKU” SUDOKU = { All solvable sudoku instances }

Decision Versus Search Problems Decision Problem YES/NO answers Does G have a Hamilton cycle? Search Problem Find a Hamilton cycle in G if one exists, else return NO Can G be 3-colored ? Find a 3-coloring of G if one exists, else return NO

Reducing Search to Decision Given an algorithm for decision Sudoku, devise an algorithm to find a solution Idea: Fill in one-by-one and use decision algorithm

Reducing Search to Decision Given an algorithm for decision HAM, devise an algorithm to find a solution Idea: Find the edges of the cycle one by one

Decision/Search Problems We’ll study decision problems because they are almost the same (asymptotically) as their search counterparts

Polynomial Time and The Class “P” of Decision Problems

What is an efficient algorithm? polynomial time O(n c ) for some constant c non-polynomial time Is an O(n) algorithm efficient? How about O(n log n)? O(n 2 ) ? O(n 10 ) ? O(n log n ) ? O(2 n ) ? O(n!) ?

We consider non-polynomial time algorithms to be inefficient. And hence a necessary condition for an algorithm to be efficient is that it should run in poly-time. Does an algorithm running in O(n 100 ) time count as efficient?

Asking for a poly-time algorithm for a problem sets a (very) low bar when asking for efficient algorithms. The question is: can we achieve even this for 3-coloring? SAT? Sudoku? HAM?

The Class P We say a set L  Σ * is in P if there is a program A and a polynomial p( ) such that for any x in Σ *, A(x) runs for at most p(|x|) time and answers question “is x in L?” correctly.

The class of all sets L that can be recognized in polynomial time. The class of all decision problems that can be decided in polynomial time. The Class P

Why are we looking only at sets  Σ *? What if we want to work with graphs or boolean formulas?

Languages/Functions in P? Example 1: CONN = {graph G: G is a connected graph} Algorithm A 1 : If G has n nodes, then run depth first search from any node, and count number of distinct nodes you see. If you see n nodes, G  CONN, else not. Time: p 1 (|x|) = Θ (|x|).

Languages/Functions in P? HAM, SUDOKU, SAT are not known to be in P CO-HAM = { G | G does NOT have a Hamilton cycle} CO-HAM  P if and only if HAM  P

Onto the new class, NP

Verifying Membership Is there a short “proof” I can give you for: G  HAM? G  BI-MATCH? C  SAT? G  CO-HAM?

NP A set L  NP if there exists an algorithm A and a polynomial p( ) For all x  L there exists y with |y|  p(|x|) such that A(x,y) = YES in p(|x|) time For all x  L For all y with |y|  p(|x|) in p(|x|) time we have A(x,y) = NO

can think of A as “proving” that x is in L Recall the Class P We say a set L  Σ * is in P if there is a program A and a polynomial p() such that for any x in Σ *, A(x) runs for at most p(|x|) time and answers question “is x in L?” correctly.

NP A set L  NP if there exists an algorithm A and a polynomial p( ) For all x  L there exists a y with |y|  p(|x|) such that A(x,y) = YES in p(|x|) time For all x  L For all y with |y|  p(|x|) in p(|x|) time Such that A(x,y) = NO

Example: HAM  NP Let A(x,y) be a program that takes two strings x and y, and returns YES if the following conditions hold otherwise it returns NO. y is a representation of a labeled graph x is a representation of a cycle with the same labeled vertices as y every edge of the cycle x is in the graph y (All of these conditions can be easily checked in linear time) By our definition, this proves HAM  NP

The Class NP The class of sets L for which there exist “short” proofs of membership (of polynomial length) that can be “quickly” verified (in polynomial time). Recall: A doesn’t have to find these proofs y; it just needs to be able to verify that y is a “correct” proof.

P  NP For any L in P, we can just take y to be the empty string and satisfy the requirements. Hence, every language in P is also in NP.

Languages/Functions in NP? G  HAM? G  BI-MATCH? G  SAT? G  CO-HAM? (Yes, already saw) (is in P) (Yes. explain it) (not clear) Proof that something is in NP is often trivial.

Summary: P versus NP Set L is in P if membership in L can be decided in poly-time. Set L is in NP if each x in L has a short “proof of membership” that can be verified in poly- time. Fact: P  NP Question: Is NP  P ?

Why Care?

Classroom Scheduling Packing objects into bins Scheduling jobs on machines Finding cheap tours visiting a subset of cities Allocating variables to registers Finding good packet routings in networks Decryption … NP Contains Lots of Problems We Don’t Know to be in P

OK, OK, I care... But where do I begin if I want to reason about the P=NP problem?

How can we prove that NP  P? I would have to show that every set in NP has a polynomial time algorithm… How do I do that? It may take a long time! Also, what if I forgot one of the sets in NP?

We can describe just one problem L in NP, such that if this problem L is in P, then NP  P. It is a problem that can capture all other problems in NP.

The “Hardest” Set in NP

Sudoku n x n x n... Sudoku has a polynomial time algorithm if and only if P = NP

The “Hardest” Sets in NP Sudoku SAT 3-Colorability Clique HAM Independent-Set These problems are all “polynomial-time equivalent”. I.e., each of these can be reduced to any of the others in poly-time

“Poly-time reducible to each other” Reducing problem Y to problem X in poly-time Oracle for problem X Oracle for problem Y Instance I Y of problem Y Instance I X = F(I Y ) of problem X F is poly-time computable Answer

How do you prove these are the hardest?

Theorem [Cook/Levin]: SAT is one language in NP, such that if we can show SAT is in P, then we have shown NP  P. SAT is a language in NP that can capture all other languages in NP. We say SAT is NP-complete.

AND NOT 3-colorabilityCircuit Satisfiability Last lecture…

SAT and 3COLOR: Two problems that seem quite different, but are substantially the same. Also substantially the same as CLIQUE and INDEPENDENT SET. If you get a polynomial-time algorithm for one, you get a polynomial-time algorithm for ALL. Last lecture…

Proving a problem Q is NP-Complete 1.Prove that Q is in NP. 2.Give a reduction that allows an instance of a known NP-complete problem to be reduced to an instance of Q. Examples of such reductions were given in the last lecture – e.g. reducing SAT to 3-coloring.

Any language in NP SAT can be reduced (in polytime to) an instance of hence SAT is NP-complete 3COLOR can be reduced (in polytime to) an instance of hence 3COLOR is NP-complete

Here’s What You Need to Know… Definition of P and NP Definition of problems SAT, 3-COLOR, HAM, SUDOKU, BI-MATCH SAT, 3-COLOR, HAM, SUDOKU all essentially equivalent. Solve any one in poly-time  solve all of them in poly-time