0% found this document useful (0 votes)
6 views4 pages

22NP Complete 1

Uploaded by

khushbussd2111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

22NP Complete 1

Uploaded by

khushbussd2111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

• Informally, these are the hardest problems in

the class NP
• If any NP-complete problem can be solved by a
CS 3813: Introduction to Formal polynomial time deterministic algorithm, then
Languages and Automata every problem in NP can be solved by a
polynomial time deterministic algorithm
• But no polynomial time deterministic algorithm
NP-Completeness is known to solve any of them

Polynomial-time reduction
Examples of NP-complete problems
Let L1 and L2 be two languages over alphabets
• Traveling salesman problem Σ1 and Σ2,, respectively. L1 is said to be
• Hamiltonian cycle problem polynomial-time reducible to L2 if there is a
• Clique problem total function f: Σ1*→ Σ2* for which
• Subset sum problem 1) x ∈ L1 if an only if f(x) ∈ L2, and
• Boolean satisfiability problem 2) f can be computed in polynomial time
The function f is called a polynomial-time
• Many thousands of other important
computational problems in computer science, reduction.
mathematics, economics, manufacturing,
communications, etc.

Exercise
Another view In English, describe a Turing machine that
Polynomial-time
NP-complete problems
polynomial time. Using machine that computes the
Set of instances of Problem Q Set of instances of Problem Q’ big-O notation, give the reduction.
reduction reduces L1 to L2 in time complexity of the
second problem entails a yes (or no) answer to the first.
One decision problem is polynomial-time reducible to – L1 = {aibiaj} L2 = {cidi} – L1 = {ai(bb)i} L2 =
another if a polynomial time algorithm can be developed
that changes each instance of the first problem to an {aibi}
instance of the second such that a yes (or no) answer to the
1
A more interesting polynomial-time reduction • Partition Problem: Given a finite set of
• The Hamiltonian cycle problem can be polynomial-time integers, determine if it can be partitioned into
reduced to the traveling salesman problem. two sets such that the sum of all integers in the
• For any undirected graph G, we show how to construct an first set equals the sum of all integers in the
undirected weighted graph G’ and a bound B such that G has second set
a Hamiltonian cycle if and only if there is a tour in G’ with
total weight bounded by B. • Subset Sum Problem: Given a set of integers
• Given G = (V,E), let B = 0 and define G’ = (V,E’) as the and a number t, determine if there is a subset of
complete graph with the following weights assigned to edges:
if these integers whose sum is t.
v v E • Show that the Partition Problem is polynomial
i j wi j
0 ( , )∈ time reducible to the Subset Sum Problem
= 1 ( , )∈
if v v
, i jE

• G has a Hamiltonian cycle if and only if G’ has a tour with


total weight 0.

SAT (Boolean satisfiability)

Examples of problem reductions


Exercise
show that at least one problem is NP
SAT Same as above except every clause in proposition has complete, without using a polynomial-time
exactly three literals.
reduction
3-SAT Given an undirected graph, determine whether it contains a
• Cook proved that the the Boolean
Hamiltonian cycle (a path that starts at one node, visits
every other node exactly once, and returns to start. satisfiability problem (denoted SAT) is
HAM-CYCLE TSP Given a fully-connected weighted graph, find a least-weight NP-complete. He did not use a
tour of all nodes (cities). polynomial-time reduction to prove this. •
• In order to use polynomial-time This was the first problem proved to be
Is there a satisfying assignment for a proposition in
conjunctive normal form? reductions to show that problems are NP-complete.
NP-complete, we must be able to directly

• A problem is NP-Complete if
1. It is an element of the class NP
2. Another NP-complete problem is polynomial
time reducible to it

• A problem that satisfies property 2, but not


necessarily property 1, is NP-hard.
Strategy for proving
Definition of NP-Complete
– Exercise: In English, describe a nondeterministic
a problem is NP-complete algorithm that solves the satisfiability problem

• Show that it belongs to the class NP by describing a • Show that the problem is NP-hard by showing that
nondeterministic Turing machine that solves it in another NP-hard problem is polynomial-time
polynomial time. (This establishes an upper bound reducible to it. (This establishes a lower bound on
on the complexity of the problem.) the complexity of the problem.)

2
P ≠ NP ?
NP
• Theorem: If any NP-complete problem can be NP
solved by a polynomial-time deterministic
algorithm, then P = NP. If any problem in NP

One of these two possibilities is correct


cannot be solved by a problems the focus of the P=NP NP-complete P
polynomial-time deterministic question.
algorithm, then NP-complete • Most theoretical computer NP
problems are not in P. scientists believe that P ≠ NP. But
• This theorem makes NP-complete no one has proved this yet. NP-complete P

complexity classes
• NC ⊆ P ⊆ NP ⊆ PSPACE = NPSPACE ⊆ EXPTIME
• P ≠ EXPTIME
• Saying a problem is in NP (P, PSPACE, etc.) gives an
upper bound on its difficulty
• Saying a problem is NP-hard (P-hard, PSPACE-hard,
etc.) gives a lower bound on its difficulty. It means it
is at least as hard to solve as any other problem in NP.
• Saying a problem is NP-complete (P-complete,
PSPACE-complete, etc.) means that we have
What should we do? matching upper and lower bounds on its
complexity
• Just because a problem is NP-complete,
doesn’t mean we should give up on trying to Complexity classes
solve it.
• A complexity class is a class of problems grouped
• For some NP-complete problems, it is possible together according to their time and/or space
to develop algorithms that have average-case complexity
polynomial complexity (despite having worst • NC: can be solved very efficiently in parallel • P:
case exponential complexity) solvable by a DTM in poly-time (can be solved
• For other NP-complete problems, approximate efficiently by a sequential computer)
solutions can be found in polynomial time. • NP: solvable by a NTM in poly-time (a solution can be
checked efficiently by a sequential computer) • PSPACE:
Developing good approximation algorithms is
solvable by a DTM in poly-space • NPSPACE: solvable
an important area of research. by a NTM in poly-space • EXPTIME: solvable by a
DTM in exponential time

Relationships between
3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy