Beruflich Dokumente
Kultur Dokumente
CSE-311 (Algorithm)
Introduction
Polynomial-time algorithms
The algorithms having worst case running time O(nk) for some constant k, are polynomial-time algorithms. Problems that are solvable in polynomial time are called tractable or easy problems.
Superpolynomial-time algorithms
All problems can not be solved in polynomial times: Turings famous Halting Problem can not be solved by any computer no matter how much time is provided. There are also problem (e.g. TSP) that can be solved (e.g. in exponential time) but not in time O(nk) for some constant k. Problems that requires superpolynomial time are called intractable or hard problems.
Dr. Md. Saiful Islam, Asst Prof, DUET CSE-311 (Algorithm) 2
NP-Complete problems
This is an interesting class of problems whose status is unknown. No polynomial time algorithm has yet been discovered for an NPcomplete problem On the other hand, nobody has not yet been able to prove that no polynomial time algorithm can exist for any of them. This is the most perplexing open research problem in theoretical computer science known as P NP question.
CSE-311 (Algorithm)
Class NPC: A problem is in the class NPC if it is in NP and is as hard as any problem in NP. If any NP-complete problem can be solved in polynomial time then every NP-complete has a polynomial time algorithm.
CSE-311 (Algorithm)
CSE-311 (Algorithm)
CSE-311 (Algorithm)
CSE-311 (Algorithm)
Reductions
Instance: We call the input to a particular problem an instance of that problem. Example: In PATH, an instance would be a particular graph G, particular vertices u and v of G, and a particular integer k. Reductions: Let us consider a decision problem, say A, which we would like to solve in polynomial time. Now suppose there is a different decision problem, say B, that we already know how to solve in polynomial time. Finally, suppose that we have a procedure that transfers an instance of A into some instance of B with the following characteristic: i. ii. The transformation takes polynomial time. The answers are the same. That is, the answer for is yes if and only if the answer for is also yes.
i.
Given an instance of problem A, use a polynomial-time reduction algorithm to transfer it to an instance of problem B. Run the polynomial time decision problem for B on the instance .
ii.
iii. Use the answer for as the answer for . Using polynomial time reductions to show that a problem is NP-complete: Suppose we have a decision problem A for which we already know that no polynomial time algorithm can exist. We have a polynomial-time reduction procedure to transfer instances of A to instances of B. Now by contradiction we can show that no polynomial time algorithm can exist for B.
CSE-311 (Algorithm) 11
Because the technique of reduction relies on having a problem already known NP-completeness We need the first NP-complete problem. Generally the circuit-satisfiability problem is used as the first problem.
CSE-311 (Algorithm)
12
NP-complete Problems
NP-complete problems arise in diverse domains boolean logic graph arithmetic network design storage and retrieval games and puzzles program optimization biology chemistry etc.
Dr. Md. Saiful Islam, Asst Prof, DUET CSE-311 (Algorithm) 13
Some NP-complete problems from graph theory and set partitioning: The clique problem Clique V = {u, v, x, y} Find the clique of maximum size The vertex-cover problem Vertex cover V = {w,z} Find the vertex cover of minimum size The hamiltonian-cycle problem The traveling salesman problem The sum of subset problem
Dr. Md. Saiful Islam, Asst Prof, DUET CSE-311 (Algorithm) 14