Computational Complexity Theory Lecture 1: Intro; Turing machines; Class P and NP Indian Institute of Science.

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Complexity Classes: P and NP
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
Great Theoretical Ideas in Computer Science for Some.
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
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.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Complexity and Cryptography
1 dKS, Spring Some practical information Lecturers: Kristoffer Arnsfelt Hansen and Peter Bro Miltersen. Homepage:
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
P, NP and beyond CSA Summer School 2013 Chandan Saha.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Lecture 30. P, NP and NP Complete Problems 1. Recap Data compression is a technique to compress the data represented either in text, audio or image form.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Computational Complexity Theory Lecture 1: Intro; Turing machines; Class P and NP Indian Institute of Science.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
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.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Instructor: Shengyu Zhang 1. Tractable While we have introduced many problems with polynomial-time algorithms… …not all problems enjoy fast computation.
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 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. 2 Lecture outline Basic definitions: Basic definitions: P, NP complexity classes P, NP complexity classes the notion of a certificate. the notion of.
P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.
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.
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.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
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.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
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.
Design and Analysis of Approximation Algorithms
P & NP.
Chapter 10 NP-Complete Problems.
Computational Complexity Theory
Computational Complexity Theory
Part VI NP-Hardness.
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
ICS 353: Design and Analysis of Algorithms
Objective of This Course
Chapter 34: NP-Completeness
Chapter 11 Limitations of Algorithm Power
Prabhas Chongstitvatana
Recall last lecture and Nondeterministic TMs
NP-Completeness Yin Tat Lee
Umans Complexity Theory Lectures
Instructor: Aaron Roth
RAIK 283 Data Structures & Algorithms
Presentation transcript:

Computational Complexity Theory Lecture 1: Intro; Turing machines; Class P and NP Indian Institute of Science

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them.

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational problems come in various flavors:

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational problems come in various flavors: a. Decision problem Example: Is vertex t reachable from vertex s in graph G? (…output is YES/NO)

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational problems come in various flavors: a. Decision problem b. Search problem Example: Find a satisfying assignment of a boolean formula, if it exists.

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational problems come in various flavors: a. Decision problem b. Search problem c. Counting problem Example: Find the number of cycles in a graph

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational problems come in various flavors: a. Decision problem b. Search problem c. Counting problem d. Optimization problem Example: Find a minimum size vertex cover in a graph

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Algorithms are methods of solving problems; they are studied using formal models of computation, like Turing machines.

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Algorithms are methods of solving problems; they are studied using formal models of computation, like Turing machines. a memory with head (like a RAM)

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Algorithms are methods of solving problems; they are studied using formal models of computation, like Turing machines. a memory with head (like a RAM) a finite control (like a processor)

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Algorithms are methods of solving problems; they are studied using formal models of computation, like Turing machines. (…more later)

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational resources (required by models of computation) can be: Time (bit operations) Space (memory cells)

About the course Computational complexity attempts to classify computational problems based on the amount of resources required by algorithms to solve them. Computational resources (required by models of computation) can be: Time (bit operations) Space (memory cells) Random bits Communication (bit exchanges)

Complexity theory Structural complexity (P, NP, etc.) Role of Randomness Approximation algorithms Average-case complexity Secrecy & security Some topics in complexity theory

Complexity theory Structural complexity (P, NP, etc.) Role of Randomness Approximation algorithms Average-case complexity Secrecy & security Some topics in complexity theory

Structural Complexity Classes P, NP, NP-completeness.

Structural Complexity Classes P, NP, NP-completeness. How hard is it to check satisfiability of a boolean formula that has exactly one or no satisfying assignment?

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation.

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. How much space is required to check s-t connectivity?

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity.

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity. How hard is it to count the number of perfect matchings in a graph?

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity. Polynomial Hierarchy. co-NPNP P How easy is it to check that largest independent set in G has size exactly k ?

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity. Polynomial Hierarchy. How hard is it to find a minimum size circuit computing the same boolean function as a given boolean circuit?

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity. Polynomial Hierarchy. Boolean circuits and circuit lower bounds.

Structural Complexity Classes P, NP, NP-completeness. Space bounded computation. Counting complexity. Polynomial Hierarchy. Boolean circuits and circuit lower bounds. A central topic in classical complecity theory; Proving P≠NP boils down to showing circuit lower bounds.

Role of Randomness in Computation Probabilistic complexity classes.

Role of Randomness in Computation Probabilistic complexity classes. Does randomization help in improving efficiency? Quicksort has O(n log n) expected time but O(n^2) worst case time. Can SAT be solved in polynomial time using randomness?

Role of Randomness in Computation Probabilistic complexity classes. Probabilistically Checkable Proofs (PCPs).

Role of Randomness in Computation Probabilistic complexity classes. Probabilistically Checkable Proofs (PCPs). Unconditional hardness of approximation results

Role of Randomness in Computation Probabilistic complexity classes. Probabilistically Checkable Proofs (PCPs). A glimpse of randomness extractors and pseudorandom generators (if time permits).

Role of Randomness in Computation Probabilistic complexity classes. Probabilistically Checkable Proofs (PCPs). A glimpse of randomness extractors and pseudorandom generators (if time permits). Can every polynomial-time randomized algorithm be derandomized to a deterministic polynomial-time algorithm?

Average-case Complexity Distributional problems.

Average-case Complexity Distributional problems. How hard is it to solve the clique problem on inputs chosen from a “real-life” distribution?

Average-case Complexity Distributional problems. Hardness amplification: From weak to strong hardness.

Average-case Complexity Distributional problems. Hardness amplification: From weak to strong hardness. In cryptographic applications, we need hard functions for secure encryptions.

Basic Course Info Course title: Computational Complexity Theory Credits: 3:1 Instructor: Chandan Saha TA: Abhishek Shetty and Sanal Prasad Class timings : Tuesday, Thursday: 11-12:30. Venue: CSA lecture hall 117. Primary reference: Computational Complexity – A Modern Approach by Sanjeev Arora and Boaz Barak.

Basic Course Info Prerequisites : Basic familiarity with algorithms; Some mathematical maturity will be helpful. Grading policy : Assignments - 40% Mid-term - 30% End-term - 30% Course homepage: drona.csa.iisc.ernet.in/~chandan/courses/complexity16/home.html

Let’s begin…

Turing Machines An algorithm is a set of instructions or rules. To understand the performance of an algorithm we need a model of computation. Turing machine is one such natural model.

Turing Machines An algorithm is a set of instructions or rules. To understand the performance of an algorithm we need a model of computation. Turing machine is one such natural model. A TM consists of: Memory tape(s) A finite set of rules

Turing Machines An algorithm is a set of instructions or rules. To understand the performance of an algorithm we need a model of computation. Turing machine is one such natural model. A TM consists of: Turing machines A mathematical way to describe algorithms. Memory tape(s) A finite set of rules

Turing Machines An algorithm is a set of instructions or rules. To understand the performance of an algorithm we need a model of computation. Turing machine is one such natural model. A TM consists of: (e.g. of a physical realization a TM is a simple adder) Memory tape(s) A finite set of rules

Turing Machines Definition. A k-tape Turing Machine M is described by a tuple ( Γ, Q, δ ) such that

Turing Machines Definition. A k-tape Turing Machine M is described by a tuple ( Γ, Q, δ ) such that M has k memory tapes (input/work/output tapes) with heads; Γ is a finite set of alphabets. (Every memory cell contains an element of Γ )

Turing Machines Definition. A k-tape Turing Machine M is described by a tuple ( Γ, Q, δ ) such that M has k memory tapes (input/work/output tapes) with heads; Γ is a finite set of alphabets. (Every memory cell contains an element of Γ ) has a blank symbol

Turing Machines Definition. A k-tape Turing Machine M is described by a tuple ( Γ, Q, δ ) such that M has k memory tapes (input/work/output tapes) with heads; Γ is a finite set of alphabets. (Every memory cell contains an element of Γ ) Q is a finite set of states. (special states: q start, q halt ) δ is a function from Q x Γ to Q x Γ x {L,S,R} k kk

Turing Machines Definition. A k-tape Turing Machine M is described by a tuple ( Γ, Q, δ ) such that M has k memory tapes (input/work/output tapes) with heads; Γ is a finite set of alphabets. (Every memory cell contains an element of Γ ) Q is a finite set of states. (special states: q start, q halt ) δ is a function from Q x Γ to Q x Γ x {L,S,R} k kk known as transition function; it captures the dynamics of M

Turing Machines: Computation Start configuration.  All tapes other than the input tape contain blank symbols.  The input tape contains the input string.  All the head positions are at the start of the tapes.  The machine is in the start state q start.

Turing Machines: Computation Start configuration.  All tapes other than the input tape contain blank symbols.  The input tape contains the input string.  All the head positions are at the start of the tapes.  The machine is in the start state q start. Computation.  A step of computation is performed by applying δ. Halting.  Once the machine enters q halt it stops computation.

Turing Machines: Running time

Turing Machines In this course, we would be dealing with  Turing machines that halt on every input.  Computational problems that can be solved by Turing machines.

Turing Machines In this course, we would be dealing with  Turing machines that halt on every input.  Computational problems that can be solved by Turing machines. Can every computational problem be solved using Turing machines?

Turing Machines: Uncomputability There are problems for which there exists no TM that halts on every input instances of the problem and outputs the correct answer.  Input: A system of polynomial equations in many variables with integer coefficients.  Output: Check if the system has integer solutions.  Question: Is there an algorithm to solve this problem?

Turing Machines: Uncomputability There are problems for which there exists no TM that halts on every input instances of the problem and outputs the correct answer.  A typical input instance: x 2 y + 5y 3 = 3 x 2 + z 5 – 3y 2 = 0 y 2 – 4z 6 = 0 Integer solutions for x, y, z?

Turing Machines: Uncomputability There are problems for which there exists no TM that halts on every input instances of the problem and outputs the correct answer.  Input: A system of polynomial equations in many variables with integer coefficients.  Output: Check if the system has integer solutions.  Question: Is there an algorithm to solve this problem? (Hilbert’s tenth problem, 1900)

Turing Machines: Uncomputability There are problems for which there exists no TM that halts on every input instances of the problem and outputs the correct answer.  Input: A system of polynomial equations in many variables with integer coefficients.  Output: Check if the system has integer solutions.  Question: Is there an algorithm to solve this problem? Theorem. There does not exist any algorithm (realizable by a TM) to solve this problem.

Why Turing Machines? TMs are natural and intuitive. Church-Turing thesis: “Every physically realizable computation device – whether it’s based on silicon, DNA, neurons or some other alien technology – can be simulated by a Turing machine”. --- [quote from Arora-Barak’s book]

Why Turing Machines? TMs are natural and intuitive. Church-Turing thesis: “Every physically realizable computation device – whether it’s based on silicon, DNA, neurons or some other alien technology – can be simulated by a Turing machine”. --- [quote from Arora-Barak’s book] Several other computational models can be simulated by TMs.

Basic facts about TMs

Turing Machines in binary

Turing Machines: Robustness

Turing Machines: As strings Every TM can be represented by a finite string over {0,1}. …simply encode the description of the TM.

Turing Machines: As strings Every TM can be represented by a finite string over {0,1}. Every string over {0,1} represents some TM. …invalid strings map to a fixed, trivial TM.

Turing Machines: As strings Every TM can be represented by a finite string over {0,1}. Every string over {0,1} represents some TM. Every TM has infinitely many string representations. … allow padding with arbitrary number of 0’s

Turing Machines: As strings Every TM can be represented by a finite string over {0,1}. Every string over {0,1} represents some TM. Every TM has infinitely many string representations. α M α {0,1} string TM corresponding to α

Turing Machines: As strings Every TM can be represented by a finite string over {0,1}. Every string over {0,1} represents some TM. Every TM has infinitely many string representations. A TM (i.e. its string representation) can be given as an input to another TM !!

Universal Turing Machines Theorem. There exists a TM U that on every input x, α in {0,1}* outputs M α (x). Further, if M α halts within T steps then U halts within C. T. log T steps, where C is a constant that depends only on M α ’s alphabet size, number of states and number of tapes.

Universal Turing Machines Theorem. There exists a TM U that on every input x, α in {0,1}* outputs M α (x). Further, if M α halts within T steps then U halts within C. T. log T steps, where C is a constant that depends only on M α ’s alphabet size, number of states and number of tapes. Physical realization of UTMs are modern day electronic computers.

Complexity classes P and NP

Decision Problems In the initial part of this course, we’ll focus primarily on decision problems.

Decision Problems In the initial part of this course, we’ll focus primarily on decision problems. Decision problems can be naturally identified with boolean functions, i.e. functions from {0,1}* to {0,1}.

Decision Problems In the initial part of this course, we’ll focus primarily on decision problems. Decision problems can be naturally identified with boolean functions, i.e. functions from {0,1}* to {0,1}. Boolean functions can be naturally identified with sets of {0,1} strings, also called languages.

Decision Problems Decision problems Boolean functions Languages Definition. We say a TM M decides a language L ⊆ {0,1}* if M computes f L, where f L (x) = 1 if and only if x ∈ L.

Complexity Class P c > 0

Complexity Class P c > 0 Deterministic polynomial-time

Complexity Class P : Examples Cycle detection (DFS)  Check if a given graph has a cycle.

Complexity Class P : Examples

Cycle detection Solvabililty of a system of linear equations Perfect matching (Edmonds 1965)  Check if a given graph has a perfect matching

Complexity Class P : Examples Cycle detection Solvabililty of a system of linear equations Perfect matching Primality testing (AKS test 2002)  Check if a number is prime

Polynomial time Turing Machines Polynomial function. q(n) = n c for some constant c

Class (functional) P What if a problem is not a decision problem? Like the task of adding two integers.

Class (functional) P What if a problem is not a decision problem? Like the task of adding two integers. One way is to focus on the i-th bit of the output and make it a decision problem. (Is the i-th bit, on input x, 1?)

Class (functional) P What if a problem is not a decision problem? Like the task of adding two integers. One way is to focus on the i-th bit of the output and make it a decision problem. Alternatively, we define a class called functional P.

Class (functional) P What if a problem is not a decision problem? Like the task of adding two integers. One way is to focus on the i-th bit of the output and make it a decision problem. We say that a problem or a function f: {0,1}* {0,1}* is in FP (functional P) if there’s a polynomial-time TM that computes f.

Complexity Class FP : Examples Greatest Common Divisor (Euclid ~300 BC)  Given two integers a and b, find their gcd.

Complexity Class FP : Examples Greatest Common Divisor Counting paths in a DAG (homework)  Find the number of paths between two vetices in a directed acyclic graph.

Complexity Class FP : Examples Greatest Common Divisor Counting paths in a DAG Maximum matching (Edmonds 1965)  Find a maximum matching in a given graph

Complexity Class FP : Examples Greatest Common Divisor Counting paths in a DAG Maximum matching Linear Programming (Khachiyan 1979, Karmarkar 1984)  Optimize a linear objective function subject to linear (in)equality constraints

Complexity Class NP Solving a problem is generally harder than verifying a given solution to the problem.

Complexity Class NP Solving a problem is generally harder than verifying a given solution to the problem. Class NP captures the set of decision problems whose solutions are efficiently verifiable.

Complexity Class NP Solving a problem is generally harder than verifying a given solution to the problem. Class NP captures the set of decision problems whose solutions are efficiently verifiable. Nondeterministic polynomial-time

Complexity Class NP

u is called a certificate or witness for x (w.r.t L and M) if x ∈ L

Complexity Class NP

Class NP : Examples Vertex cover  Given a graph G and an integer k, check if G has a vertex cover of size k.

Class NP : Examples Vertex cover 0/1 integer programming  Given a system of linear (in)equalities with integer coefficients, check if there’s a 0-1 assignment to the variables that satisfy all the (in)equalities.

Class NP : Examples Vertex cover 0/1 integer programming Integer factoring  Given 3 numbers n, L, U, check if n has a prime factor between L and U.

Class NP : Examples Vertex cover 0/1 integer programming Integer factoring Graph isomorphism  Given 2 graphs, check if they are isomorphic

Is P = NP ? Obviously, P ⊆ NP. Whether or not P = NP is an outstanding open question in mathematics!

Is P = NP ? Obviously, P ⊆ NP. Whether or not P = NP is an outstanding open question in mathematics! Solving a problem does seem harder than verifying its solution, so most people believe that P ≠ NP.

Is P = NP ? Obviously, P ⊆ NP. Whether or not P = NP is an outstanding open question in mathematics! P = NP has many weird consequences, and if true, will pose a serious threat to secure and efficient crytography.

Is P = NP ? Obviously, P ⊆ NP. Whether or not P = NP is an outstanding open question in mathematics! Complexity theory has several such intriguing unsolved questions.