This preview shows pages 1–2. 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: Algorithms Lecture 4: Efficient ExponentialTime Algorithms [ Fa10 ] Wouldnt the sentence I want to put a hyphen between the words Fish and And and And and Chips in my FishAndChips sign. have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? 1 Martin Gardner, Aha! Insight (1978) 4 Efficient ExponentialTime Algorithms ? In another lecture note, we discuss the class of NPhard problems. For every problem in this class, the fastest algorithm anyone knows has an exponential running time. Moreover, there is very strong evidence (but alas, no proof) that it is impossible to solve any NPhard problem in less than exponential timeits not that were all stupid; the problems really are that hard! Unfortunately, an enormous number of problems that arise in practice are NPhard; for some of these problems, even approximating the right answer is NPhard. Suppose we absolutely have to find the exact solution to some NPhard problem. A polynomialtime algorithm is almost certainly out of the question; the best running time we can hope for is exponential. But which exponential? An algorithm that runs in O ( 1.5 n ) time, while still unusable for large problems, is still significantly better than an algorithm that runs in O ( 2 n ) time! For most NPhard problems, the only approach that is guaranteed to find an optimal solution is recursive backtracking. The most straightforward version of this approach is to recursively generate all possible solutions and check each one: all satisfying assignments, or all vertex colorings, or all subsets, or all permutations, or whatever. However, most NPhard problems have some additional structure that allows us to prune away most of the branches of the recursion tree, thereby drastically reducing the running time. 4.1 3SAT Lets consider the mother of all NPhard problems: 3SAT. Given a boolean formula in conjunctive normal form, with at most three literals in each clause, our task is to determine whether any assignment of values of the variables makes the formula true. Yes, this problem is NPhard, which means that a polynomial algorithm is almost certainly impossible. Too bad; we have to solve the problem anyway. The trivial solution is to try every possible assignment. Well evaluate the running time of our 3SAT algorithms in terms of the number of variables in the formula, so lets call that n . Provided any clause appears in our input formula at most oncea condition that we can easily enforce in polynomial timethe overall input size is O ( n 3 ) . There are 2 n possible assignments, and we can evaluate each assignment in O ( n 3 ) time, so the overall running time is O ( 2 n n 3 ) ....
View
Full
Document
This note was uploaded on 10/14/2011 for the course ECON 101 taught by Professor Smith during the Spring '11 term at West Virginia University Institute of Technology.
 Spring '11
 Smith

Click to edit the document details