Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

24
Chapter 6. Relaxation (1) Superstring Ding-Zhu Du

Transcript of Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Page 1: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Chapter 6. Relaxation

(1) Superstring

Ding-Zhu Du

Page 2: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

What’s relaxation?

Min f(x)

x*

xA

f(x*) < opt = min f(x) < f(xA)

x in Ω

x in Ω

opt

xfxf

opt

optxf

opt

xf AAA *)()(1

)(1

)(

Page 3: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

What’s relaxation?

max f(x)

x*

xA

f(x*) < opt = max f(x) < f(xA)

x in Ω

x in Ω

)*)(

)(*)(1/(1

))(*)(

1/(1))(

1/(1)(

xf

xfxf

opt

xfxf

opt

xfopt

xf

opt

A

AA

A

Page 4: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Traveling Salesman Problem

tour spanning graph minimum spanning graph = minimum spanning tree tour

relaxed

add 0.5 opt

So, the p.r. = 1.5

(Given a distance table for a complete graph)

Page 5: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Directed TSP with triangular inequality

Directed tour 1-factor (assignment) minimum assignment directed tour

relaxed

a directed tour connecting all cyclesin 1-factor

(Given a distance table for a complete digraph without loop)

Page 6: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

TSP in Digraph

Page 7: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Superstring

Given n strings s1, …, sn, find a shortest string scontaining every si as a substring.

ov(s1,s2) = maximum overlapping of s1 and s2

s1 = suf(s1,s2) ov(s1,s2)

ov(s1,s2)suf(s1,s2)

s1

s2

Page 8: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Superstring Directed TSP

vertices: s1, …, sn, sn+1 = ε

distance: d(s1,s2) = |suf(si,sj)|

r1 r2 rt=sn+1=ε

Minimum assignment:

c1 c2 ct

d(ci) = total distance of cycle ci.

Page 9: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

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)|

Page 10: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

<r1,r2, …, rt-1>r1

r2

rt-1

ov(r1,r2)

Page 11: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

< 2(|ov(r1,r2)| + ··· + |ov(rt-2,rt-1)|)

assume <r1*,r2*, …, r(t-1)*> is opt superstring

<r1,r2, …, rt-1> is obtained by Greedy Algorithm on overlapping:

+ 0.5(|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|)< opt

|<r1,r2, …, rt-1>|

|ov(r1*,r2*)| + ··· + |ov(r(t-2)*,r(t-1)*)|

Page 12: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

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.

Page 13: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

|<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)*)|)

+ 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)

Page 14: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

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:

Page 15: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

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).

Page 16: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Lemma. |ov(ri,rj)| < d(ci) + d(cj)

Proof Assume |ov(ri,rj)| > d(ci) + d(cj).

We want to show ρ(ci) = ρ(cj)

where ρ(c) is a root of c.

Page 17: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Root

For a nonempty string x, ρ(x) is the shortest string y such that

x = y m

for some integer m > 0.

For a set c of strings, ρ(c) is a string y such that every

string in c is a substring of y for some m.m

Page 18: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Property of nonempty string root

uv = vu ρ(u) =ρ(v)

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).

Page 19: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

1st Property of ρ(c) for string set c

There exists a cycle c’ connecting all strings in cSuch that d(c’) = |ρ(c)|.

ρ(c) ρ(c)

s1

s2

s3

d(s1,s2)

d(s2,s3)

s1d(s3,s1)

Page 20: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

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

Page 21: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

3rd Property of ρ(c) for string set c

Any substring of ρ(c)ρ(c) with length |ρ(c)| is a root of c.

ρ(c) ρ(c)

|ρ(c)|

Page 22: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Lemma. |ov(ri,rj)| < d(ci) + d(cj)

Proof Assume |ov(ri,rj)| > d(ci) + d(cj).

We want to show ρ(ci) = ρ(cj)

If this is true, then cycles ci and cj can be merged

Into one c with ρ(c) = ρ(ci) = ρ(cj), Contradicting the minimum of assignment.

Page 23: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Lemma. |ov(ri,rj)| < d(ci) + d(cj)

Proof Assume |ov(ri,rj)| > d(ci) + d(cj).

We want to show ρ(ci) = ρ(cj)

ri

rj

d(cj) d(ci)

d(cj)d(ci)

u

v u

v

uv = vu !

Page 24: Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.

Thanks, End