430 likes | 556 Views
Chapter 2 Greedy Strategy. I. Independent System. Max Weight Hamiltonian Cycle (M AX -HC). Given an edge-weighted complete graph, find a Hamiltonian cycle with maximum total weight. Greedy Strategy : Select max-weight edge that forms a partial HC (i.e., a subgraph of degree at most 2)
E N D
Chapter 2 Greedy Strategy I. Independent System
Max Weight Hamiltonian Cycle(MAX-HC) • Given an edge-weighted complete graph, find a Hamiltonian cycle with maximum total weight. • Greedy Strategy: Select max-weight edge that forms a partial HC (i.e., a subgraph of degree at most 2) • What is the performance of this greedy algorithm? Answer: p.r. = 2
Lemma • Consider a subset F of edges. For any two maximal subsets I and J of F of degrees at most 2, |J| < 2|I|
How to use this lemma to get p.r. < 2? Note |J| < 2 |I| is about the number of edges in I and J, without considering their weights. However, by Greedy Strategy, edges in I are supposed to be the ones with the maximum weights. So, total weight in J is at most twice of the total weight in I. Formal proof: use Independent Systems.
Max and Min • Min f is equivalent to Max –f. • However, a good approximation for Min f may not be a good approximation for Max –f. • For example, consider a graph G=(V,E). C is a minimum vertex cover of G if and only if V-C is a maximum independent set of G. The minimum vertex cover has a polynomial-time 2-approximation, but the maximum independent set has no constant-bounded approximation unless NP=P.
Analysis of Greedy Strategy for Max and Min Problems • Max --- Independent Systems • Min --- Submodular Potential Functions
Independent System • Consider a set E and a collection C of subsets of E. (E,C) is called an independent system if • A member A of C is called an independent subset.
Maximization Find an independent subset with the max weight + • c: E→R max c(A) s.t. AεC • c(A) = ΣxεAc(x)
Theorem (Here, u(F) and v(F) are different from those of the textbook.)
Back to MAX-HC • Given an edge-weighted complete graph, find a Hamiltonian cycle with maximum total weight.
Independent sets • E = {all edges} • A subset of edges is independent if it is a Hamiltonian cycle or a vertex-disjoint union of paths. • Our lemma shows that for any two maximal independent sets I, J of any F, |J| < 2 |I|. • So, u(F) < 2 v(F).
Maximum Weight Directed Hamiltonian Cycle • Given an edge-weighted complete digraph, find a Hamiltonian cycle with maximum total weight. • Performance ratio = 3.
Independent sets • E = {all edges} • A subset of edges is independent if it is a directed Hamiltonian cycle or a vertex-disjoint union of directed paths.
Tightness ε 1 1 1 1+ε
Matroid • An independent system (E,C) is called a matroid if for any subset F of E, u(F)=v(F). Theorem An independent system (E,C) is a matroid iff for any cost function c( ), the greedy algorithm MAX gives a maximum solution.
Example 2 E = a finite set of vectors C = the family of linearly independent subsets of E Then, (E,C) is a matroid, because all maximal independent subset of a subset F have the same size rank(F).
Example 3. Graph Matroid • Let G=(V,E) be a graph, and C the family of edge sets of acyclic subgraphs of G. • Then, (E,C) is a matroid. • Note: A maximal indep set in F (subset of E) is just the family of MSTs of subgraph H=(V,F).
Theorem • Every independent system is an intersection of a finite number of matroids.
Circuit • A minimal dependent set is called a circuit. • Let A1, …, Ak be all circuits of independent system (E,C). • Let
Theorem • If independent system (E,C) is the intersection of k matroids (E,Ci), then for any subset F of E, u(F)/v(F) <k.
Applications • Many combinatorial optimization problem can be represented as an intersection of matrods. (see Lawler: Combinatorial Optimization and Matroid.)
Max-DHP (revisited) • The independent system of MAX-DHP (E,C) is the intersection of the following matroids: • C1 : All subgraphs with all out-degrees < 1. • C2 : All subgraphs with all in-degrees < 1. • C3 : All subgraphs that do not have a cycle (ignoring the edge direction). (Graph matroid) • It follows that the greedy algorithm for Max-DHP has p.r. 3
Quadrilateral Condition • If c satisfies the following condition: Then the greedy approximation for MAX-DHC has performance ratio 2.
u v’ u’ v
Superstring • Given n strings s1, s2, …, sn, find a shortest string s containing all s1, s2, …, sn as substrings. • No si is a substring of another sj.
Overlap • |ov(u,v)| = max{|w| | there exist x and y such that u=xw and v=wy} • Overlapping graph is a complete directed digraph: V = {s1, s2, …, sn} |ov(si, sj)| is edge weight.
The quadrilateral condition u’ v u v’
Theorem • The Greedy approximation MAX for maximum Hamiltonian path in overlapping graph has performance ratio 2. • So, ||S|| - |s*| < 2 (||S|| - |sG|), where ||S|| is the total length of all strings. • Conjecture: |s*| < 2 |sG|