1.66k likes | 2k Views
Computational Complexity:. P, NP and beyond CSA Summer School 2013. Chandan Saha. What is Computational Complexity?. Study of the amount of resources required by an algorithm to solve a problem . What is Computational Complexity?.
E N D
Computational Complexity: P, NP and beyond CSA Summer School 2013 ChandanSaha
What is Computational Complexity? • Study of the amount of resources required by an algorithm to solve a problem.
What is Computational Complexity? • Study of the amount of resources required by an algorithm to solve a problem. • Time (bit operations) • Space (bits) • Randomness • Communications
What is Computational Complexity? • Study of the amount of resources required by an algorithm to solve a problem. • Mathematically formalized as Turing Machines
What is Computational Complexity? • Study of the amount of resources required by an algorithm to solve a problem. • Language: Set of {0,1}* strings.
Turing Machines 1 0 1 … 0 1 1 Input :
Turing Machine 1 0 1 … 0 1 1 Input : Work tape: 1 1 0 … 1 1 1 Head
Turing Machine 1 0 1 … 0 1 1 Input : Work tape: Output: 1 1 0 … 1 1 1 1 1 1 … 0 0 1
Turing Machine 1 0 1 … 0 1 1 Input : Work tape: Output: 1 1 0 … 1 1 1 1 1 1 … 0 0 1 Processor (states)
Turing Machine 1 0 1 … 0 1 1 Input : Work tape: Output: 1 1 0 … 1 1 1 1 1 1 … 0 0 1 Finite set of instructions (transition functions) Processor (states)
Why Turing Machines ? • Natural & intuitive.
Why Turing Machines ? • Natural & intuitive. • A formal model helps us study the power and limitations of computation mathematically.
Why Turing Machines ? • Natural & intuitive. • A formal model helps us study the power and limitations of computation mathematically. • Church-Turing thesis: “Everyphysically 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 ? • Natural & intuitive. • A formal model helps us study the power and limitations of computation mathematically. • Church-Turing thesis: “Everyphysically 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] Might or might not be true!
Why Turing Machines ? • Natural & intuitive. • A formal model helps us study the power and limitations of computation mathematically. • Church-Turing thesis: “Everyphysically 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] Might or might not be true! Quantum computers ?
In support of the CT thesis • Several other computational models like, “lamda calculus, cellular automata, pointer machines, bouncing billiard balls, Conway’s game of life, and so on..” are all equivalent to the Turing machine model of computation.
In support of the CT thesis • Several other computational models like, “lamda calculus, cellular automata, pointer machines, bouncing billiard balls, Conway’s game of life, and so on..” are all equivalent to the Turing machine model of computation. Can Turing machines solve any computational problem?
In support of the CT thesis • Several other computational models like, “lamda calculus, cellular automata, pointer machines, bouncing billiard balls, Conway’s game of life, and so on..” are all equivalent to the Turing machine model of computation. Can Turing machines solve any computational problem? Not really!
Example: Solving Diophantine equations 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?
Example: Solving Diophantine equations 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? x2y + 5y3 = 3 x2 + z5 – 3y2 = 0 y2 – 4z6 = 0 Integer solutions for x, y, z?
Example: Solving Diophantine equations 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? x2y + 5y3 = 3 x2 + z5 – 3y2 = 0 y2 – 4z6 = 0 Integer solutions for x, y, z? A question posed by David Hilbert in 1900
Computational limitations of TM • The problem, Solving Diophantine equations, cannot be solved by any Turing machines (no matter how much time & space we allow).
Computational limitations of TM • The problem, Solving Diophantine equations, cannot be solved by any Turing machines (no matter how much time & space we allow). • Such problems are known as undecidableproblems. There are many other examples.
Computational limitations of TM • The problem, Solving Diophantine equations, cannot be solved by any Turing machines (no matter how much time & space we allow). • Such problems are known as undecidableproblems. There are many other examples. • For the rest of this talk, we’ll restrict our attention to computable (or decidable) problems.
Computational limitations of TM • The problem, Solving Diophantine equations, cannot be solved by any Turing machines (no matter how much time & space we allow). • Such problems are known as undecidableproblems. There are many other examples. • For the rest of this talk, we’ll restrict our attention to computable (or decidable) problems. Good idea to have a list of computable problems in mind!
Problem set 1 • Multiplication: Given two integers a & b compute ab
Problem set 1 • Multiplication: Given two integers a & b compute ab • Solving linear system: Solve a system of m linear equations in n variables over rationals.
Problem set 1 • Multiplication: Given two integers a & b compute ab • Solving linear system: Solve a system of m linear equations in n variables over rationals. 1.5x + 0.5y – z = 1.25 x + 2y = 0.25 2x - 0.33y + 0.7z = 2 rational solutions for x, y, z?
Problem set 1 (contd.) • Shortest path: Given a weighted graph and two vertices s & t, find the shortest path from s to t.
Problem set 1 (contd.) • Shortest path: Given a weighted graph and two vertices s & t, find the shortest path from s to t. • Maximum matching: Given a graph, find a maximum matching.
Problem set 1 (contd.) • Shortest path: Given a weighted graph and two vertices s & t, find the shortest path from s to t. • Maximum matching: Given a graph, find a maximum matching. Matching
Problem set 2 • Vertex cover: Given a graph G and an integer k, check if there’s a set of k vertices that covers all the edges. Vertex cover of size 5
Problem set 2 (contd.) • Boolean 3-satisfiability: Given a set of m clauses in n variables check if there’s an assignment that satisfies all the clauses. ¬x + y + z + u = 1 x + ¬y + ¬u = 1 x + ¬y + z = 1 Boolean solution for x,y,z,u?
Problem set 2 (contd.) • Travelling salesman problem: Given a list of pairwise distances between n cities, is there a route of length at most k that travels through all of them?
Problem set 3 • Smallest Boolean circuit: Find the smallest Boolean circuit equivalent to a given Boolean circuit. (VLSI design)
Problem set 3 • Smallest Boolean circuit: Find the smallest Boolean circuit equivalent to a given Boolean circuit. • Number of Cycles: Given a directed graph G, count the number of simple cycles in G. (VLSI design)
Which of the problems in Set 1, 2 and 3 can be solved efficiently?
Which of the problems in Set 1, 2 and 3 can be solved efficiently? We need to formalize the notion of computational efficiency.
Defining `Efficiency’: Class P • Polynomial time computation: An algorithm runs in polynomial time if for every input of size n the running time of the algorithm is bounded by nc, where c is a constant independent of the input. c may vary from one algorithm to the other
Why `polynomial time’? All computational models that are `equivalent’ to Turing machines, reduce to each other in polynomial time If you can solve one problem in one computational model, you can also solve it any other `equivalent’ computational model with just a polynomial slow down in the running time of the algorithm.
Problems in class P • All the problems in Set 1: • Integer Multiplication • Solving linear system • Shortest path • Maximum matching can be solved in polynomial time.
Problems in class P • All the problems in Set 1: • Integer Multiplication • Solving linear system • Shortest path • Maximum matching (Edmonds 1965) can be solved in polynomial time.
Are all computable problems in P? Certainly not!
Are all computable problems in P? Certainly not! • Ideal membership problem: Given multivariate polynomials g, f1, …., fn, check if there exist polynomials h1, …, hnsuch that • g = h1f1 + … + hnfn
Are all computable problems in P? Certainly not! • Ideal membership problem: Given multivariate polynomials g, f1, …., fn, check if there exist polynomials h1, …, hnsuch that • g = h1f1 + … + hnfn IM is not in class P
A simpler version of Ideal membership A valid set of polynomials h1, …, hnis a certificate of the fact that g = h1f1 + … + hnfn
A simpler version of Ideal membership A valid set of polynomials h1, …, hnis a certificate of the fact that g = h1f1 + … + hnfn Simpler version of IM: Suppose an `alleged certificate’ h1, …, hn is given. Check if g = h1f1 + … + hnfn Verification version of IM
A simpler version of Ideal membership A valid set of polynomials h1, …, hnis a certificate of the fact that g = h1f1 + … + hnfn Simpler version of IM: Suppose an `alleged certificate’ h1, …, hn is given. Check if g = h1f1 + … + hnfn Is this problem easy?
A simpler version of Ideal membership A valid set of polynomials h1, …, hnis a certificate of the fact that g = h1f1 + … + hnfn Simpler version of IM: Suppose an `alleged certificate’ h1, …, hn is given. Check if g = h1f1 + … + hnfn Is this problem easy? The certificate h1, …, hn can be much larger than the original polynomials g, f1, …., fn ; implying that verification cannot be done in time polynomial in the size of g, f1, …., fn.
Class NP A problem is in NP if: • its solution or certificate size is small, • solution or certificate can be verified efficiently.