David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions.

Slides:



Advertisements
Similar presentations
CS 332: Algorithms NP Completeness David Luebke /2/2017.
Advertisements

Limitation of Computation Power – P, NP, and NP-complete
Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Polynomial-time reductions We have seen several reductions:
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
NP and NP Complete. Definitions A problem is in the class P if there is a polynomial time solution to the problem A problem is in the class NP if there.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Combinatorial Algorithms
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computational problems, algorithms, runtime, hardness
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
P, NP, and NP-Complete Suzan Köknar-Tezel.
NP Complete: The Exciting Conclusion Review For Final
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Approximation Algorithms
CSC 413/513: Intro to Algorithms NP Completeness.
Prof. Mario Pavone Computazione Naturale CdL Magistrale in Informatica SDAI – DMI – UniCt Teoria.
Polynomial-time reductions We have seen several reductions:
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Unit 9: Coping with NP-Completeness
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
David Luebke 1 1/14/2016 CS 332: Algorithms NP Completeness.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Computational Complexity Shirley Moore CS4390/5390 Fall 2013 August 27, 2013.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
NP Completeness Continued: Reductions
NP-completeness Ch.34.
P & NP.
Review: Reduction A problem A can be reduced to another problem B if any instance of A can be rephrased to an instance of B, the solution to which provides.
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Presentation transcript:

David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions

David Luebke 2 2/18/2016 Homework 7 ● Check the web later today… ■ Change in grading policy: drop lowest hw

David Luebke 3 2/18/2016 Review: P And NP Summary ● P = set of problems that can be solved in polynomial time ● NP = set of problems for which a solution can be verified in polynomial time ● P  NP ● Open question: Does P = NP?

David Luebke 4 2/18/2016 Review: Reduction ● A problem P can be reduced to another problem Q if any instance of P can be rephrased to an instance of Q, the solution to which provides a solution to the instance of P ■ This rephrasing is called a transformation ● Intuitively: If P reduces in polynomial time to Q, P is “no harder to solve” than Q

David Luebke 5 2/18/2016 Review: NP-Hard and NP-Complete ● If P is polynomial-time reducible to Q, we denote this P  p Q ● Definition of NP-Hard and NP-Complete: ■ If all problems R  NP are reducible to P, then P is NP-Hard ■ We say P is NP-Complete if P is NP-Hard and P  NP ● If P  p Q and P is NP-Complete, Q is also NP- Complete

David Luebke 6 2/18/2016 Review: Proving NP-Completeness ● What steps do we have to take to prove a problem Q is NP-Complete? ■ Pick a known NP-Complete problem P ■ Reduce P to Q ○ Describe a transformation that maps instances of P to instances of Q, s.t. “yes” for Q = “yes” for P ○ Prove the transformation works ○ Prove it runs in polynomial time ■ Oh yeah, prove Q  NP (What if you can’t?)

David Luebke 7 2/18/2016 Directed Hamiltonian Cycle  Undirected Hamiltonian Cycle ● What was the hamiltonian cycle problem again? ● For my next trick, I will reduce the directed hamiltonian cycle problem to the undirected hamiltonian cycle problem before your eyes ■ Which variant am I proving NP-Complete? ● Draw a directed example on the board ■ What transformation do I need to effect?

David Luebke 8 2/18/2016 Transformation: Directed  Undirected Ham. Cycle ● Transform graph G = (V, E) into G’ = (V’, E’): ■ Every vertex v in V transforms into 3 vertices v 1, v 2, v 3 in V’ with edges (v 1,v 2 ) and (v 2,v 3 ) in E’ ■ Every directed edge (v, w) in E transforms into the undirected edge (v 3, w 1 ) in E’ (draw it) ■ Can this be implemented in polynomial time? ■ Argue that a directed hamiltonian cycle in G implies an undirected hamiltonian cycle in G’ ■ Argue that an undirected hamiltonian cycle in G’ implies a directed hamiltonian cycle in G

David Luebke 9 2/18/2016 Undirected Hamiltonian Cycle ● Thus we can reduce the directed problem to the undirected problem ● What’s left to prove the undirected hamiltonian cycle problem NP-Complete? ● Argue that the problem is in NP

David Luebke 10 2/18/2016 Hamiltonian Cycle  TSP ● The well-known traveling salesman problem: ■ Optimization variant: a salesman must travel to n cities, visiting each city exactly once and finishing where he begins. How to minimize travel time? ■ Model as complete graph with cost c(i,j) to go from city i to city j ● How would we turn this into a decision problem? ■ A: ask if  a TSP with cost < k

David Luebke 11 2/18/2016 Hamiltonian Cycle  TSP ● The steps to prove TSP is NP-Complete: ■ Prove that TSP  NP (Argue this) ■ Reduce the undirected hamiltonian cycle problem to the TSP ○ So if we had a TSP-solver, we could use it to solve the hamilitonian cycle problem in polynomial time ○ How can we transform an instance of the hamiltonian cycle problem to an instance of the TSP? ○ Can we do this in polynomial time?

David Luebke 12 2/18/2016 The TSP ● Random asides: ■ TSPs (and variants) have enormous practical importance ○ E.g., for shipping and freighting companies ○ Lots of research into good approximation algorithms ■ Recently made famous as a DNA computing problem