This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ECS 120 Lesson 28 – Approximation Algorithms, Randomized Algorithms Oliver Kreylos Wednesday, June 6th, 2001 In our discussion of time complexity, we have seen that there are problems that are solvable in principle, but require so much time and/or space to run, that they cannot in practice be solved for any but the smallest input sizes. But what should one do if facing such a problem in practice? Often, there are ways to get around the prohibitive time requirement by either making the problem slightly easier, or by accepting a solution that might be wrong in very few cases. Today we will address both these approaches. 1 Approximation Algorithms As an early example of an NPcomplete problem, we have seen the VERTEX COVER problem: Given a graph G = ( V,E ), is there a vertex cover, i. e., a subset of nodes, that touches all edges in E and contains not more than k vertices, where k is a given constant? Posed as a language, this problem becomes VERTEXCOVER = h G,k i G has a vertex cover of at most k vertices Typically, this problem is asked in another form: Instead of asking whether some vertex cover exists, the task is to find the smallest possible vertex cover: Given a graph G = ( V,E ), find a vertex cover of G having the smallest possible number of vertices. Typically, optimization problems like this one are even more difficult to decide than the related yes/no problems: VERTEX COVER is NPcomplete, but MINVERTEXCOVER is NPhard, i. e., it is not even in NP itself. 1 But the problem can be solved quite easily if the requirement of finding the optimal solution is relaxed: In practice, it is often sufficient to find a solution that is not much worse than the theoretical best solution. We can formalize this notion by the following definition: Definition 1 ( koptimal Approximation) If P is a minimization prob lem, and A is a polynomialtime approximation algorithm for P that always returns a solution that is not more than k times optimal, then A is a k optimal approximation algorithm for P . The following algorithm is 2optimal for MINVERTEXCOVER: 2MINVERTEXCOVER On input h G i , where G = ( V,E ) is a graph, 1. Find an unmarked edge e ∈ E that does not touch, i. e., does not share a vertex with, any marked edge in E . If there is no such edge, go to step 4. 2. Mark the found edge e . 3. Go to step 1. 4. Output all vertices touching marked edges. This algorithm definitely runs in polynomial time, and it also produces a cor rect vertex cover: If there were any edge in E that is not covered by a selected vertex, it cannot share any vertices with any marked edge. But then it would have been marked by step 2 of the algorithm, and both vertices touched by it would have been included in the vertex cover. That is a contradiction....
View
Full Document
 Spring '07
 Filkov
 Computational complexity theory, Prime number, Approximation algorithm, optimization problem

Click to edit the document details