Graph Theory and Optimization Computational Complexity (in brief)
|
|
- Kerry Taylor
- 5 years ago
- Views:
Transcription
1 Graph Theory and Optimization Computational Complexity (in brief) Nicolas Nisse Inria, France Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, Sophia Antipolis, France September 2015 N. Nisse Graph Theory and applications 1/1
2 Outline N. Nisse Graph Theory and applications 2/1
3 Time-Complexity Decision Problem Input: Instance I Problem: does I satisfiy Property P? Output: solution {Yes, No} very brief introduction ex: Is graph G connected? Does G admit a s,d-flow of value k?... How to evaluate if: 1 a Problem P is difficult" or easy"? 2 an algorithm for solving P is efficient or not? (classical) Time-complexity of an algorithm A for solving P Number of elementary operations of A as a function of the size n of the instance running time in the worst case Definitions of elementary operations and size depend on: Context, Data Structure, Units of measure... N. Nisse Graph Theory and applications 3/1
4 Time-Complexity very brief introduction Assume that Algorithm A has time-complexity f(n): in the worst case, A executes f(n) operations on an instance of size N For which size of instances is your problem feasible? Assume operations (e.g., addition of 2 integers on 64 bits) per second (it is more than current desktops) Complexity f(n) maximum size N Θ(N) Θ(N logn) Θ(N 2 ) Θ(N 3 ) 4600 Θ(N 4 ) 560 Θ(2 N ) 36 Θ(N!) 13 Table: Approximation of maximum size to obtain an answer in 10 seconds Problems solvable by an algorithm with polynomial running time are easy" N. Nisse Graph Theory and applications 3/1
5 Some polynomial problems Some examples you may know: Sorting n integers: Θ(n log n) heap sort, merge sort Multiplying two n n matrices: O(n ) [Le Gall, 2014] Decide if m-edge graph is connected: O(m) Compute a shortest path in n-node m-edge graph: O(m + n logn) Compute min. spanning tree in m-edge graph: O(m log m) BFS [Dijkstra] [Kruskal...] max. flow and min. cut in n-node m-edge graph and max capacity c max : O(mnc max ) [Ford-Fulkerson] Maximum matching in n-node graph: O(n 4 ) [Edmonds 1965] O(mn 2 ) [Micali, Vazirani, 1980] All these problems can be solved in time polynomial in the size of the input generally", they are said easy" N. Nisse Graph Theory and applications 4/1
6 Complexity Hierarchy (very informal and partial description) EXPTIME problems solvable in Exponential Time P problems solvable in Polynomial Time EXPTIME: set of the (decision) problems solvable in exponential-time P: set of the (decision) problems solvable in polynomial-time P EXPTIME N. Nisse Graph Theory and applications 5/1
7 Complexity Hierarchy (very informal and partial description) EXPTIME problems solvable in Exponential Time NP problems whose solutions can be checked in Polynomial Time i.e., solvable by polynomial-time non-deterministic Tü ring machine P problems solvable in Polynomial Time Non-deterministic Polynomial (NP): problems that can be solved in polynomial-time by a Non-deterministic Türing machine P NP Equivalently, a solution can be checked in polynomial-time N. Nisse Graph Theory and applications 5/1
8 Complexity Hierarchy (very informal and partial description) EXPTIME problems solvable in Exponential Time NP problems whose solutions can be checked in Polynomial Time NP-hard Problems "as hard as the hardest problems in NP" i.e., solvable by polynomial-time non-deterministic Tü ring machine P problems solvable in Polynomial Time NP-hard: problems that are as difficult" as the hardest" problems in NP Solving one of them in polynomial-time would prove that P = NP N. Nisse Graph Theory and applications 5/1
9 Complexity Hierarchy (very informal and partial description) EXPTIME problems solvable in Exponential Time NP problems whose solutions can be checked in Polynomial Time i.e., solvable by polynomial-time non-deterministic Tü ring machine NP-complete= NP NP-hard NP-hard Problems "as hard as the hardest problems in NP" P problems solvable in Polynomial Time NP-hard: problems that are as difficult" as the hardest" problems in NP NP-complete = NP-hard NP N. Nisse Graph Theory and applications 5/1
10 Complexity Hierarchy (very informal and partial description) EXPTIME problems solvable in Exponential Time NP problems whose solutions can be checked in Polynomial Time i.e., solvable by polynomial-time non-deterministic Tü ring machine NP-complete= NP NP-hard NP-hard Problems "as hard as the hardest problems in NP" P problems solvable in Polynomial Time NP-hard problems: we do not know if they can be solved in polynomial-time Roughly, best existing (known) algorithms (generally) enumerate all possible solutions and take a best one N. Nisse Graph Theory and applications 5/1
11 Outline N. Nisse Graph Theory and applications 6/1
12 Famous NP-complete problems 3-SAT SAT = Satisfiability 3-SAT is NP-complete Cook-Levin Theorem (1971) 3-SAT: Given 3-CNF formula Φ(v 1,,v n ) on n Boolean variables? a Boolean assignment a : {v 1,,v n } {0,1} that satisfies Φ? 3-CNF = Conjunctive Normal Form, i.e., conjunction of clauses, where a clause is a disjunction of 3 literals. Ex: Φ(a,b,c,d,e) = (a b c) (ē b c) (ā c e) here, the assignment (a,b,c,d,e) = (1,1,0,0,1) satisfies Φ. example of algorithm for 3-SAT Try all the 2 n possible assignments Remarks: 3-SAT is the first problem to be proved NP-hard. It is often used to prove that other problems are NP-hard. N. Nisse Graph Theory and applications 7/1
13 Famous NP-complete problems 3-SAT SAT = Satisfiability 3-SAT is NP-complete Cook-Levin Theorem (1971) 3-SAT: Given 3-CNF formula Φ(v 1,,v n ) on n Boolean variables? a Boolean assignment a : {v 1,,v n } {0,1} that satisfies Φ? 3-CNF = Conjunctive Normal Form, i.e., conjunction of clauses, where a clause is a disjunction of 3 literals. Ex: Φ(a,b,c,d,e) = (a b c) (ē b c) (ā c e) here, the assignment (a,b,c,d,e) = (1,1,0,0,1) satisfies Φ. example of algorithm for 3-SAT Try all the 2 n possible assignments Remarks: 3-SAT is the first problem to be proved NP-hard. It is often used to prove that other problems are NP-hard. N. Nisse Graph Theory and applications 7/1
14 Outline N. Nisse Graph Theory and applications 8/1
15 Famous NP-c problems Hamiltonian Path: a spanning path P in a graph G Hamiltonian Cycle: a spanning cycle C in G Hamiltonian Path/Cycle is NP-complete Hamiltonian Path/Cycle [Garey, Johnson] Hamiltonian path/cycle: Given a graph G = (V,E) with n vertices,? an Hamiltonian path/cycle in G? a b e a b e d d c c f g h f g h j j i i Application: Travelling Salesman Problem (TSP): want to visit all cities, minimizing the distance he has to cross Exercice: show that the right graph has no Hamiltonian cycle. N. Nisse Graph Theory and applications 9/1
16 Famous NP-c problems Hamiltonian Path/Cycle Hamiltonian Path: a spanning path P in a graph G Hamiltonian Cycle: a spanning cycle C in G Hamiltonian Path/Cycle is NP-complete [Garey, Johnson] Hamiltonian path/cycle: Given a graph G = (V,E) with n vertices,? an Hamiltonian path/cycle in G? Ex of algorithm: Try all the n! orderings of the vertices N. Nisse Graph Theory and applications 9/1
17 Famous NP-c problems Hamiltonian Path/Cycle Hamiltonian Path: a spanning path P in a graph G Hamiltonian Cycle: a spanning cycle C in G Hamiltonian Path/Cycle is NP-complete [Garey, Johnson] Hamiltonian path/cycle: Given a graph G = (V,E) with n vertices,? an Hamiltonian path/cycle in G? Ex of algorithm: Try all the n! orderings of the vertices Longest path/cycle Exercice: Let G = (V,E) be a graph and k N Prove that deciding if G has a path/cycle of length k is NP-complete N. Nisse Graph Theory and applications 9/1
18 Famous NP-c problems Hamiltonian Path/Cycle Hamiltonian Cycle: cycle that passes through each vertex (exactly once) Remark: Problems that look similar" may be very different" Tour cycle" where vertices may be repeated, but not edges. Eulerian Tour: Tour that passes through each edge (exactly once) Euler (1736) Exercice: Prove that deciding if G admits an Eulerian tour is in P hint: prove that G admits an Eulerian tour each vertex has even degree N. Nisse Graph Theory and applications 10/1
19 Outline N. Nisse Graph Theory and applications 11/1
20 Famous NP-c problems Disjoint paths (multi-flow) Exercice: Let G = (V,E) be a graph, S,D V, k N Deciding if it exists k vertex-disjoint paths from S to D is in P hint: use flow algorithm Disjoint paths is NP-complete [Garey, Johnson] disjoint paths: Given G = (V,E), {s 1,,s k } V and {d 1,,d k } V? (P 1,,P k ) pairwise vertex-disjoint paths s.t. P i path from s i to d i Remark: can be solved in time f(k)poly(n), i.e., in P if k is fixed [Robertson and Seymour, 1995] N. Nisse Graph Theory and applications 12/1
21 Famous NP-c problems Disjoint paths (multi-flow) Exercice: Let G = (V,E) be a graph, S,D V, k N Deciding if it exists k vertex-disjoint paths from S to D is in P hint: use flow algorithm Disjoint paths is NP-complete [Garey, Johnson] disjoint paths: Given G = (V,E), {s 1,,s k } V and {d 1,,d k } V? (P 1,,P k ) pairwise vertex-disjoint paths s.t. P i path from s i to d i s1 s2 s1 s2 d2 d1 d2 d1 2 disjoint paths from {s1,s2} to {d1,d2} no 2 disjoint paths from s1 to d1 and from s2 to d2 Remark: can be solved in time f(k)poly(n), i.e., in P if k is fixed N. Nisse Graph Theory and applications 12/1
22 Famous NP-c problems Disjoint paths (multi-flow) Disjoint paths is NP-complete [Garey, Johnson] disjoint paths: Given G = (V,E), {s 1,,s k } V and {d 1,,d k } V? (P 1,,P k ) pairwise vertex-disjoint paths s.t. P i path from s i to d i Remark: can be solved in time f(k)poly(n), i.e., in P if k is fixed [Robertson and Seymour, 1995] N. Nisse Graph Theory and applications 12/1
23 Outline N. Nisse Graph Theory and applications 13/1
24 Famous NP-complete problems Let G = (V,E) be a graph Coloring k-proper coloring: c : V {1,,k} s.t. c(u) c(v) for all {u,v} E. color the vertices s ( k colors) s.t. adjacent vertices receive colors Vertices = antennas {u,v} E iff transmissions of u and v overlap Color = frequency of transmission N. Nisse Graph Theory and applications 14/1
25 Famous NP-complete problems Let G = (V,E) be a graph Coloring k-proper coloring: c : V {1,,k} s.t. c(u) c(v) for all {u,v} E. color the vertices s ( k colors) s.t. adjacent vertices receive colors Vertices = antennas {u,v} E iff transmissions of u and v overlap Color = frequency of transmission with the coloring in the example: if you live in orange zone No WiFi!! N. Nisse Graph Theory and applications 14/1
26 Famous NP-complete problems Let G = (V,E) be a graph Coloring k-proper coloring: c : V {1,,k} s.t. c(u) c(v) for all {u,v} E. color the vertices s ( k colors) s.t. adjacent vertices receive colors Unproper 3-coloring (red edges) Proper 6-coloring Proper 3-coloring chromatic number χ(g): min. k such that G admits a k-proper coloring. Exercice: Show that χ(g) 2 if and only if G is bipartite. Coloring is NP-complete [Garey, Johnson] chromatic number: Given G = (V,E) be a graph, χ(g) 3? even if G is restricted to be a planar graph N. Nisse Graph Theory and applications 15/1
27 Famous NP-complete problems Let G = (V,E) be a graph Coloring k-proper coloring: c : V {1,,k} s.t. c(u) c(v) for all {u,v} E. color the vertices s ( k colors) s.t. adjacent vertices receive colors Unproper 3-coloring (red edges) Proper 6-coloring Proper 3-coloring chromatic number χ(g): min. k such that G admits a k-proper coloring. Exercice: Show that χ(g) 2 if and only if G is bipartite. Coloring is NP-complete [Garey, Johnson] chromatic number: Given G = (V,E) be a graph, χ(g) 3? even if G is restricted to be a planar graph N. Nisse Graph Theory and applications 15/1
28 Famous NP-complete problems Let G = (V,E) be a graph Coloring k-proper coloring: c : V {1,,k} s.t. c(u) c(v) for all {u,v} E. color the vertices s ( k colors) s.t. adjacent vertices receive colors Unproper 3-coloring (red edges) Proper 6-coloring Proper 3-coloring chromatic number χ(g): min. k such that G admits a k-proper coloring. Exercice: Show that χ(g) 2 if and only if G is bipartite. Coloring is NP-complete [Garey, Johnson] chromatic number: Given G = (V,E) be a graph, χ(g) 3? even if G is restricted to be a planar graph N. Nisse Graph Theory and applications 15/1
29 Outline N. Nisse Graph Theory and applications 16/1
30 Famous NP-complete problems Let G = (V,E) be a graph Vertex Cover Vertex Cover: set K V such that e E, e K /0 set of vertices that touch" every edge Application: each street must be protected by a fire station N. Nisse Graph Theory and applications 17/1
31 Famous NP-complete problems Let G = (V,E) be a graph Vertex Cover Vertex Cover: set K V such that e E, e K /0 set of vertices that touch" every edge Problem: Min. number of fire stations to protect each street? N. Nisse Graph Theory and applications 17/1
32 Famous NP-complete problems Let G = (V,E) be a graph Vertex Cover Vertex Cover: set K V such that e E, e K /0 set of vertices that touch" every edge Problem: Min. number of fire stations to protect each street? Min Vertex Cover is NP-complete [Garey, Johnson] Vertex Cover: Given G = (V,E) be a graph, k N,? K V a vertex cover of G such that K k? N. Nisse Graph Theory and applications 17/1
33 Outline N. Nisse Graph Theory and applications 18/1
34 How to actually handle NP-hard problems? NP-hard: No Polynomial-time algorithms known!!! worst case complexity vs. practice exponential-time algorithms may be efficient on practical instances Consider particular instances Problem P may be NP-complete in a set I of instances but polynomial-time solvable in I I Ex: for any bipartite graph G, κ(g) = min. vertex cover(g) = max. matching(g) = µ(g) c-approximation algorithms A : polynomial-time algorithm s.t. for any instance I, A returns a solution with value for minimization problem: OPT(I) value(a ) c OPT(I) for maximization problem: OPT(I)/c value(a ) OPT(I) Exercice: Give a 2-approximation algorithm for Vertex-Cover hint: show that, for any graph G, µ(g) κ(g) 2µ(G) N. Nisse Graph Theory and applications 19/1
35 How to actually handle NP-hard problems? NP-hard: No Polynomial-time algorithms known!!! worst case complexity vs. practice exponential-time algorithms may be efficient on practical instances Consider particular instances Problem P may be NP-complete in a set I of instances but polynomial-time solvable in I I Ex: for any bipartite graph G, κ(g) = min. vertex cover(g) = max. matching(g) = µ(g) c-approximation algorithms A : polynomial-time algorithm s.t. for any instance I, A returns a solution with value for minimization problem: OPT(I) value(a ) c OPT(I) for maximization problem: OPT(I)/c value(a ) OPT(I) Exercice: Give a 2-approximation algorithm for Vertex-Cover hint: show that, for any graph G, µ(g) κ(g) 2µ(G) N. Nisse Graph Theory and applications 19/1
36 How to actually handle NP-hard problems? NP-hard: No Polynomial-time algorithms known!!! worst case complexity vs. practice exponential-time algorithms may be efficient on practical instances Consider particular instances Problem P may be NP-complete in a set I of instances but polynomial-time solvable in I I Ex: for any bipartite graph G, κ(g) = min. vertex cover(g) = max. matching(g) = µ(g) c-approximation algorithms A : polynomial-time algorithm s.t. for any instance I, A returns a solution with value for minimization problem: OPT(I) value(a ) c OPT(I) for maximization problem: OPT(I)/c value(a ) OPT(I) Exercice: Give a 2-approximation algorithm for Vertex-Cover hint: show that, for any graph G, µ(g) κ(g) 2µ(G) N. Nisse Graph Theory and applications 19/1
37 How to actually handle NP-hard problems? NP-hard: No Polynomial-time algorithms known!!! worst case complexity vs. practice exponential-time algorithms may be efficient on practical instances Consider particular instances Problem P may be NP-complete in a set I of instances but polynomial-time solvable in I I Ex: for any bipartite graph G, κ(g) = min. vertex cover(g) = max. matching(g) = µ(g) c-approximation algorithms A : polynomial-time algorithm s.t. for any instance I, A returns a solution with value for minimization problem: OPT(I) value(a ) c OPT(I) for maximization problem: OPT(I)/c value(a ) OPT(I) Exercice: Give a 2-approximation algorithm for Vertex-Cover hint: show that, for any graph G, µ(g) κ(g) 2µ(G) N. Nisse Graph Theory and applications 19/1
38 Outline N. Nisse Graph Theory and applications 20/1
39 Some other famous NP-complete problems Max. Independent set is NP-complete Independent set: Given a graph G = (V,E), k N,? stable set S V of size k in G? Min. Feedback Vertex Set (FVS) is NP-complete FVS: Given a digraph D = (V,A), k N, Min. Set Cover is NP-complete? F V such that D \ F is acyclic? Set Cover: set E, family of subsets S = {S 1,,S l } 2 E, k N? Y S, S Y S = E, S k? Min. Hitting Set is NP-complete Hitting Set: set E, family of subsets S = {S 1,,S l } 2 E, k N? H E, H S i for any i l, H k? Partition is weakly NP-complete Partition: Given set X = {x 1,,x n } of integers,? partition (A,B) of X such that x A x = x B x? N. Nisse Graph Theory and applications 21/1
40 Summary: To be remembered P, NP, NP-hard, NP-complete 3-SAT, Hamiltonian path, Coloring, Vertex Cover,... Approximation algorithm N. Nisse Graph Theory and applications 22/1
VIII. NP-completeness
VIII. NP-completeness 1 / 15 NP-Completeness Overview 1. Introduction 2. P and NP 3. NP-complete (NPC): formal definition 4. How to prove a problem is NPC 5. How to solve a NPC problem: approximate algorithms
Polynomial-time Reductions
Polynomial-time Reductions Disclaimer: Many denitions in these slides should be taken as the intuitive meaning, as the precise meaning of some of the terms are hard to pin down without introducing the
Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9
1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives Classify problems as tractable or intractable Define decision problems Define the class P Define
Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P
Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the
Limitations of Algorithm Power
Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying
1. Introduction Recap
1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization
Polynomial-Time Reductions
Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel
CS/COE
CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct
NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20
NP-complete problems CSE 101: Design and Analysis of Algorithms Lecture 20 CSE 101: Design and analysis of algorithms NP-complete problems Reading: Chapter 8 Homework 7 is due today, 11:59 PM Tomorrow
NP and Computational Intractability
NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.
NP Completeness and Approximation Algorithms
Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic
CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1
CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY E. Amaldi Foundations of Operations Research Politecnico di Milano 1 Goal: Evaluate the computational requirements (this course s focus: time) to solve
Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.
Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA NP Completeness Susmita Sur-Kolay Advanced Computing and Microelectronics Unit
NP-Completeness. NP-Completeness 1
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and
NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University
NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with
NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and
Introduction to Complexity Theory
Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity
Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)
Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set
Correctness of Dijkstra s algorithm
Correctness of Dijkstra s algorithm Invariant: When vertex u is deleted from the priority queue, d[u] is the correct length of the shortest path from the source s to vertex u. Additionally, the value d[u]
Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms
Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds
CS 583: Algorithms. NP Completeness Ch 34. Intractability
CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working
Determine the size of an instance of the minimum spanning tree problem.
3.1 Algorithm complexity Consider two alternative algorithms A and B for solving a given problem. Suppose A is O(n 2 ) and B is O(2 n ), where n is the size of the instance. Let n A 0 be the size of the
Chapter 3. Complexity of algorithms
Chapter 3 Complexity of algorithms In this chapter, we see how problems may be classified according to their level of difficulty. Most problems that we consider in these notes are of general character,
ECS122A Handout on NP-Completeness March 12, 2018
ECS122A Handout on NP-Completeness March 12, 2018 Contents: I. Introduction II. P and NP III. NP-complete IV. How to prove a problem is NP-complete V. How to solve a NP-complete problem: approximate algorithms
Design and Analysis of Algorithms
Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some
Algorithms Design & Analysis. Approximation Algorithm
Algorithms Design & Analysis Approximation Algorithm Recap External memory model Merge sort Distribution sort 2 Today s Topics Hard problem Approximation algorithms Metric traveling salesman problem A
Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?
Admin Two more assignments No office hours on tomorrow NP-COMPLETE PROBLEMS Run-time analysis Tractable vs. intractable problems We ve spent a lot of time in this class putting algorithms into specific
NP-Completeness. Until now we have been designing algorithms for specific problems
NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower
Computational complexity theory
Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,
Complexity, P and NP
Complexity, P and NP EECS 477 Lecture 21, 11/26/2002 Last week Lower bound arguments Information theoretic (12.2) Decision trees (sorting) Adversary arguments (12.3) Maximum of an array Graph connectivity
8.5 Sequencing Problems
8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,
SAT, Coloring, Hamiltonian Cycle, TSP
1 SAT, Coloring, Hamiltonian Cycle, TSP Slides by Carl Kingsford Apr. 28, 2014 Sects. 8.2, 8.7, 8.5 2 Boolean Formulas Boolean Formulas: Variables: x 1, x 2, x 3 (can be either true or false) Terms: t
Spring Lecture 21 NP-Complete Problems
CISC 320 Introduction to Algorithms Spring 2014 Lecture 21 NP-Complete Problems 1 We discuss some hard problems: how hard? (computational complexity) what makes them hard? any solutions? Definitions Decision
Data Structures in Java
Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways
NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015
CS 374: Algorithms & Models of Computation, Spring 2015 NP Completeness Lecture 23 November 19, 2015 Chandra & Lenny (UIUC) CS374 1 Spring 2015 1 / 37 Part I NP-Completeness Chandra & Lenny (UIUC) CS374
Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?
Tractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?» Standard working definition: polynomial time» On an input
NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]
NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the
NP and Computational Intractability
NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:
Lecture 4: NP and computational intractability
Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples
NP-completeness. Chapter 34. Sergey Bereg
NP-completeness Chapter 34 Sergey Bereg Oct 2017 Examples Some problems admit polynomial time algorithms, i.e. O(n k ) running time where n is the input size. We will study a class of NP-complete problems
NP Complete Problems. COMP 215 Lecture 20
NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst
NP-Complete Problems. More reductions
NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM
2 COLORING. Given G, nd the minimum number of colors to color G. Given graph G and positive integer k, is X(G) k?
2 COLORING OPTIMIZATION PROBLEM Given G, nd the minimum number of colors to color G. (X(G)?) DECISION PROBLEM Given graph G and positive integer k, is X(G) k? EQUIVALENCE OF OPTIMAIZTION AND DE- CISION
Computational complexity theory
Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,
More NP-Complete Problems
CS 473: Algorithms, Spring 2018 More NP-Complete Problems Lecture 23 April 17, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Recap NP: languages/problems that have
Computational Complexity
Computational Complexity Algorithm performance and difficulty of problems So far we have seen problems admitting fast algorithms flow problems, shortest path, spanning tree... and other problems for which
CS 350 Algorithms and Complexity
1 CS 350 Algorithms and Complexity Fall 2015 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
NP-Complete Reductions 1
x x x 2 x 2 x 3 x 3 x 4 x 4 CS 4407 2 22 32 Algorithms 3 2 23 3 33 NP-Complete Reductions Prof. Gregory Provan Department of Computer Science University College Cork Lecture Outline x x x 2 x 2 x 3 x 3
CSC 8301 Design & Analysis of Algorithms: Lower Bounds
CSC 8301 Design & Analysis of Algorithms: Lower Bounds Professor Henry Carter Fall 2016 Recap Iterative improvement algorithms take a feasible solution and iteratively improve it until optimized Simplex
Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas
Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter 2006 NP-Completeness (Chapter 8) Given positive integers a, b, c Question 1: does there exist a positive integer x such that
NP-Completeness. Subhash Suri. May 15, 2018
NP-Completeness Subhash Suri May 15, 2018 1 Computational Intractability The classical reference for this topic is the book Computers and Intractability: A guide to the theory of NP-Completeness by Michael
Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death
Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory
CS 350 Algorithms and Complexity
CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
Automata Theory CS Complexity Theory I: Polynomial Time
Automata Theory CS411-2015-17 Complexity Theory I: Polynomial Time David Galles Department of Computer Science University of San Francisco 17-0: Tractable vs. Intractable If a problem is recursive, then
NP-Complete Problems and Approximation Algorithms
NP-Complete Problems and Approximation Algorithms Efficiency of Algorithms Algorithms that have time efficiency of O(n k ), that is polynomial of the input size, are considered to be tractable or easy
Chapter 34: NP-Completeness
Graph Algorithms - Spring 2011 Set 17. Lecturer: Huilan Chang Reference: Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. Chapter 34: NP-Completeness 2. Polynomial-time
Computational Complexity. IE 496 Lecture 6. Dr. Ted Ralphs
Computational Complexity IE 496 Lecture 6 Dr. Ted Ralphs IE496 Lecture 6 1 Reading for This Lecture N&W Sections I.5.1 and I.5.2 Wolsey Chapter 6 Kozen Lectures 21-25 IE496 Lecture 6 2 Introduction to
1.1 P, NP, and NP-complete
CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Introduction to NP-complete Problems Date: 11/01/2008 Lecturer: Lap Chi Lau Scribe: Jerry Jilin Le This lecture gives a general introduction
Graduate Algorithms CS F-21 NP & Approximation Algorithms
Graduate Algorithms CS673-2016F-21 NP & Approximation Algorithms David Galles Department of Computer Science University of San Francisco 21-0: Classes of Problems Consider three problem classes: Polynomial
Martin Milanič
1 / 75 Algorithmic Graph Theory Part I - Review of Basic Notions in Graph Theory, Algorithms and Complexity Martin Milanič martin.milanic@upr.si University of Primorska, Koper, Slovenia Dipartimento di
8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM
8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin
COMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Computational Complexity CLRS 34.1-34.4 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures 1 / 50 Polynomial
Data Structures and Algorithms
Data Structures and Algorithms Session 21. April 13, 2009 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/3137 Announcements Homework 5 due next Monday I m out of town Wed to Sun for conference
The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.
The Class NP NP is the problems that can be solved in polynomial time by a nondeterministic machine. NP The time taken by nondeterministic TM is the length of the longest branch. The collection of all
COP 4531 Complexity & Analysis of Data Structures & Algorithms
COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According
P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions
Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems
Tractable & Intractable Problems
Tractable & Intractable Problems We will be looking at : What is a P and NP problem NP-Completeness The question of whether P=NP The Traveling Salesman problem again Programming and Data Structures 1 Polynomial
Algorithms and Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005
Algorithms and Complexity Theory Chapter 8: Introduction to Complexity Jules-R Tapamo Computer Science - Durban - September 2005 Contents 1 Introduction 2 1.1 Dynamic programming...................................
/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 20.1 Introduction Definition 20.1.1 We say that an algorithm runs in polynomial time if its running
CS 6505, Complexity and Algorithms Week 7: NP Completeness
CS 6505, Complexity and Algorithms Week 7: NP Completeness Reductions We have seen some problems in P and NP, and we ve talked about space complexity. The Space Hierarchy Theorem showed us that there are
Theory of Computation Chapter 1: Introduction
Theory of Computation Chapter 1: Introduction Guan-Shieng Huang Sep. 20, 2006 Feb. 9, 2009 0-0 Text Book Computational Complexity, by C. H. Papadimitriou, Addison-Wesley, 1994. 1 References Garey, M.R.
NP-problems continued
NP-problems continued Page 1 Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity.
Computational Complexity
p. 1/24 Computational Complexity The most sharp distinction in the theory of computation is between computable and noncomputable functions; that is, between possible and impossible. From the example of
NP-Complete problems
NP-Complete problems NP-complete problems (NPC): A subset of NP. If any NP-complete problem can be solved in polynomial time, then every problem in NP has a polynomial time solution. NP-complete languages
CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010
CS311 Computational Structures NP-completeness Lecture 18 Andrew P. Black Andrew Tolmach 1 Some complexity classes P = Decidable in polynomial time on deterministic TM ( tractable ) NP = Decidable in polynomial
Chapter 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 8.5 Sequencing Problems Basic genres.! Packing problems: SET-PACKING,
Chapter 3: Proving NP-completeness Results
Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises 1.1 Six Basic NP-Complete Problems 3-SATISFIABILITY (3SAT)
8.5 Sequencing Problems. Chapter 8. NP and Computational Intractability. Hamiltonian Cycle. Hamiltonian Cycle
Chapter 8 NP and Computational Intractability 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems:
Preliminaries and Complexity Theory
Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra
CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle
8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,
Formal definition of P
Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity. In SAT we want to know if
Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness
Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harry Lewis November 19, 2013 Reading: Sipser 7.4, 7.5. For culture : Computers and Intractability: A Guide to the Theory
Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}
Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)
Chapter 8. NP and Computational Intractability
Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Acknowledgement: This lecture slide is revised and authorized from Prof.
Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas
CSE 417 Introduction to Algorithms Winter 2007 Some Algebra Problems (Algorithmic) Given positive integers a, b, c Question 1: does there exist a positive integer x such that ax = c? NP-Completeness (Chapter
Show that the following problems are NP-complete
Show that the following problems are NP-complete April 7, 2018 Below is a list of 30 exercises in which you are asked to prove that some problem is NP-complete. The goal is to better understand the theory
Polynomial-time reductions. We have seen several reductions:
Polynomial-time reductions We have seen several reductions: Polynomial-time reductions Informal explanation of reductions: We have two problems, X and Y. Suppose we have a black-box solving problem X in
Computational Complexity
Computational Complexity Problems, instances and algorithms Running time vs. computational complexity General description of the theory of NP-completeness Problem samples 1 Computational Complexity What
Algorithms: COMP3121/3821/9101/9801
NEW SOUTH WALES Algorithms: COMP3121/3821/9101/9801 Aleks Ignjatović School of Computer Science and Engineering University of New South Wales LECTURE 9: INTRACTABILITY COMP3121/3821/9101/9801 1 / 29 Feasibility
NP-Completeness. Algorithmique Fall semester 2011/12
NP-Completeness Algorithmique Fall semester 2011/12 1 What is an Algorithm? We haven t really answered this question in this course. Informally, an algorithm is a step-by-step procedure for computing a
Non-Deterministic Time
Non-Deterministic Time Master Informatique 2016 1 Non-Deterministic Time Complexity Classes Reminder on DTM vs NDTM [Turing 1936] (q 0, x 0 ) (q 1, x 1 ) Deterministic (q n, x n ) Non-Deterministic (q
P, NP, NP-Complete. Ruth Anderson
P, NP, NP-Complete Ruth Anderson A Few Problems: Euler Circuits Hamiltonian Circuits Intractability: P and NP NP-Complete What now? Today s Agenda 2 Try it! Which of these can you draw (trace all edges)
Combinatorial Optimization
Combinatorial Optimization Problem set 8: solutions 1. Fix constants a R and b > 1. For n N, let f(n) = n a and g(n) = b n. Prove that f(n) = o ( g(n) ). Solution. First we observe that g(n) 0 for all
Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler
Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard
Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.
Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität
Unit 1A: Computational Complexity
Unit 1A: Computational Complexity Course contents: Computational complexity NP-completeness Algorithmic Paradigms Readings Chapters 3, 4, and 5 Unit 1A 1 O: Upper Bounding Function Def: f(n)= O(g(n)) if
Algorithm Design and Analysis
Algorithm Design and Analysis LECTURE 26 Computational Intractability Polynomial Time Reductions Sofya Raskhodnikova S. Raskhodnikova; based on slides by A. Smith and K. Wayne L26.1 What algorithms are
CSC 1700 Analysis of Algorithms: P and NP Problems
CSC 1700 Analysis of Algorithms: P and NP Problems Professor Henry Carter Fall 2016 Recap Algorithmic power is broad but limited Lower bounds determine whether an algorithm can be improved by more than
NP-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