240 likes | 450 Views
Chapter 6. Relaxation. Ding-Zhu Du. (1) Superstring. What’s relaxation?. x*. Min f(x). x in Ω. x A. f(x*) < opt = min f(x) < f(x A ). x in Ω. What’s relaxation?. x*. max f(x). x in Ω. x A. f(x*) < opt = max f(x) < f(x A ). x in Ω. Traveling Salesman Problem.
E N D
Chapter 6. Relaxation Ding-Zhu Du (1) Superstring
What’s relaxation? x* Min f(x) x in Ω xA f(x*) < opt = min f(x) < f(xA) x in Ω
What’s relaxation? x* max f(x) x in Ω xA f(x*) < opt = max f(x) < f(xA) x in Ω
Traveling Salesman Problem (Given a distance table for a complete graph) relaxed tour spanning graph minimum spanning graph = minimum spanning tree tour add 0.5 opt So, the p.r. = 1.5
Directed TSP with triangular inequality (Given a distance table for a complete digraph without loop) relaxed Directed tour 1-factor (assignment) minimum assignment directed tour a directed tour connecting all cycles in 1-factor
Superstring Given n strings s1, …, sn, find a shortest string s containing every si as a substring. ov(s1,s2) = maximum overlapping of s1 and s2 s1 = suf(s1,s2) ov(s1,s2) s1 suf(s1,s2) ov(s1,s2) s2
Superstring Directed TSP vertices: s1, …, sn, sn+1 = ε distance: d(s1,s2) = |suf(si,sj)| Minimum assignment: r1 r2 rt=sn+1=ε ct c1 c2 d(ci) = total distance of cycle ci.
cycle (r1,r2, …, rt) d(cycle (r1,r2, …, rt)) = d(r1,r2) + ··· + d(rt-2,rt-1) + d(rt-1,rt) + d(rt,r1) = |suf(r1,r2)| + ··· + |suf(rt-2,rt-1)| + |rt-1| = superstring <r1,r2,…,rt-1> = Σ |ri| - |ov(r1,r2)| - ··· - |ov(rt-2,rt-1)|
<r1,r2, …, rt-1> r1 ov(r1,r2) r2 rt-1
assume <r1*,r2*, …, r(t-1)*> is opt superstring <r1,r2, …, rt-1> is obtained by Greedy Algorithm on overlapping: |ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)| < 2(|ov(r1,r2)| + ··· + |ov(rt-2,rt-1)|) |<r1,r2, …, rt-1>| < opt + 0.5(|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|)
Greedy Algorithm S ← {s1, …, sn}, while |S| > 1 do choose s and s’ from S to maximize |ov(s,s’)| and set S ← (S – {s,s’}) U {suf(s,s’)s’}, output unique string in S.
|<r1,r2, …, rt-1>| = Σ |ri| - |ov(r1,r2)| - ··· - |ov(rt-2,rt-1)| <Σ |ri| - 0.5(|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|) < |<r1*,r2*, …, r(t-1)*>| + 0.5(|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|) < opt (opt superstring for s1, …, sn) + 0.5(|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|)
Lemma. |ov(ri,rj)| < d(ci) + d(cj) If it is true, then |ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)| < 2 Σ d(ci) < 2 opt Therefore, we obtain a 3-approximation:
3-approximation Step 1. Compute a minimum assignment {c1, …, ct}. Step 2. Choose a vertex ri from ci. But, ct = sn+1=ε Step 3. Find an ordering (r1, …, rt-1) by greedy algorithm on overlapping. Step 4. Merging c1, …, ct into a Hamiltonian cycle based on the ordering (r1, …, rt-1, rt).
Lemma. |ov(ri,rj)| < d(ci) + d(cj) |ov(ri,rj)| > d(ci) + d(cj). Proof Assume We want to show ρ(ci) = ρ(cj) where ρ(c) is a root of c.
Root For a nonempty string x, ρ(x) is the shortest string y such that m x = y for some integer m > 0. For a setc of strings, ρ(c) is a string y such that every string in c is a substring of y for some m. m
Property of nonempty string root ρ(u) =ρ(v) uv = vu Proof. (by induction on |uv|) Case 1. |u| = |v|. We have u = v. Case 2. |u| > |v|. Then u = vw. So, vwv = vvw. Hence, wv = vw. Since v ≠ ε, |wv| < |uv|. By induction hypothesis, ρ(w)=ρ(v). Hence, ρ(u) = ρ(vw) = ρ(v).
1st Property of ρ(c) for string set c There exists a cycle c’ connecting all strings in c Such that d(c’) = |ρ(c)|. ρ(c) ρ(c) s1 d(s1,s2) s2 d(s2,s3) s3 d(s3,s1) s1
2nd Property of ρ(c) for string set c For any permutation (s1, …, sk) of strings in c, suf(s1, s2) suf(s2, s3) ··· suf(sk-1, sk)suf(sk, s1) is a ρ(c). s1 s2 s3 s1
3rd Property of ρ(c) for string set c Any substring of ρ(c)ρ(c) with length |ρ(c)| is a root of c. ρ(c) ρ(c) |ρ(c)|
Lemma. |ov(ri,rj)| < d(ci) + d(cj) |ov(ri,rj)| > d(ci) + d(cj). Proof Assume We want to show ρ(ci) = ρ(cj) If this is true, then cycles ciand cj can be merged Into one c with ρ(c) = ρ(ci) = ρ(cj), Contradicting the minimum of assignment.
Lemma. |ov(ri,rj)| < d(ci) + d(cj) |ov(ri,rj)| > d(ci) + d(cj). Proof Assume We want to show ρ(ci) = ρ(cj) ri u v d(ci) d(cj) v u rj d(cj) d(ci) uv = vu !