+ All Categories
Transcript
Page 1: NP-Completeness - University of Texas at San Antoniobylander/cs3343/notes/np-completenesshandout.pdfCS3343AnalysisofAlgorithms NP-Completeness –6 CLIQUE CS3343AnalysisofAlgorithms

NP-Completeness

Introduction

Decision Problems

Polynomial-Time Reductions

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Decision Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Reductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Problem Reduction Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53SAT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6CLIQUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Reducing 3SAT to CLIQUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8VERTEX-COVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Reducing CLIQUE to VERTEX-COVER . . . . . . . . . . . . . . . . . . . . . . . . . . 10SUBSET-SUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Reducing 3SAT to SUBSET-SUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Complexity Class P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Verification Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Complexity Class NP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Polynomial-Time Reducibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Complexity Class NPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

1

Introduction

NP-Complete problems are of interest because they are problems we would liketo solve, but it is unknown whether they have efficient algorithms. Thisincludes: traveling salesman, knapsack, analysis of boolean expressions(always/never/sometimes true).

We will start with examples of reductions, then to the definition of NP andNP-complete.

CS 3343 Analysis of Algorithms NP-Completeness – 2

Decision Problems

A problem specifies an input-output relationship, e.g., sorting a sequence ofnumbers, finding the minimum spanning tree.

An instance is a single, specific input of a problem, a specific sequence ofnumbers, a specific weighted graph.

In a decision problem, the output is either yes or no. Is the median greater than50? Does the minimum spanning tree have a weight less than 50?

CS 3343 Analysis of Algorithms NP-Completeness – 3

2

Page 2: NP-Completeness - University of Texas at San Antoniobylander/cs3343/notes/np-completenesshandout.pdfCS3343AnalysisofAlgorithms NP-Completeness –6 CLIQUE CS3343AnalysisofAlgorithms

Reductions

Most of NP-completeness is not concerned with algorithms for decisionproblems, but with relationships between decision problems. In particular, howan algorithm for one decision problem reduces to (can be used to solve)another decision problem.

Figure corresponds to the notation: A ≤P B

CS 3343 Analysis of Algorithms NP-Completeness – 4

Problem Reduction Sequence

CS 3343 Analysis of Algorithms NP-Completeness – 5

3

3SAT

CS 3343 Analysis of Algorithms NP-Completeness – 6

CLIQUE

CS 3343 Analysis of Algorithms NP-Completeness – 7

4

Page 3: NP-Completeness - University of Texas at San Antoniobylander/cs3343/notes/np-completenesshandout.pdfCS3343AnalysisofAlgorithms NP-Completeness –6 CLIQUE CS3343AnalysisofAlgorithms

Reducing 3SAT to CLIQUE

CS 3343 Analysis of Algorithms NP-Completeness – 8

VERTEX-COVER

CS 3343 Analysis of Algorithms NP-Completeness – 9

5

Reducing CLIQUE to VERTEX-COVER

CS 3343 Analysis of Algorithms NP-Completeness – 10

SUBSET-SUM

CS 3343 Analysis of Algorithms NP-Completeness – 11

6

Page 4: NP-Completeness - University of Texas at San Antoniobylander/cs3343/notes/np-completenesshandout.pdfCS3343AnalysisofAlgorithms NP-Completeness –6 CLIQUE CS3343AnalysisofAlgorithms

Reducing 3SAT to SUBSET-SUM

CS 3343 Analysis of Algorithms NP-Completeness – 12

Complexity Class P

CS 3343 Analysis of Algorithms NP-Completeness – 13

7

Verification Algorithms

CS 3343 Analysis of Algorithms NP-Completeness – 14

Complexity Class NP

Computer scientists believe P 6= NP, but no proof exists.

CS 3343 Analysis of Algorithms NP-Completeness – 15

8

Page 5: NP-Completeness - University of Texas at San Antoniobylander/cs3343/notes/np-completenesshandout.pdfCS3343AnalysisofAlgorithms NP-Completeness –6 CLIQUE CS3343AnalysisofAlgorithms

Polynomial-Time Reducibility

CS 3343 Analysis of Algorithms NP-Completeness – 16

Complexity Class NPC

CS 3343 Analysis of Algorithms NP-Completeness – 17

9


Top Related