530 likes | 701 Views
z-Approximations. Refael Hassin Samir Khuller. 吳晉賢 D90922003 馬德文 R90922004 李耘天 R90922003. Introduction. 傳統分析方法 傳統分析方法的困境 新的分析方法. 傳統分析方法. OPT 是針對 NP problem 的最佳解. C 假設是我們 approximation algo. 所求的 cost. 求最大值 C >= (1- )*OPT (0< <1) 求最小值
E N D
z-Approximations Refael Hassin Samir Khuller 吳晉賢 D90922003 馬德文 R90922004 李耘天 R90922003
Introduction • 傳統分析方法 • 傳統分析方法的困境 • 新的分析方法
傳統分析方法 • OPT 是針對NP problem的最佳解. • C 假設是我們approximation algo. 所求的cost. • 求最大值 C >= (1-)*OPT (0< <1) • 求最小值 C <= (1+)*OPT (0< <1)
傳統分析方法的困境 • 不好的approximation會被以為是好的approximation,像vertex cover,用maximum matching找到的有可能是所有的vertices. • 有些NP的問題用傳統方法會找不到-approximation,像 generic TSP,如果找的到的話,則NP=P.
新的分析方法 • 以前都是跟最佳解來做比較,看是否能在最佳解的 倍以內. (0< <1) • 假設我們可以找到一個best sol’n跟一個worst sol’n,則我們的approximation algo.所產生的cost是用來跟best sol’n的cost跟worst sol’n的cost間來比較,則這是我們新的評估方法.
z-Approximation (新的分析法) • 以求最大值為例 worst sol’n OPT best 有些問題找不到-approximation,像generic TSP,但是根據新的分析法,我們可以找到 z-approximation
z-Approximation for minimization problems c(S)是我們所求的一個解的cost c(best)是找出來的一個很好的解的cost c(worst)是找出來的一個很差的解的cost =>
z-Approximation for maximization problems c(S)是我們所求的一個解的cost c(best)是找出來的一個很好的解的cost c(worst)是找出來的一個很差的解的cost =>
z-Approximation for some NP problems • TSP ½ z-Approximation for directed graph. 1/3 z-Approximation for undirected graph. • Max cut and Min cluster ½(n/n-2) z-Approximation. (n是點的個數) • Minimum disjoint cycle cover 1/3 z-Approximation • Minimum dominating set ½ z-Approximation
½ z-approximation ~ Directed TSP • Input : Directed Complete Graph G = (V, A) with weights c( i, j ) . • Output : minimum cost simple cycle on V.
Facts ~ Christofides ‘76 • The well known algorithm which guarantee bounded ratio (3/2) approximations for the minimum (metric) TSP on undirected may still output worst solutions on such instances.
Facts ~ Christofides ‘76 For example, consider a complete graph with unit length edges for all but a single edge whose length is two. 1 1 1 1 k+1
Cycle cover • Cycle Cover is a set of vertex disjoint cycles which span the vertex set. • A minimum cost cycle cover can be computed in P-time in the directed case by reducing to the assignment problem.
Algorithm • Step 1 Compute a minimum cost directed cycle cover DCC. It contains a single cycle return this cycle (it is an optimal tour). Otherwise, arbitrarily fix a cyclic order of the cycles in DCC. Denote the cycles in the order fixed above as
Algorithm • Step 2 Randomly choose a vertex . Index the vertices of starting from in the dictated by the cycle’s orientation, as
Algorithm • Step 3 Let denote the sequence of vertices between starting from p in the direction dictated by the orientation of . Step 4 Return the tour which visits the vertices in the order of .
Analysis • Q1. P-time? All steps including the generation of DCC only consume P-time. It is right! Q2. Is it feasible? The DCC is a set of vertex disjoint cycles which span the vertex set and this algorithm has only modified these cycles to a single one without any replication of vertices.
Analysis • Q3. Approximation ratio? Let denote the expected cost of the solution , we want to prove that Remind that the z-approximation for the min. problem
Analysis Consider a tour denote the expected cost of
Analysis • delete an arc from each cycle and added an arc from each cycle to its successor. • delete two arcs in each cycle and added two arcs from each cycle to its successor.
Analysis • Since each arc in a cycle has the same probability of being deleted and each arc from a given cycle to its successor has the same probability of being used. Therefore, Then,
Analysis • Derandomized to the the deterministic ½z – approximation. Applying the method of conditional expectations, we first choose the arc to be deleted from to satisfy:
Analysis • The same idea for the following cycles. • And the last cycle…
Analysis • There is 1/3 z-approximation for the undirected TSP. • In the undirected case a cycle cover is also called a binary 2-matching problem… This can also be obtained in polynomial time!
Analysis The main difference is that each cycle in a cycle cover in an undirected graph has size at least three, whereas in the directed case, each cycle in the cycle cover has size at least two. (multigraph is not allowed for the undirected case)
Analysis • In the undirected case, we can perform an extra exchange operation to swap another edge from each cycle, thus creating a bad solution from the cycle by using two sets of swaps. So, Then,
Analysis • If there is a polynomial time algorithm that for any fixed yields an z – approximation for TSP then P = NP.
Analysis Proof. If so, it finds a solution S with cost at most Then,
Analysis • Note that the TSP with distances between vertices being either 1 or 2 (called ½ TSP) is MAX SNP-hard. (Proved by C.H. Papadimitriou and M. Yannakakis, Mathematics of Operations Research, 1993) • This implies that there is a PTAS for ½ TSP, which in turn implies that P = NP.
MAX-CUT and MIN-CLUSTER • Input: a graph with non-negative edge weights. • Output: two non-empty sets so that the total weight of edges with end vertices in different sets is maximized. • Facts: many ½-approx algorithms • Remember the 0.87856…-approx?
Algorithm • Find one maximal cutSapx and output it.
Analysis(1) • Q1: Polynomial time? • A1: Maximal matching can be done in O(|E|). • Q2: Feasible? • A2: It is a cut told by the algorithm.
Analysis(2) • Q3: n/2(n-2) z-approx? • A3: Assume |V| = n. • c(Smax) <= c(G) (maximum value is total cost of the graph) • c(Smin) <= 2c(G) / n (minimum value must be less than the expected value, which for any vertex, is 2c(G) / n) • c(Sapx) >= c(G) / 2 (every edge is considered in the procedure for finding the maximal matching!!)
Analysis(3) • From above, c(Sapx) >= c(G)/2 = (nc(G) – 2c(G)) / (2n – 4)) = (c(G) – 2c(G)) / (n – 2)) + (nc(G) – (n / 2)c(G)) / (n – 2) = c(G) / (n – 2) + (n – 2)c(G) / (n – 2) – (n / 2)c(G) / (n – 2) = (n / 2(n – 2)) * (2c(G) / n) + (1 – n / 2(n – 2)) * c(G) >= (n / 2(n – 2)) * c(Smin) + (1 – n / 2(n – 2)) * c(Smax) • Let α= n / 2(n – 2), then c(Sapx) >= αc(Smin) + (1 – α)c(Smax) so we know it is an α z-approx
Minimum Disjoint Cycle Cover • Input: an undirected graph G=(V, E). • Output: a set of vertex disjoint cycles of minimum cardinality, that span V.
Algorithm • Construct a complete graph H with vertex set V and weights • w(i, j) = 1, if i = j • w(i, j) = 0, if (i, j) belongs to E, i <> j • w(i, j) = |V| + 1, if (i, j) not belongs to E, i <> j • Compute a minimum cost cycle coverC in H. • Output C.
Analysis(1) • Q1: Polynomial time? • A1: Undirected minimum cost cycle cover is also called binary 2-matching. This can be obtained in polynomial time through LP. Integer and Combinatorial Optimization. • Q2: Feasible? • A2: It is a cycle cover, told by its name.
Analysis(2) • Q3: 1/3 z-approx? • A3: Denote the number of cycles in C by apx. • apx1: the number of cycles with a single vertex • apx2: the number of cycles with more than 1 vertex • Denote the number of cycles in one optimal solution by opt, and define opt1, opt2 as above.
Analysis(3) • Since |V| = apx1 + Σi = 1…apx2ni (ni : number of vertices in cycle i of apx2) >= apx1 + 3apx2 (number of vertices in any cycle >= 3), apx2 <= (|V| - apx1) / 3. • And, since apx1 + apx2 = apx = w(C) <= w(opt) = opt1, apx2 = 0, apx1 <= opt1. • Also, c(Smin) >= opt1 and c(Smax) = |V| = n.
Analysis(4) • From above, c(Sapx) = apx = apx1 + apx2 <= apx1 + (n – apx1) / 3 = n / 3 + 2apx1 / 3 <= n / 3 + 2opt1 / 3 <= n / 3 + 2c(Smin) / 3 = c(Smax) / 3 + 2c(Smin) / 3 = (1 – 1 / 3) * c(Smin) + 1 / 3 * c(Smax) • Let α = 1 / 3, then c(Sapx) <= (1 – α)c(Smin) + αc(Smax) so we know it is an α z-approx.
Minimum Dominating Set • Input: a graph G=(V, E). • Output: a subset U belong to (or equal to) V such that every vertex in V\U has at least one neighbor in U. • Facts: • special case of SET COVER (O(log|V|)-approx) • no constant performance guarantee unless P=NP.
Algorithm • Assumption: the graph is connected. • Construct a bipartition through any spanning tree. That is, put the vertices belong to odd levels in one side and those to even levels in the other side. • Choose the smaller part and output it.
Analysis(1) • Q1: Polynomial time? • A1: spanning trees can be found in O(|V|). • Q2: Feasible? • A2: since it is a spanning tree, any vertices are connected; and in the bipartition, every vertex in V\U has at least one neighbor in U.
Analysis(2) • Q3: ½ z-approx? • A3: Let c(Sapx) be the number of vertices output by the algorithm. • c(Sapx) <= |V| / 2 (choose the smaller part of the bipartition) • c(Smax) = |V| • c(Smin) = 0
Analysis(3) • c(Sapx) <= |V| / 2 = |V| / 2 + 0 / 2 = c(Smax) / 2 + c(Smin) / 2 = (1 – 1 / 2) * c(Smin) + 1 / 2 * c(Smax) • Let α = 1 / 2, then c(Sapx) <= (1 – α) * c(Smin) + 1 / 2 * c(Smax) so we know it is an α z-approx.