{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

LectureNotes28

# LectureNotes28 - ECS 120 Lesson 28 – Approximation...

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
This is the end of the preview. Sign up to access the rest of the 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 NP-complete 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 VERTEX-COVER = 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 NP-complete, but MIN-VERTEX-COVER is NP-hard, 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 ( k-optimal Approximation) If P is a minimization prob- lem, and A is a polynomial-time 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 2-optimal for MIN-VERTEX-COVER: 2-MIN-VERTEX-COVER 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

{[ snackBarMessage ]}

### Page1 / 10

LectureNotes28 - ECS 120 Lesson 28 – Approximation...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online