This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

### Publishers

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

In the previous chapters, we have been working mostly with the design and

analysis of those algorithms for which the running time can be expressed

in terms of a polynomial of low degree, say 3. In this chapter, we turn our

attention to a class of problems for which no eﬃcient algorithms have been

found. Moreover, it is unlikely that an eﬃcient algorithm will someday

be discovered for any one of these problems. Let Π be any problem. We

say that there exists a polynomial time algorithm to solve problem Π if

there exists an algorithm for Π whose time complexity is O(nk

), where n

is the input size and k is a nonnegative integer. It turns out that many of

the interesting real world problems do not fall into this category, as their

solution requires an amount of time that is measured in terms of exponential

and hyperexponential functions, e.g. 2n

and n!. It has been agreed upon

in the computer science community to refer to those problems for which

there exist polynomial time algorithms as tractable, and those for which it

is unlikely that there exist polynomial time algorithms as intractable.

In this chapter, we will study a subclass of intractable problems, com-

monly referred to as the class of NP-complete problems. This class contains,

among many others, hundreds of well-known problems having the common

property that if one of them is solvable in polynomial time, then all the

others are solvable in polynomial time. Interestingly, many of these are

natural problems in the sense that they arise in real world applications.

Moreover, the running times of the existing algorithms to solve these prob-

lems are invariably measured in terms of hundreds or thousands of years

279

280

NP-complete Problems

for inputs of moderate size (see Table 1.1 on page 24).

When studying the theory of NP-completeness, it is easier to restate a

problem so that its solution has only two outcomes: yes or no. In this case,

the problem is called a decision problem. In contrast, an optimization prob-

lem is a problem that is concerned with the minimization or maximization

of a certain quantity. In the previous chapters, we have encountered numer-

ous optimization problems, like ﬁnding the minimum or maximum in a list

of elements, ﬁnding the shortest path in a directed graph and computing a

minimum cost spanning tree of an undirected graph. In the following, we

give three examples of how to formulate a problem as a decision problem

and an optimization problem.

Example 10.1 Let S be a sequence of real numbers. The ELEMENT

UNIQUENESS problem asks whether all the numbers in S are distinct.

Rephrased as a decision problem, we have

Decision problem: element uniqueness.

Input: A sequence S of integers.

Question: Are there two elements in S that are equal?

Stated as an optimization problem, we are interested in ﬁnding an element in

S of highest frequency. For instance, if S = 1,5,4,5,6,5,4, then 5 is of highest

frequency since it appears in the sequence 3 times, which is maximum. Let us call

this optimization version element count. This version can be stated as follows.

Optimization problem: element count.

Input: A sequence S of integers.

Output: An element in S of highest frequency.

This problem can be solved in optimal O(nlogn) time in the obvious way, which

means it is tractable.

Example 10.2 Given an undirected graph G = (V,E), a coloring of G using

k colors is an assignment of one of k colors to each vertex in V in such a way

that no two adjacent vertices have the same color. The coloring problem asks

whether it is possible to color an undirected graph using a speciﬁed number of

colors. Formulated as a decision problem, we have

Decision problem: coloring.

Input: An undirected graph G = (V,E) and a positive integer k ≥ 1.

Question: Is G k-colorable?, i.e., can G be colored using at most k colors?

This problem is intractable. If k is restricted to 3, the problem reduces to the

well-known 3-coloring problem, which is also intractable even when the graph

is planar.

An optimization version of this problem asks for the minimum number of colors

needed to color a graph in such a way that no two adjacent vertices have the

same color. This number, denoted by χ(G), is called the chromatic number of G.

Introduction

281

Optimization problem: chromatic number.

Input: An undirected graph G = (V,E).

Output: The chromatic number of G.

Example 10.3 Given an undirected graph G = (V,E), a clique of size k in

G, for some positive integer k, is a complete subgraph of G with k vertices. The

clique problem asks whether an undirected graph contains a clique of a speciﬁed

size. Rephrased as a decision problem, we have

Decision problem: clique.

Input: An undirected graph G = (V,E) and a positive integer k.

Question: Does G have a clique of size k?

The optimization version of this problem asks for the maximum number k such

that G contains a clique of size k, but no clique of size k + 1. We will call this

problem max-clique.

Optimization problem: max-clique.

Input: An undirected graph G = (V,E).

Output: A positive integer k, which is the maximum clique size in G.

If we have an eﬃcient algorithm that solves a decision problem, then

it can easily be modiﬁed to solve its corresponding optimization problem.

For instance, if we have an algorithm A that solves the decision problem for

graph coloring, we can ﬁnd the chromatic number of a graph G using binary

search and Algorithm A as a subroutine. Clearly, 1 ≤ χ(G) ≤ n, where n

is the number of vertices in G. Hence, the chromatic number of G can be

found using only O(logn) calls to algorithm A. Since we are dealing with

polynomial time algorithms, the logn factor is inconsequential. Because

of this reason, in the study of NP-complete problems, and computational

complexity or even computability in general, it is easier to restrict one’s

attention to decision problems.

It is customary in the study of NP-completeness, or computational com-

plexity in general, to adopt a formal model of computation such as the

Turing machine model of computation, as it makes the topic more formal

and the proofs more rigorous. In this chapter, however, we will work with

the abstract notion of “algorithm”, and will not attempt to formalize it by

associating it with any model of computation. A more formal treatment

that uses the Turing machine as a model of computation can be found in

Chapter 11.

282

NP-complete Problems

NAAC-SSR _2015_AITS.pdf

vnit nagput eee.pdf

Data Analytics With SAS

DAA

OOP

AC14_sol

We Ka Tutorial

Survey 2000

IT Syllabus

Eecs 140 Vhdl Tutorial

10.1.1.167

c Interview Questions Tech Preparation

Download

by knshiva

by Sajendra Kumar

by jeetu_x9

by saranjsp

by Vicky Mit

by Prajakta Bagal

by BitaKazemi

by legy86

by Paul Muljadi

by MyWBUT - Home for Engineers

by evan.dembskey2183

Algorithm Analysis and Design

A Notes on Design & Analysis of Algorithm

Intro Notes

Backtracking+8 queen problem

N Queen Problem

Introduction to the Design & Analysis of Algorithms 2ND Edition by Anany Levitin

8 Queens Problem Backtracking

CS502_all

DAA

Theory of Computation

Efficient Algorithms for Sorting and Searching

CS1303-TOC

algorithms notes

Backtracking

7 Search

DAA Notes (1)

Eight Queens Puzzle

0521736536 Graph Algorithms

CS501 Design and Analysis of Algorithm

Chap 4

Languages and Automata

Programming Problems and Exercises

Design and Analysis of Algorithms may 2008 Question Paper

Graph Theory & Algorithms - M. Ashraf Iqbal

Technical

A Algorithm for the time-dependent shortest path problem

CS2251-QB

selva

Johnson's Algorithm

Articulation Point using DFS - Algorithm

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

CANCEL

OK

scribd