Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office: Inffeldgasse 16B/II, room IC02044 slides: http://www.ist.tugraz.at/pact17.html Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 1
Space Complexity Last Time TQBF is PSPACE-complete Space-summary Presentation Topics Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 2
Last Time Optimization and Approximation Decision vs. Optimization Notion of Approximation: approximation ratio R(x, y) = max defined r(n)-approximation algorithm { } v(x,y), opt(x) opt(x) v(x,y) Complexity classes for optimization problems: PO, NPO, APX(r(n)), APX, APX Problems For some NP-hard so far: MIN problems, VERTEX thecover, optimization MAXproblems (k-deg.) can be efficiently INDEP. approximated SET, MAX CLIQUE, MIN TSP For some factors, approximation may still be NP-hard Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 3
This Time / Next Time Optimization and Approximation Repeat some essentials Consider MIN TSP and MAX KNAPSACK Introduce problems with small solution values Reductions for approximation problems New concept / class PCP: Probabilistically Checkable Proofs Presentations: Organisatorial issues Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 4
Presentations some Organizational Issues: Format of the presentations: pdf (optionally: same as lecture) Length of each presentation: Short: 20 minutes Long: 30-40 minutes For each presentation: Discussion, Questions Timing: send presentation and needed time until Friday before presentation day Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 5
Optimization Problems Definition: An optimization problem A can be defined as a 4-tuple A = (I, S, v, d) where I is the set of instances of A. S(x): x I is the set of solutions for instance x. v(s): s S(x) is the value of soution s for instance x. d {min, max} is the optimization direction. Definition: The class of all optimization problems whose decision variant is in NP is called NPO. x I decidable in polynomial time. y S(x) decidable in polynomial time and y p( x ). v(s) computable in polynomial time. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 6-2
Optimization Problems Definition: An optimization problem A can be defined as a 4-tuple A = (I, S, v, d) where I is the set of instances of A. S(x): x I is the set of solutions for instance x. v(s): s S(x) is the value of soution s for instance x. d {min, max} is the optimization direction. Definition: The class of all optimization problems whose decision variant is in NP is called NPO. Definition: x I decidable The class in polynomial of all optimization time. problems whose decision y S(x) variant decidable is in Pinispolynomial called PO. time and y p( x ). v(s) computable in polynomial time. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 6-3
Measuring Approximation Definition: For an optimization problem A = (I, S, v, d), an instance x I, and a solution y S(x), the approximation ratio of y with respect to x is defined as { v(y) R(x, y) := max, opt(x) } 1 opt(x) v(y) }{{}}{{} v(y) > 0 x, y d=min d=max Definition: Let r : ln [1, ) with r(n + 1) r(n). M is a r(n)-approximation algorithm for A if x I : M(x) S(x) and R(x, M(x)) r( x ). The worst case approximation ratio r M (n) of M is defined as r M (n) := max{r(x, M(x)) : x n}. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 7
Definition: Institute for Software Technology The Classes APX and APX Let r : ln [1, ) with r(n + 1) r(n). The complexity class APX(r(n)) contains all optimization problems which can be approximated by a polynomial-time algorithm M with worst-case approximation ratio r M (n) r(n). APX = c 1 APX(c) is the class of optimization problems admitting a polynomial-time constant factor approximation algorithm for some constant c 1. APX = c>1 APX(c) is the class of optimization problems admitting a polynomial-time constant factor approximation algorithm for any constant c > 1. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 8
APX APX APX APX Optimization Problems Considered several optimization problems: Problem Instance Parameter MIN V.C. graph vertex cover MAX CLIQUE graph clique MAX IND. SET graph indep. set MAX2SAT 2CNF formula sat. clauses MIN TSP weighted graph cost of tour MAX KNAPSACK objects, t. weight total value Question: What if P is the NPrelation between APX and APX? Question: What did we show for which problems? Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 9
MIN TSP TSP: the Travelling Salesman Problem Problem: How efficient can a salesman make a round trip visiting given locations? Optimization problem: What is the minimum time t needed for a round trip that visits all locations of L? Problem instance: A set L = {l 1,... l n } of locations, with travel costs / times (T i,j ) between them, plus a maximum total time t. Theorem: TSP is (strongly) NP-complete. Corollary: MIN TSP is in NPO. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 10
Theorem: MIN TSP and APX If P NP then MIN TSP is not in APX. Proof: Assume there exists a polynomial time c-approximation algorithm A for MIN TSP for some constant c > 1. Given a directed graph G = (V, E), we construct an input for A by assigning weights to the edges of the { complete graph on V : 1 if (i, j) E Ti,j = c V if (i, j) E If G contains a Hamiltonian cycle then v(a(g)) c V. Otherwise v(a(g)) V 1+c V >c V. Algorithm A solves HAMCYCLE in polynomial time. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 11
The Gap Theorem Theorem: Given an optimization problem such that 1. for every input x I and every solution s S(x), s does not lie in the interval (a, b), i.e., either v(s) a or v(s) b, and 2. it is NP-hard to determine if opt(x) a or opt(x) b. Then it is NP-hard to obtain a worst-case approximation ratio that is smaller than b/a. Proof: Exercise. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 12-2
The Gap Theorem Theorem: Given an optimization problem such that 1. for every input x I and every solution s S(x), s does not lie in the interval (a, b), i.e., either v(s) a or v(s) b, and 2. it is NP-hard to determine if opt(x) a or opt(x) b. Then it is NP-hard to obtain a worst-case approximation ratio that is smaller than b/a. Proof: Consider ε-approximation A with ε < b/a. Minimization problem: v(a(x))/opt(x) < b/a x I. opt(x) a v(a(x)) < b opt(x)/a b opt(x) b v(a(x)) opt(x) b A decides opt(x) a or opt(x) b A is NP-hard. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 12-7
The Gap Theorem Theorem: Given an optimization problem such that 1. for every input x I and every solution s S(x), s does not lie in the interval (a, b), i.e., either v(s) a or v(s) b, and 2. it is NP-hard to determine if opt(x) a or opt(x) b. Then it is NP-hard to obtain a worst-case approximation ratio that is smaller than b/a. Proof: Consider ε-approximation A with ε < b/a. Maximization problem: opt(x)/v(a(x)) < b/a x I. opt(x) a v(a(x)) opt(x) a opt(x) b v(a(x)) > a opt(x)/b a A decides opt(x) a or opt(x) b A is NP-hard. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 12-12
MIN TSP with -Inequality MIN TSP does not have polynomial time constant factor approximation for any constant factor c. Question: Does this imply that route planning is completely intractible? MIN TSP : Given set L = {l 1,... l n } of locations, with travel times (T i,j ) between them, such that T i,j l j l i, l j, l k L : T i,j + T j,k T i,k, what is thet minimum time t needed for a j,k round trip that visits all locations of L? l k l i T i,k Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 13-4
MIN TSP with -Inequality MIN TSP does not have polynomial time constant factor approximation for any constant factor c. Question: Does this imply that route planning is completely intractible? MIN TSP : Given set L = {l 1,... l n } of locations, with travel times (T i,j ) between them, such that l i, l j, l k L : T i,j + T j,k T i,k, what is the minimum time t needed for a round trip that visits all locations of L? Problem instance: A set L = {l 1,... l n } of locations and a matrix (T i,j ) of travel times. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 13-6
MIN TSP with -Inequality Question: What about MIN TSP and APX? Idea: Use algorithm for minimum spanning tree (in PO) tour(l, T i,j ): 1. Find a minimum spanning tree S for L, T i,j 2. Traverse S with depth first search, jumping over already visited vertices (via direct edges) Claim 1: tour(l, T i,j ) really returns a tour. Claim 2: minimum spanning tree cheapest tour Claim 3: tour(l, T i,j ) 2 minimum spanning tree Corollary: MIN TSP has a polynomial-time 2-approximation and hence is in APX. Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 13-14
Next: PTAS and FPTAS Definition: An algorithm M for an optimization problem A = (I, S, v, d) is an approximation scheme for A if x I, ε > 1 : R(x, M(x, ε)) ε. Definition: An optimization problem is in the class PTAS if it has a polynomial-time approximation scheme. Question: What s the relation APX versus PTAS? Question: What s the running-time of a PTAS algorithm? Definition: An optimization problem is in the class FPTAS (= fully PTAS) if it has an approximation scheme M for which the running time for M(x, ε) is bounded by some polynomial p( x, 1/(1 ε)). Birgit Vogtenhuber Problem Analysis and Complexity Theory, 716.054, summer term 2017 14