Reductions. designing algorithms establishing lower bounds establishing intractability classifying problems. Bird s-eye view
|
|
- Lee Byrd
- 6 years ago
- Views:
Transcription
1 Bird s-eye view Reductions designing algorithms establishing lower bounds establishing intractability classifying problems Desiderata. Classify problems according to computational requirements. Linear: min/max, median, Burrows-Wheeler transform,... Linearithmic: sort, convex hull, closest pair, Quadratic: Cubic: Exponential: rustrating news. Huge number of fundamental problems have defied classification. Algorithms in Java, 4 th Edition Robert Sedgewick and Kevin Wayne Copyright 008 April 0, 008 7:44:0 AM Bird s-eye view Reduction Desiderata. Classify problems according to computational requirements. Desiderata'. Suppose we could (couldn't) solve problem X efficiently. What else could (couldn't) we solve efficiently? Def. Problem X reduces to problem Y if you can use an algorithm that solves Y to help solve X. instance I (of X) Algorithm for Y solution to I Algorithm for X Cost of solving X = total cost of solving Y + cost of reduction. Give me a lever long enough and a fulcrum on which to place it, and I shall move the world. Archimedes perhaps many calls to Y on problems of different sizes 4
2 Reduction Reduction Def. Problem X reduces to problem Y if you can use an algorithm that solves Y to help solve X. Def. Problem X reduces to problem Y if you can use an algorithm that solves Y to help solve X. instance I (of X) Algorithm for Y solution to I instance I (of X) Algorithm for Y solution to I Algorithm for X Algorithm for X Ex 1. [element distinctness reduces to sorting] o solve element distinctness on N integers: Sort N integers. Scan through consecutive pairs and check if any are equal. Cost of solving element distinctness. N log N + N. Ex. [-collinear reduces to sorting] o solve -collinear instance on N points in the plane: or each point, sort other points by polar angle. - scan through consecutive triples and check if they are collinear Cost of solving -collinear. N log N + N. 5 6 Reduction: design algorithms Def. Problem X reduces to problem Y if you can use an algorithm that solves Y to help solve X. Design algorithm. Given algorithm for Y, can also solve X. designing algorithms establishing lower bounds establishing intractability classifying problems Ex. Element distinctness reduces to sorting. -collinear reduces to sorting. PER reduces to topological sort. [see digraph lecture] h-v line intersection reduces to 1d range searching. [see geometry lecture] Mentality. Since I know how to solve Y, can I use that algorithm to solve X? programmer s version: I have code for Y. Can I use it for X? 7 8
3 Convex hull reduces to sorting Shortest path on graphs and digraphs Sorting. Given N distinct integers, rearrange them in ascending order. Convex hull. Given N points in the plane, identify the extreme points of the convex hull (in counter-clockwise order). Proposition. Undirected shortest path (with nonnegative weights) reduces to directed shortest path s t convex hull sorting Proposition. Convex hull reduces to sorting. Graham scan algorithm Shortest path on graphs and digraphs Shortest path with negative weights Proposition. Undirected shortest path (with nonnegative weights) reduces to directed shortest path. Caveat. Reduction is invalid in networks with negative weights (even if no negative cycles). 9 5 a 7 v -4 t s t 7-4 s 7 v -4 t Replace each undirected edge by two directed edges. 9 reduction creates negative cycles 9 5 s t Remark. Can still solve shortest path problem in undirected graphs (if no negative cycles), but need more sophisticated techniques reduces to weighted non-bipartite matching (!) 1
4 Primality testing Primality testing PRIME. Given an integer x (represented in binary), is x prime? COMPOSIE. Given an integer x, does x have a nontrivial factor? PRIME. Given an integer x (represented in binary), is x prime? COMPOSIE. Given an integer x, does x have a nontrivial factor? Proposition. PRIME reduces to COMPOSIE. Proposition. COMPOSIE reduces to PRIME. public static boolean isprime(biginteger x) { if (iscomposite(x)) return false; else return true; } public static boolean iscomposite(biginteger x) { if (isprime(x)) return false; else return true; } PRIME PRIME prime prime COMPOSIE COMPOSIE composite composite 1 14 Caveat Some reductions PRIME. Given an integer x (represented in binary), is x prime? COMPOSIE. Given an integer x, does x have a nontrivial factor? Proposition. COMPOSIE reduces to PRIME. Proposition. PRIME reduces to COMPOSIE. bipartite matching shortest paths (nonnegative) arbitrage A possible real-world scenario. System designer specs the APIs for project. Programmer A implements iscomposite() using isprime(). Programmer B implements isprime() using iscomposite(). Infinite reduction loop! PRIME whose fault? median finding element distinctness closest pair sorting Euclidean MS convex hull maximum flow LP shortest paths (no neg cycles) COMPOSIE Voronoi LP (standard form) 15 16
5 Bird's-eye view Goal. Prove that a problem requires a certain number of steps. Ex. Ω(N log N) lower bound for sorting. designing algorithms establishing lower bounds establishing intractability classifying problems argument must apply to all conceivable algorithms Bad news. Very difficult to establish lower bounds from scratch. Good news. Can establish Ω(N log N) lower bound for Y by reducing sorting to Y. assuming cost of reduction is not too large Linear-time reductions Linear-time reductions Def. Problem X linear-time reduces to problem Y if X can be solved with: linear number of standard computational steps one call to Y Def. Problem X linear-time reduces to problem Y if X can be solved with: linear number of standard computational steps one call to Y Ex. Almost all of the reductions we've seen so far. Q. Which one was not a linear-time reduction? Establish lower bound: If X takes Ω(N log N) steps, then so does Y. If X takes Ω(N ) steps, then so does Y. instance I (of X) Algorithm for Y Algorithm for X solution to I Mentality. If I could easily solve Y, then I could easily solve X. I can t easily solve X. herefore, I can t easily solve Y. 19 0
6 Lower bound for convex hull Sorting linear-time reduces to convex hull act. In quadratic decision tree model, any algorithm for sorting N integers requires Ω(N log N) steps. allows quadratic tests of the form: xi < xj or (xj - xi) (xk - xi) - (xj ) (xj - xi) < 0 Proposition. Sorting linear-time reduces to convex hull. Sorting instance. X = { x 1, x,..., x N } Convex hull instance. P = { (x 1, x 1 ), (x, x ),..., (x N, x N ) } Proposition. Sorting linear-time reduces to convex hull. [see next slide] f(x) = x (x, x ) (x 1, x 1 ) sorting convex hull a quadratic test Implication. Any ccw-based convex hull algorithm requires Ω(N log N) ccw's. Region {x : x x} is convex all points are on hull. Starting at point with most negative x, counter-clockwise order of hull points yields integers in ascending order. 1 Lower bound for -COLLINEAR Lower bound for -COLLINEAR -SUM. Given N distinct integers, are there three that sum to 0? -SUM. Given N distinct integers, are there three that sum to 0? -COLLINEAR. Given N distinct points in the plane, are there that all lie on the same line? recall Assignment -COLLINEAR. Given N distinct points in the plane, are there that all lie on the same line? Proposition. -SUM linear-time reduces to -COLLINEAR. [see next slide] in certain restricted model of computation -sum -collinear act. Any algorithm for -SUM requires Ω(N ) time. Implication. No sub-quadratic algorithm for -COLLINEAR. your N log N algorithm was pretty good 4
7 -SUM linear-time reduces to -COLLINEAR -SUM linear-time reduces to -COLLINEAR Proposition. -SUM linear-time reduces to -COLLINEAR. -SUM instance: X = { x 1, x,..., x N } -COLLINEAR instance: P = { (x 1, x 1 ), (x, x ),..., (x N, x N ) } Lemma. If a, b, and c are distinct, then a + b + c = 0 if and only if (a, a ), (b, b ), (c, c ) are collinear. f(x) = x Proposition. -SUM linear-time reduces to -COLLINEAR. -SUM instance: X = { x 1, x,..., x N } -COLLINEAR instance: P = { (x 1, x 1 ), (x, x ),..., (x N, x N ) } Lemma. If a, b, and c are distinct, then a + b + c = 0 if and only if (a, a ), (b, b ), (c, c ) are collinear. (, 8) hree points (a, a ), (b, b ), (c, c ) are collinear iff: (1, 1) (-, -7) = 0 (a - b ) / (a - b) = (b - c ) / (b - c) (a - b)(a + ab + b ) / (a - b) = (b - c)(b + bc + c ) / (b - c) (a + ab + b ) = (b + bc + c ) a + ab - bc - c = 0 (a - c)(a + b + c) = 0 a + b + c = 0 slopes are equal factor numerators a-b and b-c are nonzero collect terms factor a-c is nonzero 5 6 More lower bounds Establishing lower bounds: summary Establishing lower bounds through reduction is an important tool element distinctness (N log N lower bound) -sum (N lower bound) in guiding algorithm design efforts. Q. How to convince yourself no linear-time convex hull algorithm exists? Hard way. Long futile search for a linear-time algorithm. Easy way. Reduction from sorting. sorting closest pair -collinear dihedral rotation sorting convex hull convex hull Voronoi Euclidean MS min area triangle Q. How to convince yourself no subquadratic -COLLINEAR algorithm exists. Hard way. Long futile search for a subquadratic algorithm. Easy way. Reduction from -SUM. -SUM -COLLINEAR 7 8
8 Bird's-eye view Desiderata. Prove that a problem can't be solved in poly-time. designing algorithms establishing lower bounds establishing intractability classifying problems EXPIME-complete. Given a fixed-size program and input, does it halt in at most k steps? Given N-by-N checkers board position, can the first player force a win (using forced capture rule)? rustrating news. Extremely difficult and few successes. input size = lg k 9 0 -satisfiability -satisfiability is intractable Literal. A boolean variable or its negation. Clause. An or of distinct literals. Conjunctive normal form. An and of clauses. x i or x i C j = (x 1 x x ) Φ = (C 1 C C C 4) Q. How to solve an instance of -SA with n variables? A. Exhaustive search: try all n truth assignments. Q. Can we do anything substantially more clever? -SA. Given a CN formula Φ consisting of k clauses over n literals, does it have a satisfying truth assignment? yes instance ( x 1 x x ) (x 1 x x ) ( x 1 x x ) ( x 1 x x 4) ( x x x 4) x1 x x x4 ( ) ( ) ( ) ( ) ( ) no instance ( x 1 x x ) (x 1 x x ) ( x 1 x x ) ( x 1 x x 4) ( x x x 4) Conjecture (P NP). No poly-time algorithm for -SA. "intractable" Applications. Circuit design, program correctness,... Good news. Can prove problems "intractable" via reduction from -SA. 1
9 Polynomial-time reductions Polynomial-time reductions Def. Problem X poly-time reduces to problem Y if X can be solved with: Polynomial number of standard computational steps. One call to Y. Def. Problem X poly-time reduces to problem Y if X can be solved with: Polynomial number of standard computational steps. One call to Y. Ex. All reductions we've seen. Establish intractability. If -SA poly-time reduces to Y, then Y is intractable. instance I (of X) Algorithm for Y Algorithm for X solution to I Mentality. If I could solve Y in poly-time, then I could also solve -SA. I can t solve -SA. herefore, I can t solve Y. 4 Integer linear programming Graph -colorability ILP. Minimize a linear objective function, subject to linear inequalities, and integer variables. -COLOR. Given a graph, is there a way to color the vertices red, green, and blue so that no adjacent vertices have the same color? Proposition. -SA poly-time reduces to ILP. [by example] ( x1 x x) (x1 x x) ( x1 x x) ( x1 x x4) ( x x x4) minimize subject to the constraints C1 + C + C + C4 + C5 (1 - x1) C1 x C1 x C1... all xi and Cj = { 0, 1 } CN formula satisfiable iff min = 5 C1 = 1 iff clause 1 is satisfied add inequalities for each clause yes instance Interpretation. Boolean variable xi is true iff integer variable xi =
10 Graph -colorability Graph -colorability -COLOR. Given a graph, is there a way to color the vertices red, green, and blue so that no adjacent vertices have the same color? -COLOR. Given a graph, is there a way to color the vertices red, green, and blue so that no adjacent vertices have the same color? no instance yes instance Applications. Register allocation, Potts model in physics, 7 8 -satisfiability reduces to graph -colorability -satisfiability reduces to graph -colorability Proposition. -SA poly-time reduces to -COLOR. Given -SA instance Φ, we construct an instance G of -COLOR that is -colorable if and only if Φ is satisfiable. Construction. (i) Create one vertex for each literal and vertices,, and N. (ii) Connect,, and N in a triangle and connect each literal to N. (iii) Connect each literal to its negation. (iv) or each clause, attach a 6-vertex gadget [details to follow]. Claim. If graph G is -colorable then Φ is satisfiable. Consider assignment where corresponds to false and to true. (ii) [triangle] ensures each literal is true or false. false true false true N neither N neither x 1 x 1 x x x x... x n x n x 1 x 1 x x x x... x n x n 9 40
11 -satisfiability reduces to graph -colorability -satisfiability reduces to graph -colorability Claim. If graph G is -colorable then Φ is satisfiable. Consider assignment where corresponds to false and to true. (ii) [triangle] ensures each literal is true or false. (iii) ensures a literal and its negation are opposites. Claim. If graph G is -colorable then Φ is satisfiable. Consider assignment where corresponds to false and to true. (ii) [triangle] ensures each literal is true or false. (iii) ensures a literal and its negation are opposites. (iv) [gadget] ensures at least one literal in each clause is true. next slide (x 1 x x ) B false true x 1 x x N neither 6-node gadget x 1 x 1 x x x x... x n x n true false satisfiability reduces to graph -colorability -satisfiability reduces to graph -colorability Claim. If graph G is -colorable then Φ is satisfiable. Consider assignment where corresponds to false and to true. (ii) [triangle] ensures each literal is true or false. (iii) ensures a literal and its negation are opposites. (iv) [gadget] ensures at least one literal in each clause is true. Claim. If Φ is satisfiable then graph G is -colorable. at least one in each clause Color nodes corresponding to false literals and to true literals. herefore, Φ is satisfiable. next slide (x 1 x x ) B if all literals in clause are false, then not -colorable (contradiction) (x 1 x x ) B x 1 x x x 1 x x 6-node gadget true false 4 44
12 -satisfiability reduces to graph -colorability -satisfiability reduces to graph -colorability Claim. If Φ is satisfiable then graph G is -colorable. Color nodes corresponding to false literals and to true literals. Color vertex below one vertex, and vertex below that. Claim. If Φ is satisfiable then graph G is -colorable. Color nodes corresponding to false literals and to true literals. Color vertex below one vertex, and vertex below that. Color remaining middle row vertices. (x 1 x x ) B (x 1 x x ) B x 1 x x x 1 x x satisfiability reduces to graph -colorability -satisfiability reduces to graph -colorability Claim. If Φ is satisfiable then graph G is -colorable. Color nodes corresponding to false literals and to true literals. Color vertex below one vertex, and vertex below that. Color remaining middle row vertices. Color remaining bottom vertices or as forced. Works for all gadgets, so graph is -colorable. (x 1 x x ) B Proposition. -SA poly-time reduces to -COLOR. Given -SA instance Φ, we construct an instance G of -COLOR that is -colorable if and only if Φ is satisfiable. Construction. (i) Create one vertex for each literal and vertices,, and N. (ii) Connect,, and N in a triangle and connect each literal to N. (iii) Connect each literal to its negation. (iv) or each clause, attach a 6-vertex gadget. x 1 x x Consequence. -COLOR is intractable
13 More poly-time reductions from -satisfiability Establishing intractability: summary -SA reduces to -COLOR -SA Establishing intractability through poly-time reduction is an important tool in guiding algorithm design efforts. -COLOR DM VEREX COVER Dick Karp '85 uring award Q. How to convince yourself that a new problem is intractable? Hard way. Long futile search for an efficient algorithm (as for -SA). Easy way. Reduction from a know intractable problem (such as -SA). EXAC COVER PLANAR--COLOR CLIQUE HAM-CYCLE hence, intricate reductions are common SUBSE-SUM INDEPENDEN SE SP HAM-PAH -SA -COLOR PARIION INEGER PROGRAMMING KNAPSACK BIN-PACKING Conjecture: no poly-time algorithm for -SA. (and hence none of these problems) Implications of poly-time reductions Implications of poly-time reductions 51 5
14 Implications of poly-time reductions designing algorithms establishing lower bounds establishing intractability classifying problems 5 54 Classify problems Classify problems Desiderata. Classify problems according to difficulty. Linear: can be solved in linear time. Linearithmic: can be solved in linearithmic time. Quadratic: can be solved in quadratic time. ractable: can be solved in poly-time. Intractable: seem to require exponential time. Desiderata. Classify problems according to difficulty. Linear: can be solved in linear time. Linearithmic: can be solved in linearithmic time. Quadratic: can be solved in quadratic time. ractable: can be solved in poly-time. Intractable: seem to require exponential time. Ex. Sorting and convex hull are in same complexity class. Sorting linear-time reduces to convex hull. Convex hull linear-time reduces to sorting. linearithmic Ex. PRIME and COMPOSIE are in same complexity class. PRIME linear-time reduces to COMPOSIE. COMPOSIE linear-time reduces to PRIME. tractable, but nobody knows which class 55 56
15 Classify problems Cook s theorem Desiderata. Classify problems according to difficulty. Linear: can be solved in linear time. Linearithmic: can be solved in linearithmic time. Quadratic: can be solved in quadratic time. P. Set of problems solvable in poly-time. Importance. What scientists and engineers can compute feasibly. NP. Set of problems checkable in poly-time. Importance. What scientists and engineers aspire to compute feasibly. ractable: can be solved in poly-time. Intractable: seem to require exponential time. Ex. -SA and -COLOR are in the same complexity class. -SA poly-time reduces to -COLOR. -COLOR poly-time reduces to -SA. probably intractable Cook's theorem. All problems in NP poly-time reduces to -SA. "NP-complete" Cook's theorem (stay tuned) Implications of Cook s theorem Implications of Karp + Cook -COLOR -COLOR reduces to -SA -SA DM VEREX COVER Stephen Cook '8 uring award -COLOR -COLOR reduces to -SA -SA reduces to -COLOR -SA DM VEREX COVER EXAC COVER PLANAR--COLOR CLIQUE HAM-CYCLE EXAC COVER PLANAR--COLOR CLIQUE HAM-CYCLE SUBSE-SUM INDEPENDEN SE SP HAM-PAH SUBSE-SUM INDEPENDEN SE SP HAM-PAH PARIION INEGER PROGRAMMING PARIION INEGER PROGRAMMING KNAPSACK BIN-PACKING All of these problems (any many more) poly-time reduce to -SA. KNAPSACK BIN-PACKING all of these problems are NP-complete; they are manifestations of the same really hard problem 59 60
16 Summary Reductions are important in theory to: Establish tractability. Establish intractability. Classify problems according to their computational requirements. Reductions are important in practice to: Design algorithms. Design reusable software modules. - stack, queue, sorting, priority queue, symbol table, set, - graph, shortest path, regular expression Determine difficulty of your problem and choose the right tool. - use exact algorithm for tractable problems - use heuristics for intractable problems 61
Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.
Desiderata Reductions Desiderata. Classify problems according to their computational requirements. Frustrating news. Huge number of fundamental problems have defied classification for decades. Desiderata'.
More informationAlgorithms. Algorithms 6.5 REDUCTIONS. introduction designing algorithms establishing lower bounds classifying problems intractability
Algorithms ROBERT SEDGEWICK KEVIN WAYNE 6.5 REDUCTIONS Algorithms F O U R T H E D I T I O N ROBERT SEDGEWICK KEVIN WAYNE introduction designing algorithms establishing lower bounds classifying problems
More information8.1 Polynomial-Time Reductions
8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.
More informationChapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.
More information! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.
Algorithm Design Patterns and Anti-Patterns Chapter 8 NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic
More information8.1 Polynomial-Time Reductions
Algorithm Design Patterns and Anti-Patterns Analysis of Algorithms Algorithm design patterns. Ex. Greed. O(n 2 ) Dijkstra s SSSP (dense) Divide-and-conquer. O(n log n) FFT. Dynamic programming. O(n 2 )
More information! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.
Algorithm Design Patterns and Anti-Patterns 8. NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic programming.
More informationCS 580: Algorithm Design and Analysis
CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Homework 4: Due tomorrow (March 9) at 11:59 PM Recap Linear Programming Very Powerful Technique (Subject of Entire Courses)
More information3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability
Algorithm Design Patterns and Anti-Patterns CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Algorithm design patterns. Ex. Greedy. O(n log n) interval scheduling. Divide-and-conquer.
More information1 Definition of Reduction
1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem
More informationUnit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.
: Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity
More informationNP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.
CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT
More informationCopyright 2000, Kevin Wayne 1
Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple
More informationNP and computational intractability. Kleinberg and Tardos, chapter 8
NP and computational intractability Kleinberg and Tardos, chapter 8 1 Major Transition So far we have studied certain algorithmic patterns Greedy, Divide and conquer, Dynamic programming to develop efficient
More informationCS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018
CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved.
More information11. APPROXIMATION ALGORITHMS
11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: vertex cover LP rounding: vertex cover generalized load balancing knapsack problem Lecture slides by Kevin Wayne Copyright 2005
More informationBest known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices
Hard Problems Euler-Tour Problem Undirected graph G=(V,E) An Euler Tour is a path where every edge appears exactly once. The Euler-Tour Problem: does graph G have an Euler Path? Answerable in O(E) time.
More informationNP-Completeness. Algorithms
NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient
More informationApproximation Algorithms
Approximation Algorithms Given an NP-hard problem, what should be done? Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one of three desired features. Solve problem to optimality.
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory Other NP-Complete Problems Haniel Barbosa Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Sections 7.4 and 7.5. The 3SAT
More informationP and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang
P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Efficient Algorithms So far, we have developed algorithms for finding shortest paths in graphs, minimum spanning trees in
More informationTheorem 2.9: nearest addition algorithm
There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used
More informationReductions and Satisfiability
Reductions and Satisfiability 1 Polynomial-Time Reductions reformulating problems reformulating a problem in polynomial time independent set and vertex cover reducing vertex cover to set cover 2 The Satisfiability
More informationP and NP (Millenium problem)
CMPS 2200 Fall 2017 P and NP (Millenium problem) Carola Wenk Slides courtesy of Piotr Indyk with additions by Carola Wenk CMPS 2200 Introduction to Algorithms 1 We have seen so far Algorithms for various
More informationSteven Skiena. skiena
Lecture 22: Introduction to NP-completeness (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Among n people,
More informationP and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang
P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang Efficient Algorithms So far, we have developed algorithms for finding shortest paths in graphs, minimum spanning trees
More informationChapter 8. NP-complete problems
Chapter 8. NP-complete problems Search problems E cient algorithms We have developed algorithms for I I I I I finding shortest paths in graphs, minimum spanning trees in graphs, matchings in bipartite
More informationExample of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT
20170926 CNF-SAT: CNF-SAT is a problem in NP, defined as follows: Let E be a Boolean expression with m clauses and n literals (literals = variables, possibly negated), in which - each clause contains only
More information6. Lecture notes on matroid intersection
Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm
More informationChapter 10 Part 1: Reduction
//06 Polynomial-Time Reduction Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Chapter 0 Part : Reduction Reduction. Problem X
More informationDiscrete Optimization. Lecture Notes 2
Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The
More information11. APPROXIMATION ALGORITHMS
Coping with NP-completeness 11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: weighted vertex cover LP rounding: weighted vertex cover generalized load balancing knapsack problem
More informationIntroduction to Algorithms. Lecture 24. Prof. Patrick Jaillet
6.006- Introduction to Algorithms Lecture 24 Prof. Patrick Jaillet Outline Decision vs optimization problems P, NP, co-np Reductions between problems NP-complete problems Beyond NP-completeness Readings
More informationNP-complete Reductions
NP-complete Reductions 1. Prove that 3SAT P DOUBLE-SAT, i.e., show DOUBLE-SAT is NP-complete by reduction from 3SAT. The 3-SAT problem consists of a conjunction of clauses over n Boolean variables, where
More information6.006 Introduction to Algorithms. Lecture 25: Complexity Prof. Erik Demaine
6.006 Introduction to Algorithms Lecture 25: Complexity Prof. Erik Demaine Today Reductions between problems Decision vs. optimization problems Complexity classes P, NP, co NP, PSPACE, EXPTIME, NP completeness
More informationW[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017
1 W[1]-hardness Dániel Marx Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017 2 Lower bounds So far we have seen positive results: basic algorithmic techniques for fixed-parameter
More informationCS 580: Algorithm Design and Analysis
CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Midterm 2 on April 4 th at 8PM (MATH 175) Practice Midterm Released Soon 3x5 Index Card (Double Sided) Midterm 2 When?
More informationComputational problems. Lecture 2: Combinatorial search and optimisation problems. Computational problems. Examples. Example
Lecture 2: Combinatorial search and optimisation problems Different types of computational problems Examples of computational problems Relationships between problems Computational properties of different
More informationAlgorithms. Algorithms 1.4 ANALYSIS OF ALGORITHMS
ROBERT SEDGEWICK KEVIN WAYNE Algorithms ROBERT SEDGEWICK KEVIN WAYNE 1.4 ANALYSIS OF ALGORITHMS Algorithms F O U R T H E D I T I O N http://algs4.cs.princeton.edu introduction observations mathematical
More informationCMPSCI611: The SUBSET-SUM Problem Lecture 18
CMPSCI611: The SUBSET-SUM Problem Lecture 18 We begin today with the problem we didn t get to at the end of last lecture the SUBSET-SUM problem, which we also saw back in Lecture 8. The input to SUBSET-
More information10. EXTENDING TRACTABILITY
0. EXTENDING TRACTABILITY finding small vertex covers solving NP-hard problems on trees circular arc coverings vertex cover in bipartite graphs Lecture slides by Kevin Wayne Copyright 005 Pearson-Addison
More informationLecture 24: More Reductions (1997) Steven Skiena. skiena
Lecture 24: More Reductions (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that subgraph isomorphism
More informationSome Hardness Proofs
Some Hardness Proofs Magnus Lie Hetland January 2011 This is a very brief overview of some well-known hard (NP Hard and NP complete) problems, and the main ideas behind their hardness proofs. The document
More informationNP-Complete Reductions 2
x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete
More informationCS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36
CS 473: Algorithms Ruta Mehta University of Illinois, Urbana-Champaign Spring 2018 Ruta (UIUC) CS473 1 Spring 2018 1 / 36 CS 473: Algorithms, Spring 2018 LP Duality Lecture 20 April 3, 2018 Some of the
More informationChapter 9 Graph Algorithms
Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures 3 Definitions an undirected graph G = (V, E) is a
More information8 NP-complete problem Hard problems: demo
Ch8 NPC Millennium Prize Problems http://en.wikipedia.org/wiki/millennium_prize_problems 8 NP-complete problem Hard problems: demo NP-hard (Non-deterministic Polynomial-time hard), in computational complexity
More informationCSE 417 Network Flows (pt 4) Min Cost Flows
CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it
More information5. DIVIDE AND CONQUER I
5. DIVIDE AND CONQUER I mergesort counting inversions closest pair of points randomized quicksort median and selection Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013
More informationTreewidth and graph minors
Treewidth and graph minors Lectures 9 and 10, December 29, 2011, January 5, 2012 We shall touch upon the theory of Graph Minors by Robertson and Seymour. This theory gives a very general condition under
More informationIntroduction to Algorithms
Introduction to Algorithms 6.046J/18.401 Lecture 21 Prof. Piotr Indyk P vs NP (interconnectedness of all things) A whole course by itself We ll do just two lectures More in 6.045, 6.840J, etc. Introduction
More informationChapter 9 Graph Algorithms
Introduction graph theory useful in practice represent many real-life problems can be if not careful with data structures Chapter 9 Graph s 2 Definitions Definitions an undirected graph is a finite set
More informationChapter 9 Graph Algorithms
Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 3 Definitions an undirected graph G = (V, E)
More informationVertex Cover Approximations
CS124 Lecture 20 Heuristics can be useful in practice, but sometimes we would like to have guarantees. Approximation algorithms give guarantees. It is worth keeping in mind that sometimes approximation
More information11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions
Introduction Chapter 9 Graph Algorithms graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 2 Definitions an undirected graph G = (V, E) is
More informationMonotone Paths in Geometric Triangulations
Monotone Paths in Geometric Triangulations Adrian Dumitrescu Ritankar Mandal Csaba D. Tóth November 19, 2017 Abstract (I) We prove that the (maximum) number of monotone paths in a geometric triangulation
More informationRecitation 4: Elimination algorithm, reconstituted graph, triangulation
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation 4: Elimination algorithm, reconstituted graph, triangulation
More informationCopyright 2000, Kevin Wayne 1
Linear Time: O(n) CS 580: Algorithm Design and Analysis 2.4 A Survey of Common Running Times Merge. Combine two sorted lists A = a 1,a 2,,a n with B = b 1,b 2,,b n into sorted whole. Jeremiah Blocki Purdue
More information10. EXTENDING TRACTABILITY
0. EXTENDING TRACTABILITY finding small vertex covers solving NP-hard problems on trees circular arc coverings vertex cover in bipartite graphs Lecture slides by Kevin Wayne Copyright 005 Pearson-Addison
More informationParameterized Reductions
1 Fine-Grained Complexity and Algorithm Design Boot Camp Parameterized Reductions Dániel Marx Institute for Computer Science and Control, Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary Simons
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can
More informationAlgorithm Design and Analysis
Algorithm Design and Analysis LECTURE 29 Approximation Algorithms Load Balancing Weighted Vertex Cover Reminder: Fill out SRTEs online Don t forget to click submit Sofya Raskhodnikova 12/7/2016 Approximation
More informationLecture 21: Other Reductions Steven Skiena
Lecture 21: Other Reductions Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.stonybrook.edu/ skiena Problem of the Day Show that the dense
More information1 Inference for Boolean theories
Scribe notes on the class discussion on consistency methods for boolean theories, row convex constraints and linear inequalities (Section 8.3 to 8.6) Speaker: Eric Moss Scribe: Anagh Lal Corrector: Chen
More informationConnected Components of Underlying Graphs of Halving Lines
arxiv:1304.5658v1 [math.co] 20 Apr 2013 Connected Components of Underlying Graphs of Halving Lines Tanya Khovanova MIT November 5, 2018 Abstract Dai Yang MIT In this paper we discuss the connected components
More informationBMO Round 1 Problem 6 Solutions
BMO 2005 2006 Round 1 Problem 6 Solutions Joseph Myers November 2005 Introduction Problem 6 is: 6. Let T be a set of 2005 coplanar points with no three collinear. Show that, for any of the 2005 points,
More information8 Matroid Intersection
8 Matroid Intersection 8.1 Definition and examples 8.2 Matroid Intersection Algorithm 8.1 Definitions Given two matroids M 1 = (X, I 1 ) and M 2 = (X, I 2 ) on the same set X, their intersection is M 1
More informationExercises Computational Complexity
Exercises Computational Complexity March 22, 2017 Exercises marked with a are more difficult. 1 Chapter 7, P and NP Exercise 1. Suppose some pancakes are stacked on a surface such that no two pancakes
More information11. APPROXIMATION ALGORITHMS
11. APPROXIMATION ALGORITHMS load balancing center selection pricing method: vertex cover LP rounding: vertex cover generalized load balancing knapsack problem Lecture slides by Kevin Wayne Copyright 2005
More informationreductions Nathan
L25 reductions 4102 11.21.2013 Nathan 1 a new technique for algorithm design 2 MergeSort(n) MergeSort(n/2) MergeSort(n/2) Merge(left,right) 3 MergeSort(n)
More informationFINAL EXAM SOLUTIONS
COMP/MATH 3804 Design and Analysis of Algorithms I Fall 2015 FINAL EXAM SOLUTIONS Question 1 (12%). Modify Euclid s algorithm as follows. function Newclid(a,b) if a
More informationACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms
1. Computability, Complexity and Algorithms Given a simple directed graph G = (V, E), a cycle cover is a set of vertex-disjoint directed cycles that cover all vertices of the graph. 1. Show that there
More informationLecture 7: Counting classes
princeton university cos 522: computational complexity Lecture 7: Counting classes Lecturer: Sanjeev Arora Scribe:Manoj First we define a few interesting problems: Given a boolean function φ, #SAT is the
More information9.1 Cook-Levin Theorem
CS787: Advanced Algorithms Scribe: Shijin Kong and David Malec Lecturer: Shuchi Chawla Topic: NP-Completeness, Approximation Algorithms Date: 10/1/2007 As we ve already seen in the preceding lecture, two
More informationApproximation Algorithms
Approximation Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A 4 credit unit course Part of Theoretical Computer Science courses at the Laboratory of Mathematics There will be 4 hours
More informationW[1]-hardness. Dániel Marx 1. Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary
W[1]-hardness Dániel Marx 1 1 Institute for Computer Science and Control, Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary School on Parameterized Algorithms and Complexity Będlewo, Poland
More informationFoundations of Computing
Foundations of Computing Darmstadt University of Technology Dept. Computer Science Winter Term 2005 / 2006 Copyright c 2004 by Matthias Müller-Hannemann and Karsten Weihe All rights reserved http://www.algo.informatik.tu-darmstadt.de/
More informationLecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29
Lecture 13 Connectedness in graphs Spanning trees in graphs Finding a minimal spanning tree Time costs of graph problems and NP-completeness Finding a minimal spanning tree: Prim s and Kruskal s algorithms
More information6.890 Lecture 21 Scribe Notes
6.890 Lecture 21 Scribe Notes 1 3SUM motivation Throughout this class, we have categorized problems based on whether they were solvable in polynomial time or not. However, it would also be nice to know
More informationGreedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.
Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,
More informationCS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi
CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I Instructor: Shaddin Dughmi Announcements Posted solutions to HW1 Today: Combinatorial problems
More informationNP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]
NP Completeness Andreas Klappenecker [partially based on slides by Jennifer Welch] Overview We already know the following examples of NPC problems: SAT 3SAT We are going to show that the following are
More informationThe Touring Polygons Problem (TPP)
The Touring Polygons Problem (TPP) [Dror-Efrat-Lubiw-M]: Given a sequence of k polygons in the plane, a start point s, and a target point, t, we seek a shortest path that starts at s, visits in order each
More informationDecision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.
Decision Problems Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Definition: The class of problems that can be solved by polynomial-time
More informationLecture 21: Other Reductions Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY
Lecture 21: Other Reductions Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day Show that the Dense
More informationW4231: Analysis of Algorithms
W4231: Analysis of Algorithms 11/23/99 NP-completeness of 3SAT, Minimum Vertex Cover, Maximum Independent Set, Boolean Formulae A Boolean formula is an expression that we can build starting from Boolean
More informationModule 6 NP-Complete Problems and Heuristics
Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu P, NP-Problems Class
More informationOn the Rectangle Escape Problem
CCCG 2013, Waterloo, Ontario, August 8 10, 2013 On the Rectangle Escape Problem Sepehr Assadi Ehsan Emamjomeh-Zadeh Sadra Yazdanbod Hamid Zarrabi-Zadeh Abstract Motivated by a PCB routing application,
More informationPebble Sets in Convex Polygons
2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon
More informationCS521 \ Notes for the Final Exam
CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )
More informationComputational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm
GEOMETRY COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Computational
More informationInterleaving Schemes on Circulant Graphs with Two Offsets
Interleaving Schemes on Circulant raphs with Two Offsets Aleksandrs Slivkins Department of Computer Science Cornell University Ithaca, NY 14853 slivkins@cs.cornell.edu Jehoshua Bruck Department of Electrical
More information6c Lecture 3 & 4: April 8 & 10, 2014
6c Lecture 3 & 4: April 8 & 10, 2014 3.1 Graphs and trees We begin by recalling some basic definitions from graph theory. Definition 3.1. A (undirected, simple) graph consists of a set of vertices V and
More informationCS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 25: Review and Open Problems Course Overview Programming Concepts Object-Oriented Programming Interfaces
More informationThe Parameterized Complexity of Finding Point Sets with Hereditary Properties
The Parameterized Complexity of Finding Point Sets with Hereditary Properties David Eppstein University of California, Irvine Daniel Lokshtanov University of Bergen University of California, Santa Barbara
More informationBoolean Functions (Formulas) and Propositional Logic
EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving Part I: Basics Sanjit A. Seshia EECS, UC Berkeley Boolean Functions (Formulas) and Propositional Logic Variables: x 1, x 2, x 3,, x
More informationNotes for Lecture 24
U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined
More information2017 SOLUTIONS (PRELIMINARY VERSION)
SIMON MARAIS MATHEMATICS COMPETITION 07 SOLUTIONS (PRELIMINARY VERSION) This document will be updated to include alternative solutions provided by contestants, after the competition has been mared. Problem
More information(p 300) Theorem 7.27 SAT is in P iff P=NP
pp. 292-311. The Class NP-Complete (Sec. 7.4) P = {L L decidable in poly time} NP = {L L verifiable in poly time} Certainly all P is in NP Unknown if NP is bigger than P (p. 299) NP-Complete = subset of
More informationLecture 2: NP-Completeness
NP and Latin Squares Instructor: Padraic Bartlett Lecture 2: NP-Completeness Week 4 Mathcamp 2014 In our last class, we introduced the complexity classes P and NP. To motivate why we grouped all of NP
More information