ECE 695 Numerical Simulations Lecture 2: Computability and NPhardness. Prof. Peter Bermel January 11, 2017

Similar documents
The Cook-Levin Theorem

CISC 4090 Theory of Computation

Lecture 3: Nondeterminism, NP, and NP-completeness

CS151 Complexity Theory. Lecture 1 April 3, 2017

NP-Complete Reductions 1

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Chapter 7: Time Complexity

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

NP Complete Problems. COMP 215 Lecture 20

Lecture 19: Finish NP-Completeness, conp and Friends

Theory of Computation Time Complexity

Lecture 16: Time Complexity and P vs NP

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

CSCI3390-Lecture 16: NP-completeness

NP, polynomial-time mapping reductions, and NP-completeness

6-1 Computational Complexity

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

CS21 Decidability and Tractability

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Limits of Feasibility. Example. Complexity Relationships among Models. 1. Complexity Relationships among Models

Computational Models Lecture 11, Spring 2009

Theory of Computation

CS154, Lecture 13: P vs NP

The Polynomial Hierarchy

Essential facts about NP-completeness:

CSE 105 THEORY OF COMPUTATION

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

Introduction to Complexity Theory

The P versus NP Problem. Dean Casalena University of Cape Town CSLDEA001

CSE 105 THEORY OF COMPUTATION

Lecture 1: Introduction

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Complexity Theory Final Exam

On the Computational Hardness of Graph Coloring

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1

Finish K-Complexity, Start Time Complexity

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

CS154, Lecture 13: P vs NP

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

Non-Deterministic Time

Chapter 2 : Time complexity

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

Lecture 3: Reductions and Completeness

Polynomial-time Reductions

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

CSE 105 THEORY OF COMPUTATION

CSC 1700 Analysis of Algorithms: P and NP Problems

Computational complexity

Time Complexity. CS60001: Foundations of Computing Science

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

NP-Completeness. Algorithmique Fall semester 2011/12

P, NP, NP-Complete, and NPhard

Welcome to... Problem Analysis and Complexity Theory , 3 VU

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

CSE 135: Introduction to Theory of Computation NP-completeness

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

Introduction to Computational Complexity

CS151 Complexity Theory

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

NP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard

Limitations of Algorithm Power

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Lecture 18: PCP Theorem and Hardness of Approximation I

2 P vs. NP and Diagonalization

About the relationship between formal logic and complexity classes

Algorithms: COMP3121/3821/9101/9801

The Complexity of Optimization Problems

conp, Oracles, Space Complexity

NP and Computational Intractability

NP-Complete Reductions 2

Definition: conp = { L L NP } What does a conp computation look like?

Geometric Steiner Trees

CSE 105 Theory of Computation

Multiple Sequence Alignment: Complexity, Gunnar Klau, January 12, 2006, 12:

Design and Analysis of Algorithms

13.1 Nondeterministic Polynomial Time

Acknowledgments 2. Part 0: Overview 17

NP Completeness. Richard Karp, 1972.

Polynomial-time reductions. We have seen several reductions:

SAT, Coloring, Hamiltonian Cycle, TSP

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

Complexity Classes V. More PCPs. Eric Rachlin

Notes for Lecture Notes 2

Advanced Topics in Theoretical Computer Science

NP-Complete Problems. More reductions

Decidability: Church-Turing Thesis

1.1 P, NP, and NP-complete

NP-completeness was introduced by Stephen Cook in 1971 in a foundational paper.

Complexity Theory Part I

Harvard CS 121 and CSCI E-121 Lecture 20: Polynomial Time

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Lecture 4: NP and computational intractability

Chapter 3. Complexity of algorithms

Transcription:

ECE 695 Numerical Simulations Lecture 2: Computability and NPhardness Prof. Peter Bermel January 11, 2017

Outline Overview Definitions Computing Machines Church-Turing Thesis Polynomial Time (Class P) Class NP Non-deterministic Turing machines Reducibility Cook-Levin theorem Coping with NP Hardness 1/11/2017 ECE 695, Prof. Bermel 2

Overview from First Lecture Study of the complexity of algorithms Based on Turing machines Often, one compares algorithms for best scaling in large problems Alan Turing (from University of Calgary Centenary event) 1/11/2017 ECE 695, Prof. Bermel 3

Definitions Algorithm set of rules for computing a function mapping input data to output Specific realizations of computers: Turing machines Lambda calculus m-recursive functions Register machines Running time number of basic operations required Efficient computability 1/11/2017 ECE 695, Prof. Bermel 4

Turing Machine Performs the following elementary operations: Read a bit of input and byte of data from work Write a bit to work Choose next state Q. Either: Stop and output a 0 or 1 Choose a new rule to apply next 1/11/2017 ECE 695, Prof. Bermel 5

Turing Machine: Behavior in Each State q start : write start symbol, change state to q copy q copy : copy non-blank symbol, otherwise go to q right q right : go back to start, then q test q test : if at start and work is blank, write 1; else, write 0 q halt : finished 1/11/2017 ECE 695, Prof. Bermel 6

Time Constructible Functions A function T: N N is time constructible iff T(n) n TM M computes x T(x) in time T(n) Examples: n, n log n, 2 n 1/11/2017 ECE 695, Prof. Bermel 7

Turing Machine: Key Properties If f is computable in T(n). with alphabet G, it is computable in 4 log G T(n) with TM with k tapes, it s computable in 5kT(n) 2 with TM with bidirectional tape, computable in 4T(n) with TM 1/11/2017 ECE 695, Prof. Bermel 8

Universal Turing Machines A universal Turing machine can simulate every other TM Efficient process: takes CN log N time to simulate a process taking N steps 1/11/2017 ECE 695, Prof. Bermel 9

Other Computing Machines Register machines Post-Turing machine: adds jump and erase functions Many other variations, getting closer to assembly language Lambda calculus basis for Scheme and LISP m-recursive functions partial functions mapping N N Which one should we use, in which situations? 1/11/2017 ECE 695, Prof. Bermel 10

Church-Turing (CT) Thesis Every physically realizable computing machine can be simulated by a Turing machine, or any other type of machine. This thesis has not been rigorously proven Not applicable for non-deterministic systems Quantum computers have caused some to reevaluate CT thesis 1/11/2017 ECE 695, Prof. Bermel 11

Uncomputability It may seem obvious everything is computable with enough time, but There s always an uncomputable function UC Another example: the halting problem Computes whether another function will finish Cannot be computed in general 1/11/2017 ECE 695, Prof. Bermel 12

Big-Oh Notation Take two functions f, g mapping N N, there exists a constant c s.t. f(n) c g(n) Sometimes write f(n) = O(g(n)) Examples If f(n) = 100n 2 + 24n + 2 log n and g(n) = n 2, then f = O(g) If f(n) = e n and g(n) = n c for every c in N, then g = O(f) 1/11/2017 ECE 695, Prof. Bermel 13

Polynomial Complexity Meant to capture decision problems that are feasible Might think of efficient computations as being O(N) or O(N 2 ) Often symbolized by P Formally, P = c 1 DTIME n c, where DTIME(T) is computable in ct(n) time Strong form of CT thesis says all simulations can be done with P overhead 1/11/2017 ECE 695, Prof. Bermel 14

Other Classes Turing machines with randomness class BPP Quantum computers class BQP 1/11/2017 ECE 695, Prof. Bermel 15

Examples CONNECTED the set of all connected graphs TRIANGLEFREE the set of all graphs without a triangle BIPARTITE the set of all bipartite (distinct) graphs TREE the set of all trees 1/11/2017 ECE 695, Prof. Bermel 16

Summary Church-Turing thesis used to demonstrate demonstrate several models of computation: Turing machines Register machines Lambda calculus Big-oh notation example: DTIME(n 2 ) = O(n 2 ) Polynomial complexity: P = c 1 DTIME n c, 1/11/2017 ECE 695, Prof. Bermel 17

Class NP Definition Decision problems that can be efficiently verified The language L subset {0,1}* is in NP if there exists a polynomial p: N N and a polynomial time TM M s.t. for every x: x L u 0,1 p( x ) If x L and u 0,1 p( x ) satisfies M x, u = 1, then u is a certificate for x 1/11/2017 ECE 695, Prof. Bermel 18

Examples of NP Independent set find a k-size subset of a given graph G s vertices Traveling salesman given a set of n nodes and pairwise distances, find a closed circuit that visits every node once of length no more than k Linear/integer programming given a set of m linear inequalities for n variables, find a set of rational/integer solutions Graph isomorphism given two n n adjacency matrices M 1 and M 2, decide if they define the same graph Composite numbers decide if number N is prime Factoring for a number N, find a factor M in the interval [L,U] 1/11/2017 ECE 695, Prof. Bermel 19

Relationship of P & NP P is a subset of NP Formally, P NP c 1 DTIME 2 nc Recall DTIME(T) is computable in ct(n) time 1/11/2017 ECE 695, Prof. Bermel 20

Relationship of P & NP Key open question: does P=NP? Some NP problems are in P: Connectivity breadth-first search Composite numbers Agrawal, Kayal, and Saxena solved this a few years ago Linear programming ellipsoidal algorithm of Khachiyan 1/11/2017 ECE 695, Prof. Bermel 21

Relationship of P & NP Problems not shown to be in P: Independent set Traveling salesman Subset sum Integer programming This general group is known as NP complete: i.e., not in P unless P=NP 1/11/2017 ECE 695, Prof. Bermel 22

Non-deterministic Turing machines Has two transition functions d 0 and d 1 The NDTM has another internal state, q accept M outputs 1 if some (non-deterministic) sequence of choices q accept Can also define NTIME s.t. NDTM takes ct(n) time x L M x = 1 Alternative definition:np = c N NTIME n c 1/11/2017 ECE 695, Prof. Bermel 23

Reducibility Karp reductions relate the various example problems to one another Language A reduces to B if there is a polynomial-time computable function f, s.t. x 0,1, x A iff f x B B is NP-hard if A p B, A NP 1/11/2017 ECE 695, Prof. Bermel 24

NP completeness By transitivity of Karp reduction, there should be a language that s hardest, known as NPcomplete The TMSAT language is NP-complete TMSAT = α, x, 1 n, 1 t : u 0,1 n M α denotes TM represented by α M α outputs 1 on x, u 1/11/2017 ECE 695, Prof. Bermel 25

Cook-Levin theorem CNF: conjunctive normal form used for a Boolean formula consisting of AND s and OR s k kcnf: CNF consisting of k AND s: i=1 Cook-Levin Theorem: Let SAT be the language of all satisfiable CNF formulae: SAT is NP-complete j v ij Let 3SAT be the language of all satisfiable 3CNF formulae: 3SAT is NP-complete 1/11/2017 ECE 695, Prof. Bermel 26

Web of reductions 1/11/2017 ECE 695, Prof. Bermel 27

Coping with NP-hardness Approximate/heuristic solutions Example: traveling salesman Key considerations: Maximum error Average-case complexity 1/11/2017 ECE 695, Prof. Bermel 28

Related Complexity Classes conp x L u 0,1 p( x ) s.t. M(x,u)=1 EXP = c 0 DTIME 2 nc NEXP= c 0 NTIME 2 nc Must have P NP EXP NEXP 1/11/2017 ECE 695, Prof. Bermel 29

What if P=NP? Any decision (or equivalently, search) problem could be solved in a reasonable amount of time Perfectly optimal designs for all areas of engineering could be chosen Automated theory generation for experimental results No privacy in the digital domain 1/11/2017 ECE 695, Prof. Bermel 30

Next Class Discussion of methods for assessing code performance This will include some realistic examples 1/11/2017 ECE 695, Prof. Bermel 31