NP-Complete Problems

Similar documents
NP-Complete Chapter 8

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Module 6 NP-Complete Problems and Heuristics

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Chapter 9 Graph Algorithms

NP-complete Reductions

Chapter 9 Graph Algorithms

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Chapter 9 Graph Algorithms

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang

Theorem 2.9: nearest addition algorithm

Practice Final Exam 1

P = NP; P NP. Intuition of the reduction idea:

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

Notes for Lecture 24

6,8:15. MA/CSSE 473 Day 37. Student Questions. Kruskal data structures. Disjoint Set ADT. Complexity intro

Lecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29

CS 4407 Algorithms. Lecture 8: Circumventing Intractability, using Approximation and other Techniques

Partha Sarathi Mandal

Lecture 24: More Reductions (1997) Steven Skiena. skiena

Introduction to Algorithms

Introduction to Graph Theory

The k-center problem Approximation Algorithms 2009 Petros Potikas

P and NP (Millenium problem)

NP-Completeness. Algorithms

NP-Complete Reductions 2

Some Hardness Proofs

Chapter 8. NP-complete problems

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Assignment No 2 (Group B)

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

More NP-complete Problems. CS255 Chris Pollett May 3, 2006.

CSCE 350: Chin-Tser Huang. University of South Carolina

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS

CS 125 Section #10 Midterm 2 Review 11/5/14

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

Computability Theory

Graphs: Introduction. Ali Shokoufandeh, Department of Computer Science, Drexel University

CMPSCI611: The SUBSET-SUM Problem Lecture 18

Examples of P vs NP: More Problems

A region is each individual area or separate piece of the plane that is divided up by the network.

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

Algorithm Design and Analysis

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section (CLRS)

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Approximation Algorithms

Quality of Service (QoS) Routing. A Quick Review of NP-Completeness

6.2. Paths and Cycles

COMP Analysis of Algorithms & Data Structures

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

31.6 Powers of an element

Graph Theory. Connectivity, Coloring, Matching. Arjun Suresh 1. 1 GATE Overflow

Dynamic programming. Trivial problems are solved first More complex solutions are composed from the simpler solutions already computed

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Introduction to Approximation Algorithms

Bulldozers/Sites A B C D

Contents. 1 Introduction. 2 Searching and Traversal Techniques. Preface... (vii) Acknowledgements... (ix)

Complexity Results on Graphs with Few Cliques

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs

DS UNIT 4. Matoshri College of Engineering and Research Center Nasik Department of Computer Engineering Discrete Structutre UNIT - IV

Practical Session No. 12 Graphs, BFS, DFS, Topological sort

PSD1A. DESIGN AND ANALYSIS OF ALGORITHMS Unit : I-V

Prove, where is known to be NP-complete. The following problems are NP-Complete:

Reference Sheet for CO142.2 Discrete Mathematics II

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

of optimization problems. In this chapter, it is explained that what network design

CS 470/570 Exam 6 Spring 2017 Solution

Pre-requisite Material for Course Heuristics and Approximation Algorithms

CSC 505, Fall 2000: Week 12

UNIT 5 GRAPH. Application of Graph Structure in real world:- Graph Terminologies:

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Math 776 Graph Theory Lecture Note 1 Basic concepts

CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Research Question Presentation on the Edge Clique Covers of a Complete Multipartite Graph. Nechama Florans. Mentor: Dr. Boram Park

Graph Theory. Part of Texas Counties.

Introduction III. Graphs. Motivations I. Introduction IV

NP-Complete Problems

Lecture 8: The Traveling Salesman Problem

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

8 NP-complete problem Hard problems: demo

On Modularity Clustering. Group III (Ying Xuan, Swati Gambhir & Ravi Tiwari)

W4231: Analysis of Algorithms

CSC Design and Analysis of Algorithms. Lecture 4 Brute Force, Exhaustive Search, Graph Traversal Algorithms. Brute-Force Approach

Chapter 3: Paths and Cycles

11.4 Bipartite Multigraphs

CSE 417 Branch & Bound (pt 4) Branch & Bound

Traveling Salesperson Problem (TSP)

COMP260 Spring 2014 Notes: February 4th

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

Copyright 2000, Kevin Wayne 1

The Design of Approximation Algorithms

Varying Applications (examples)

1 The Traveling Salesperson Problem (TSP)

Transcription:

NP-omplete Problems P and NP Polynomial time reductions Satisfiability Problem, lique Problem, Vertex over, and ominating Set 10/19/2009 SE 5311 FLL 2009 KUMR 1

Polynomial lgorithms Problems encountered so far are polynomial time algorithms The worst-case running time of most of these algorithms is O(n k ) time, for some constant k. ll problems cannot be solved in polynomial time There are problems that cannot be solved at all Unsolvable There are problems that can be solved but not in O(n k ) time for some constant k. Note that most useful algorithms of complexity O(n 3 ) or better. Problems that are solvable in polynomial time by polynomialtime algorithms are said to be tractable (or easy or efficient). Problems that require superpolynomial time are said to be intractable or hard. 10/19/2009 SE 5311 FLL 2009 KUMR 2

P and NP lass P problems are solvable in polynomial time. lass NP problems are verifiable in polynomial time. lass NP is the class of decision problems that can be solved by non-deterministic polynomial algorithms. For example, given a problem, we can verify the solution in polynomial time ny problem in P is also in NP P NP It is NOT KNOWN whether P is a proper subset of NP. n NP-complete problem is in NP s difficult as any other problem in NP an be reduced to an instance of know NP-omplete problem in polynomial time 10/19/2009 SE 5311 FLL 2009 KUMR 3

NP What are NP-complete Problems? problem is said to be NP-omplete if it is as hard as any problem in NP. No polynomial time algorithm has yet been discovered for the NP-omplete problem. However, it has not been proven that NO polynomial time algorithm can exist for an NP-omplete problem. This problem was first posed by ook in 1971. The issue of, P=NP or P NP is an open research problem In 2002 a known NP-omplete problem was shown to have a polynomial time algorithm. Whether a given integer is a prime or composite 10/19/2009 SE 5311 FLL 2009 KUMR 4

Examples of NP-omplete problems Shortest vs. longest simple paths Finding the shortest paths from a single source in a directed graph G =(V,E) can be completed in O(V + E) time. Even with negative edge weights. However, finding the longest simple path between two vertices is NPcomplete. It is NP-omplete even if each of edge weights is equal to one. n Euler tour of a connected directed graph G=(V,E), can be completed in O(E) time. However, the Hamiltonian ycle is a NP-omplete problem. The traveling salesman problem is a variation of the Hamiltonian cycle. 10/19/2009 SE 5311 FLL 2009 KUMR 5

Polynomial Time Reductions ecision Problems: Problems whose answer is yes or no!! Most problems can be converted to decision problems. Language recognition problem is a decision problem. Suppose L U is the set of all inputs for which the answer to the problem is yes L is called the language corresponding to the problem (Turing machines). The terms language and problem are used interchangeably. Given a problem, with an input language X, Now the decision problem can be defined as the problem to recognize whether or not X belongs to L. 10/19/2009 SE 5311 FLL 2009 KUMR 6

Reductions ontd. efinition: Let L1 and L2 be two languages from input spaces U1 and U2. We say that L1 is polynomially reducible to L2 if there exists a polynomial-time algorithm that converts each input u1 U1 to another input u2 U2 such that u1 L1 iff u2 L2. The algorithm is polynomial in the size of the input u1. If we have an algorithm for L2 then we can compose the two algorithms to produce an algorithm for L1. If L1 is polynomially reducible to L2 and there is a polynomialtime algorithm for L2, then there is a polynomial time algorithm for L1. Reducibility is not symmetric L1 is polynomially reducible to L2 does not imply L2 is polynomially reducible to L1 10/19/2009 SE 5311 FLL 2009 KUMR 7

The Satisfiability (ST) Problem S oolean expression in onjunctive Normal Form (NF) (Product (N) of Sums (ORs) For example S = ( x + y + z) ( x + y + z) ( x + y + z) The ST problem is to determine whether a given oolean expression is Satisfiable (without necessarily finding a satisfying assignment) We can guess a truth assignment and check that it satisfies the expression in polynomial time. ST is NP hard Turing machine and all of its operations on a given input can be described by a oolean Expression. The expression will be satisfiable iff the Turing machine will terminate at an accepting state for the given input. http://www.nada.kth.se/~viggo/problemlist/compendium.html 10/19/2009 SE 5311 FLL 2009 KUMR 8

lique Problem ( x + y + z) ( x + y + z) ( x + y + z) x x x y y y z z z 10/19/2009 SE 5311 FLL 2009 KUMR 9

lique Problem ( x + y + z) ( x + y + z) ( x + y + z) x x x y y y z z z 10/19/2009 SE 5311 FLL 2009 KUMR 10

lique Problem ( x + y + z) ( x + y + z) ( x + y + z) x x x y y y z z z 10/19/2009 SE 5311 FLL 2009 KUMR 11

lique Problem ( x + y + z) ( x + y + z) ( x + y + z) x x x y y y z z z 10/19/2009 SE 5311 FLL 2009 KUMR 12

lique Problem ( x + y + z) ( x + y + z) ( x + y + z) x x x y y y z z z 10/19/2009 SE 5311 FLL 2009 KUMR 13

Vertex over problem vertex cover of G = (V,E) is a set of vertices such that every edge in E is incident to at least one of the vertices in the vertex cover. E 10/19/2009 SE 5311 FLL 2009 KUMR 14

Vertex over problem vertex cover of G = (V,E) is a set of vertices such that every edge in E is incident to at least one of the vertices in the vertex cover. E E G G complement of G 10/19/2009 SE 5311 FLL 2009 KUMR 15

Vertex over problem vertex cover of G = (V,E) is a set of vertices such that every edge in E is incident to at least one of the vertices in the vertex cover. E G has a maximum clique of size V -k 10/19/2009 SE 5311 FLL 2009 KUMR 16

Vertex over problem vertex cover of G = (V,E) is a set of vertices such that every edge in E is incident to at least one of the vertices in the vertex cover. E G G has a minimum vertex cover of size k if and only if G has a maximum clique of size V -k E complement of G 10/19/2009 SE 5311 FLL 2009 KUMR 17

Vertex over problem vertex cover of G = (V,E) is a set of vertices such that every edge in E is incident to at least one of the vertices in the vertex cover. E E G G complement of G 10/19/2009 SE 5311 FLL 2009 KUMR 18

ominating Set G = (V,E) is an undirected graph. dominating set of G is a set of vertices (a subset of V) such that every vertex of G is either in or is adjacent to at least one vertex from. G has a vertex cover of size m 10/19/2009 SE 5311 FLL 2009 KUMR 19

ominating Set G = (V,E) is an undirected graph. dominating set of G is a set of vertices (a subset of V) such that every vertex of G is either in or is adjacent to at least one vertex from. 10/19/2009 SE 5311 FLL 2009 KUMR 20

ominating Set G = (V,E) is an undirected graph. dominating set of G is a set of vertices (a subset of V) such that every vertex of G is either in or is adjacent to at least one vertex from. G has a vertex cover of size m 10/19/2009 SE 5311 FLL 2009 KUMR 21

ominating Set G = (V,E) is an undirected graph. dominating set of G is a set of vertices (a subset of V) such that every vertex of G is either in or is adjacent to at least one vertex from. G has a dominating set of size m if and only if G has a vertex cover of size m 10/19/2009 SE 5311 FLL 2009 KUMR 22

ominating Set G = (V,E) is an undirected graph. dominating set of G is a set of vertices (a subset of V) such that every vertex of G is either in or is adjacent to at least one vertex from. G has a dominating set of size m if and only if G has a vertex cover of size m 10/19/2009 SE 5311 FLL 2009 KUMR 23

NP omplete Problems Hamiltonian ircuit Problem etermine whether a given graph has a Hamiltonian circuit. Travelling Salesman Find the shortest tour through n cities with known positive integer distances between them. Knapsack Problem Find the most valuable subset of n items of given positive integer weights and values that fit into a knapsack of a given positive integer capacity. Partition Problem Given n positive integers, determine whether it is possible to partition them into two disjoint subsets with the same sum. in Packing Given n items whose sizes are positive rational numbers not larger than 1, put them into the smallest number of bins of size 1. Graph oloring For a given graph, find its chromatic number (the smallest number of colors that need to be assigned to the graph s vertices so that no two adjacent vertices are assigned the same color. Integer Linear Programming Find the maximum (or minimum) value of a linear function of several integervalued variables subject to a finite set of constrains in the form of linear equalities and/or inequalities. 10/19/2009 SE 5311 FLL 2009 KUMR 24

ealing with NP omplete problems Proving that a given problem is NP-omplete does not make the problem go away!! Udi Manber n NP-omplete problem cannot be solved precisely in polynomial time We make compromises in terms of optimality, robustness, efficiency, or completeness of the solution. pproximation algorithms do not lead to optimal solutions Probabilistic algorithms ranch and bound acktracking 10/19/2009 SE 5311 FLL 2009 KUMR 25

acktracking The Hamiltonian ircuit Problem The Subset problem 10/19/2009 SE 5311 FLL 2009 KUMR 26

ranch and ound Job ssignment Knapsack 10/19/2009 SE 5311 FLL 2009 KUMR 27

Hamiltonian ircuit The vertex cover is polynomially transformable to the Hamiltonian ircuit problem for directed graphs. G = (V,E) is a given undirected graph and k is an integer We construct new graph G = (V, E ) such that G has a Hamiltonian ircuit iff a set of k vertices of V covers the edges of G. V = {v1, v2,, vn} Each edge (vi,vj) is denoted by eij. a1, a2, ak are new symbols ( vertex cover of size k) The vertices of G will consist of one vertex corresponding to each ai PLUS Four vertices for each edge of G. Vd = {a, a2,... n} {[v, e, b] v V, e E, b {0,1}, and e is incident upon v }. 10/19/2009 SE 5311 FLL 2009 KUMR 28

Edge (vi, vj) From previous edge adjacent to vi From previous edge adjacent to vj [vi,eij,0] [vj,eij,0] [vi,eij,1] [vj,eij,1] To next edge adjacent to vi To next edge adjacent to vj 10/19/2009 SE 5311 FLL 2009 KUMR 29

dditional Edges Each aj has an edge to the vertices (vi,eil, 0) such that eil is the first edge on the list for vi. There is an edge from [vi,eil,1] to each aj if eil is the last edge on the list for vi. There is an edge from [vi,eil,1] to [vi,eim,0] if edge eim immediately follows eil on the list for vi. 10/19/2009 SE 5311 FLL 2009 KUMR 30

e12 v1 e13 v2 e23 v3 a1 a2 [v1,e12,0] [v2,e12,0] [v1,ei2,1] [v2,e12,1] [v1,e13,0] [v3,e13,0] [v1,e13,1] [v3,e13,1] [v2,e23,0] [v3,e23,0] [v2,e23,1] [v3,e23,1] 10/19/2009 SE 5311 FLL 2009 KUMR 31

Set over Given a set U of n elements, a collection S1, S2, Sm of subsets of U, and a number k, does there exist a collection of at most k of these sets whose union is equal to all of U Please see pages 456-457 of Kleinberg s book 10/19/2009 SE 5311 FLL 2009 KUMR 32