1 Combinatorial Search Spring 2008 (Fourth Quarter)

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

NP-Hard Nattee Niparnan.
Time Complexity P vs NP.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Computability & Complexity. Scenario I can’t write this program because I’m too dumb.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Computational problems, algorithms, runtime, hardness
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
1 dKS, Spring Some practical information Lecturers: Kristoffer Arnsfelt Hansen and Peter Bro Miltersen. Homepage:
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time in a reasonable sequential model of computation if and only if it.
1 Optimization Spring 2007 (Third Quarter). 2 Some practical remarks Homepage: Exam: Written, 3 hours. There.
The max flow problem
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
Turing Machines CS 105: Introduction to Computer Science.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
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.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSC 413/513: Intro to Algorithms NP Completeness.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Instructor: Shengyu Zhang 1. Tractable While we have introduced many problems with polynomial-time algorithms… …not all problems enjoy fast computation.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
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.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
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.
Lecture 12 P and NP Introduction to intractability Class P and NP Class NPC (NP-complete)
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1 How to establish NP-hardness Lemma: If L 1 is NP-hard and L 1 ≤ L 2 then L 2 is NP-hard.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
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.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
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.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CS623: Introduction to Computing with Neural Nets (lecture-7) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
1 Introduction to Turing Machines
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.
1 SAT SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Computable Functions.
Theory of Computability
Theory of Computability
Presentation transcript:

1 Combinatorial Search Spring 2008 (Fourth Quarter)

2 Some practical remarks Homepage: Exam: Oral, 7-scale 30 minutes, including overhead, no preparation. There will be three compulsory assignments. If you want to transfer credit from last year, let me know as soon as possible and before May 1. The solution to the compulsory assignments should be handed in at specific exercise sessions and given to the instructor in person. Text: “Kompendium” available at GAD + online notes.

3 Exercise classes You can switch classes iff you find someone to switch with. To find someone, post an add in the group dSoegOpt … Or try finding someone after the class! Exercise classes are on specific dates, see webpage

4 Frequently asked questions about compulsory assignments Q: Do I really have to hand in all three assignments? A: YES! Q: Do I really have to hand in all three assignments on time? A: YES! Q: What if I can’t figure out how to solve them? A: Ask your instructor. Start solving them early, so that you will have sufficient time. Q: What if I get sick or my girlfriend breaks up or my hamster dies? A: Start solving them early, so that you will have sufficient time in case of emergencies. Q: Do I really have to hand in all three assignments? A: YES!

5 Maximum matching Max Flow Shortest paths Min Cost Flow Linear Programming Mixed Integer Linear Programming Efficient by Local Search Exponential By Branching = reduction TSP “Optimization” – a summary! … … ?

6 Lots and lots of man hours….

7 Maximum matching Max Flow Shortest paths Min Cost Flow Linear Programming Mixed Integer Linear Programming Efficient by Local Search Exponential By Branching = reduction TSP … … ? NP-completeness

8 Maximum matching Max Flow Shortest paths Min Cost Flow Linear Programming Mixed Integer Linear Programming Efficient by Local Search Exponential = reduction TSP… No reduction, unless P=NP NP-completeness

9 Very useful for saving (human) time

10 Rigorous Formalization “Problems” Languages “Efficient Algorithms” Turing Machines, P “Search Problems” NP “Reductions” Polynomial Reductions “Universal Search Problems” NPC

11 Problems: Languages A language L is a subset of {0,1}*. A language models a decision problem: Members of L are the yes-instances, non- members are the no-instances. This is the only kind of problem our theory shall be concerned with!

12 Restriction: Inputs Boolean Strings Strings over an arbitrary alphabet can be represented as Boolean Strings (Ex: ascii, unicode). In reality, computers may only hold Boolean strings (their memory image is a bit string). Arbitrary real numbers may not be represented but this is intentional!

13 Models of Computation Model 1: Our computer holds exact real numbers. The size of the input is the number of real numbers in the input. The time complexity of an algorithm is the number of arithmetic operations performed. Model 2: Our computer holds bits and bytes. The size of the input is the number of bits in the input. The time complexity of an algorithm is the number of bit-operations performed. We know an efficient algorithm for linear programming in Model 2 but not model 1. The NP-completeness theory is intended to capture Model 2 and not Model 1.

14 java MaxFlow 6#0|16|13|0|0|0#0|0|10|12|0|0 #0|4|0|0|14|0#0|0|9|0|0|20 #0|0|0|7|0|4|#0|0|0|0|0|0 How to encode max flow instance?

15 Restriction: All inputs “legal”. Any string should be either a yes-string or a no-string. It would be nice to also have “malformed” strings. However, we shall just lump the malformed strings with the no-strings.

16 Restriction: Output yes or no Suppose we want to consider computing a function, f: {0,1}* ! {0,1}*. Stand-in for f: L f = { | f(x) j = y} L f has an efficient algorithm if and only if f has an efficient algorithm.

17 Restriction: functions OPT: Given description of F, f find x 2 F maximizing f(x). There may be several optimal solutions. OPT does not seem to be captured easily by a function. Stand-in for OPT: L OPT = { | some x 2 F has f(x) ¸  /  }

18

19 L OPT vs. OPT L OPT may be easy to solve even though OPT is hard to solve, so L OPT is not a perfect stand-in. However, if L OPT has no efficient solution, then OPT has no efficient solution, so L OPT can still be used to argue that OPT is hard.

20 Algorithms: Turing Machines

21 Turing Machines A Turing machine consists of an infinite tape, divided into cells, each holding a symbol from alphabet  that includes 0,1,#. A tape head is at any point in time positioned at a cell. A finite control reads the symbol at the head, updates the symbol at the head and the position of the head.

22 Finite Control Finite set of states Q. The control is in exactly one of the state. Three special states: start, accept, reject. Transition function:

23 Running the machine on an input The input string is placed on the tape (surrounded by blanks) and the head positioned to the immediate left of the input. The initial state of the finite control is start. If the finite control eventually goes to accept state, the input is accepted (“the machine outputs yes”). If the finite control eventually goes to reject state, the input is rejected (“the machine outputs no”). The machine is said to decide a language L if it accepts all members of L and rejects all members of {0,1}*-L.

Some Turing Machine Applets

25 If you want to make rigorous the notion of an “efficient algorithm” why do you choose such a hopelessly inefficient device ??!?

26 Church-Turing Thesis Any decision problem that can be solved by some mechanical procedure, can be solved by a Turing machine.

27 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only if it can be solved in polynomial time by a Turing machine.

28 The complexity class P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at most p(|x|) steps on input x. By the Polynomial Church-Turing Thesis, P is “robust” with respect to changes of the machine model. Is P also robust with respect to changes of the representation of decision problems as languages?

29 java MaxFlow 6#0|16|13|0|0|0#0|0|10|12|0|0 #0|4|0|0|14|0#0|0|9|0|0|20 #0|0|0|7|0|4|#0|0|0|0|0|0 How to encode max flow instance?

30 java MaxFlow #| | ||| #|| | || #|1111||| | #|| ||| #||| ||1111 #|||||

31 Polynomial time computable maps f: {0,1}* ! {0,1}* is called polynomial time computable if for some polynomial p, - For all x, |f(x)| · p(|x|). - L f 2 P.

32 Polynomially equivalent representations A representation of objects (say graphs, numbers) as strings is good if the language of valid representations is in P. Two different representations of objects are called polynomially equivalent if we may translate between them using polynomial time computable maps. Ex: Adjacency matrices vs. Edge lists Ex: Binary vs. Decimal Counterexample: Binary vs. Unary

33 Robustness of Representation Given two good, polynomially equivalent representations of the instances of a decision problem, resulting in languages L 1 and L 2 we have L 1 2 P iff L 2 2 P.

34 Rigorous Formalization “Problems” Languages “Efficient Algorithms” Turing Machines, P “Search Problems” NP “Reductions” Polynomial Reductions “Universal Search Problems” NPC

35 Search Problems: NP We want to capture decision problems that can be solved by exhaustive search of the following kind. Go through a space of possible solutions, checking for each one of them if it is an actual solutions (in which case the answer is yes). Example: Compositeness. Given a number in binary, is it a product of smaller numbers?

36 Search Problems: NP L is in NP iff there is a language L’ in P and a polynomial p so that:

37 Intuition The y-strings are the possible solutions to the instance x. We require that solutions are not too long and that it can be checked efficiently if a given y is indeed a solution (we have a “simple” search problem)

38

39

40 P vs. NP P is a subset of NP Is P=NP? Then any “simple” search problem has a polynomial time algorithm. This is the most famous open problem of mathematical computer science!

41 Solved (Perelman)!

42 P vs. NP and mathematics If P=NP, mathematicians may be replaced by (much more reliable) computers: P=NP ) There is an algorithmic procedure that takes as input any formal math statement and always outputs its shortest formal proof in time polynomial in the length of the proof. This is usually regarded (in particular by mathematicians!) as evidence that P and NP are different.

43 Rigorous Formalization “Problems” Languages “Efficient Algorithms” Turing Machines, P “Search Problems” NP “Reductions” Polynomial Reductions “Universal Search Problems” NPC

44 Reductions A reduction r of L 1 to L 2 is a polynomial time computable map so that 8 x: x 2 L 1 iff r(x) 2 L 2 We write L 1 · L 2 if L 1 reduces to L 2. Intuition: Efficient software for L 2 can also be used to efficiently solve L 1.

45 Properties of reductions Transitivity: L 1 · L 2 Æ L 2 · L 3 ) L 1 · L 3 Downward closure of P: L 1 · L 2 Æ L 2 2 P ) L 1 2 P. Follows from Polynomial Church-Turing thesis.

46 NP-hardness A language L is called NP-hard iff 8 L’ 2 NP: L’ · L Intuition: Software for L is strong enough to be used to solve any simple search problem. Proposition: If some NP-hard language is in P, then P=NP.

47 NPC A language L 2 NP that is NP-hard is called NP-complete. NPC := the class of NP-complete problems. Proposition: L 2 NPC ) [L 2 P iff P=NP].