Download presentation
Published byLee Garrett Modified over 9 years ago
1
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
SELIM KALAYCI FIU-SCS 04/13/2005
2
Motivation Some optimization problems are “NP-hard” (by hardness of related decision problem), there is no poly-time algorithm unless P = NP. • largest clique • smallest vertex cover • largest maximum cut • . . . But: sometimes sub-optimal solutions are kind of OK • pretty large clique • pretty small vertex cover • pretty large maximum cut if algorithms run in poly time (preferably small exponents).
3
APPROXIMATION ALGORITHMS
Definition:Approximation algorithm An approximation algorithm for a problem is a polynomial-time algorithm that, when given input I, outputs an element of FS(I). Feasible solution set A feasible solution is an object of the right type but not necessarily an optimal one. FS(I) is the set of feasible solutions for I.
4
APPROXIMATION RATIO 1 ≤ Max (O/O*, O*/O) ≤ ρ(n)
Approximation algorithm has approximation ratio of ρ(n), if for any input of size n, the outcome O of its solution is within factor ρ(n) of outcome of optimal solution O*, i.e. 1 ≤ Max (O/O*, O*/O) ≤ ρ(n) Minimization problem Maximization problem
5
APPROXIMATION RATIO An algorithm with guaranteed approximation ratio of ρ(n) is called a ρ(n)-approximation algorithm. A 1-approximation algorithm is optimal, and the larger the ratio, the worse the solution. • For many NP-complete problems, constant-factor approximations(i.e. computed clique is always at least half the size of maximum-size clique), • Sometimes best known approx ratio grows with n,
6
VERTEX COVER PROBLEM Problem: Given graph G = (V,E), find smallest s.t. if (u, v) E, then u V′ or v V′ or both. Decision problem is NP-complete (3SAT ≤p VC, Sipser 7.5) Optimization problem is at least as hard.
7
VERTEX COVER ALGORITHM
Here is a trivial 2-approximation algorithm Input is some graph G = (V,E). APPROX-VERTEX-COVER 1: C ← Ø ; 2: E′ ← E 3: while E′ ≠ Ø; do 4: let (u, v) be an arbitrary edge of E′ 5: C ← C {(u, v)} 6: remove from E′ all edges incident on either u or v 7: end while
8
VERTEX COVER EXAMPLE Input Graph Optimal result, Size 3 a b c e d f g
9
VECTOR COVER ALGORITHM EXAMPLE
b c e d f g a b c e d f g Step 1: choose edge (c,e) Step 2: choose edge (d,g) a b c e d f g a b c e d f g Step 3: choose edge (a,b) Result: Size 6
10
PROOF Theorem. APPROX-VERTEX-COVER is a poly-time
2-approximation algorithm. Proof. The running time is trivially bounded by O(V * E) (at most |E| iterations, each of complexity at most O(V )). Correctness: C clearly is a vertex cover.
11
PROOF cont. Size of the cover: let A denote set of edges that are picked ({(c, e), (d, g), (a, b)} in example). 1. In order to cover edges in A, any vertex cover, in particular an optimal cover C*, must include at least one endpoint of each edge in A. By construction of the algorithm, no two edges in A share an endpoint (once edge is picked, all edges incident on either endpoint are removed). Therefore, no two edges in A are covered by the same vertex in C*, and |C*| ≥ |A|. 2. When an edge is picked, neither endpoint is already in C, thus |C| = 2|A|. Combining (1) and (2) yields |C| = 2|A| ≤ 2|C*| q.e.d
12
MAX CUT PROBLEM Given an undirected graph G (V,E):
Separate vertices of G into two disjoint sets S and T, such that number of cut edges is maximum. (Maximization Problem) Cut edge: An edge between a node in S and a node in T.
13
MAX-CUT ALGORITHM Another 2-approximation algorithm : Given G (V,E)
1- S ← Ø and T ← V 2- If moving a single node from S to T, or from T to S increases the number of cut edges, make the move. Repeat 2. 3- Output the number of cut edges.
14
QUESTIONS
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.