This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: © Debasis Mitra, 2005 NPCOMPLETE PROBLEMS “Computers and Intractability: A Guide to the Theory of NPCompleteness,” Michael R. Garey and David S. Jonson, W.H. Freeman and Company, New York, 1979, ISBN: 0716710455. Before we start: be reminded of our model of computation: all basic operations take unit time, we have infinite memory at the register level, and every step is deterministic as described in the algorithm. A polynomial algorithm is “faster” than an exponential algorithm. As n grows a n (exponential) always grows faster than n k (polynomial), i.e. for any values of a and k, after n> certain integer n , it is true that a n > n k . Even 2 n grows faster than n 1000 at some large value of n . The former functions are exponential and the later functions are polynomial. It seems that for some problems we just may not have any polynomial algorithm at all (as in the information theoretic bound)! The theory of NP completeness is about this issue, and in general the computational complexity theory addresses it. Solvable Problems Some problems are even unsolvable/ undecidable algorithmically, so you cannot write a computer program for them. Example. Halting problem : Given an algorithm as input, determine if it has an infinite loop. There does not exist any generalpurpose algorithm for this problem. Suppose (contradiction) there is an algorithm H that can tell if any algorithm X halts or not, i.e., H(X) scans X and returns True iff X does halt. Then, write P(X): // X is any “input algorithm” to P while (H(X)) { }; // condition is true only when X terminates return; // P terminates End. Then, provide P itself as the input X to the algorithm [i.e., P(P) ]: what happens?! H cannot return T/F for input P, there cannot exist such H. It is equivalent to the truth value of the sentence “ This sentence is a lie .” Note (1), we are considering Problems (i.e., for all instances of the problem) as opposed to some instances of the problem . For some subcases you may be able to solve the halting problem , but you cannot have an algorithm, which would solve the halting problem for ALL input. Different types of problems : decision problems, optimization problems, … Decision problems: Output is True/False . Decision Problem <> corresponding optimization problem. Example of 01 Knapsack Decision (KSD) problem: Input: KS problem + a profit value p Output: Answer the question "does there exist a knapsack with profit ≥ p ?" Algorithms are also interoperable between a problem and its corresponding decision problem. Solve a KSD problem K , using an optimizing algorithm: AlgorithmOptimizationKS (first part of K without given profit p ) return optimal profit o if p ≥ o then return TRUE else return FALSE ....
View
Full
Document
This note was uploaded on 02/10/2012 for the course CSE 5211 taught by Professor Dmitra during the Spring '12 term at FIT.
 Spring '12
 Dmitra
 Algorithms

Click to edit the document details