0% found this document useful (0 votes)
59 views10 pages

NP Hard & Complete

The document discusses lower bounds for computational problems. A lower bound estimates the minimum amount of work needed to solve a given problem. Examples of lower bounds include the number of comparisons needed to find the largest element in a set or sort an array. Lower bounds can be exact counts or efficiency classes. Tight lower bounds exist when an algorithm matches the lower bound efficiency. Methods for establishing lower bounds include trivial counting arguments, information theory using decision trees, and adversary arguments where an adversary adjusts the input to make the problem hardest. Problem reduction is also used, where if problem A is at least as hard as problem B with a known lower bound, that lower bound also applies to problem A.

Uploaded by

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

NP Hard & Complete

The document discusses lower bounds for computational problems. A lower bound estimates the minimum amount of work needed to solve a given problem. Examples of lower bounds include the number of comparisons needed to find the largest element in a set or sort an array. Lower bounds can be exact counts or efficiency classes. Tight lower bounds exist when an algorithm matches the lower bound efficiency. Methods for establishing lower bounds include trivial counting arguments, information theory using decision trees, and adversary arguments where an adversary adjusts the input to make the problem hardest. Problem reduction is also used, where if problem A is at least as hard as problem B with a known lower bound, that lower bound also applies to problem A.

Uploaded by

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

Lower Bounds

 Lower bound: an estimate on a minimum amount of work needed to


solve a given problem .
 Examples:
 Number of comparisons needed to find the largest element in a set of n numbers
 Number of comparisons needed to sort an array of size n
 Number of comparisons necessary for searching in a sorted array Number of
multiplications needed to multiply two n-by-n matrices
Lower bound can be
• an exact count
• an efficiency class ()
Tight lower bound: there exists an algorithm with the same efficiency as the
lower bound
Problem Lower bound Tightness
Sorting Ω (nlog n) yes
Searching in a sorted array Ω (log n) yes
Element uniqueness Ω (nlog n) yes
n-digit integer multiplication Ω (n) unknown Multiplication of n-by-
n matrices Ω (n2) unknown
Methods for Establishing Lower Bounds
• Trivial lower bounds

• Information-theoretic arguments (decision trees)


• Adversary arguments
• Problem reduction
Trivial Lower Bounds
Trivial lower bounds: based on counting the number of items that must be
processed  in input and generated as output.
Examples:
• Finding max element
• Polynomial evaluation
• Sorting
• Element uniqueness
• Hamiltonian circuit existence
Conclusions:
• May and may not be useful.
• Need to be careful in deciding how many elements must be processed.
Decision Trees
Decision tree — a convenient model of algorithms involving
comparisons in which:
• Internal nodes represent comparisons
• Leaves represent outcomes
Example: Any comparison-based sorting algorithm can be represented by
a decision tree
Adversary Arguments
• Adversary argument: a method of proving a lower bound by playing role
of adversary that makes algorithm work the hardest by adjusting input. The
adversary cannot lie, however.
• Example : Merge Sort
Lower Bounds by Problem Reduction

Idea: If problem P is at least as hard as problem Q, then a lower bound


for Q is also a lower bound for P.
Hence, find problem Q with a known lower bound that can be reduced to
problem P in question.
NP – Hard & NP – Complete Problem
Class P is a class of decision problems that are polynomialy bounded.
• There exist a deterministic algorithm.
Eg: i) finding maximum element in an array
ii)check whether a string is palindrome
Class NP is the class of decision problems for which there is a polynomial
bounded non deterministic algorithm.
• There exist a deterministic algorithm
Eg: i) Travelling salesman problem
ii) subset sum
Most decision problems are in NP. P ⊆ NP.
Take two problems A and B both are NP problems.
NP-hard– If every problem in NP and
It is reducible
Reducibility- we can convert one instance of a problem A into problem B
(NP problem) then it means that A is reducible to B.
NP-Complete -- problems which are both in NP and NP-hard
Thank You

You might also like