On-line problem Input arrives one at a time, and a decision is made (and cannot be changed). In the minADM problem: lightpaths arrive one at a time, and need to be colored. Competitive analysis An on-line algorithm A is c -competitive if A(I) c OPT(I) for any input sequence I. (A(I) and OPT(I) are #ADMs used by A and by an optimal offline algorithm OPT.) 6.1 on-line
When a new path arrives: 1. if can close a cycle 2. if can extend a path 3. else - assign same color - assign a new color #ADMs=7 6.2 algorithm ALG
When a new path arrives: 1. if can close a cycle 2. if can extend a path 3. else - assign same color - assign a new color
Theorem: ALG is 7/4-competitive on any topology. This is optimal even for a ring. Theorem: ALG is 3/2-competitive on a path. This is optimal.
k paths k-1 spaces: x between same color k-1-x between different colors k=12 x=6 Theorem: ALG is 3/2-competitive on a path, and this is best possible competitive ratio. 1. Lower bound
So far: any algorithm uses 2k ADMs now – a short path at each gap of diffferent colors (k-1-x such gaps) Any algorithm uses at least one more ADM for each (ALG uses exactly one) So: any algorithm ≥ 2k + (k-1-x) ADMs k=12, x=6, =5
now – two long paths at each of the k gap of same color So far: use ≥ 2k + (k-1-x) ADMs Any algorithm must use 2 ADMs for each So: any algorithm ≥ 2k + (k-1-x) + 4x = = 3k+3x-1 ADMs
OPT: the short paths ≤ 2k ADMs for the long paths 2x ADMs any algorithm/OPT 3/2 – 1/(2k) We showed: any algorithm uses ≥ 3k+3x-1 ADMs OPT 2k + 2x
OPT saves x ADMs ALG saves y ADMs 2. Upper bound
Claim: OPT – max matching at each point ≤
For the proof choose a specific OPT. Recall that OPT can choose any matching at each node. savings of OPT which are not savings of ALG Y - savings of ALG which are also savings of OPT
a b a came before b c c map 1-1
savings of S (y) Savings of S* (x)
Theorem: ALG is 7/4-competitive on any topology. This is optimal even for a ring. 1. Lower bound
Case a: 7/4=1.75
Case b: Case b1: 6/3 = 2 Case b2: 5/3 = 1.67 any algorithm ≥ 1.67 any algorithm ≥ 1.75hw:
#ADMs = N + #chains N lightpaths cycles chains Recall: 2. Upper bound
D 0 (S) – lightpath not sharing any ADM D 1 (S) – lightpath sharing ONE ADM D 2 (S) – lightpath sharing BOTH ADMs d 0 (S) = 2 d 1 (S) = 4 d 2 (S) = 19 d 0 (S) + d 1 (S) + d 2 (S) = 25 = N N=25 lightpaths Consider a solution S
S – ALG, Solution S=chains + cycles #ADMs = N + #chains
We define: and get
D 0 (S) – lightpath not sharing any ADM D 1 (S) – lightpath sharing ONE ADM D 2 (S) – lightpath sharing BOTH ADMs d 0 (S) = 2 d 1 (S) = 4 d 2 (S) = 19 d 0 (S) + d 1 (S) + d 2 (S) = 25 = N N=25 lightpaths example #ADMs=29
d 0 (S) = 2 d 2 (S) = 19 N=25 suppose #chains(OPT)=2, cost(OPT)=25+2=27
Lemmas 1. cost(S) - cost(OPT) = = N/2 + (d 0 (S)-d 2 (S)-2|chains(OPT)|)/2 2. d 0 (S) d 2 (S) + |chains(OPT)| + N/2 Combining, we have |cost(S)| - |cost(OPT)| 3N/4 3 |cost(S*)|/4 next slide previous slide Theorem: cost(S) 7cost(OPT)/4 Theorem: ALG is 7/4-competitive on any topology. This is optimal even for a ring.
Lemma 1 d 0 (S) d 2 (S) + |chains(S*)| + N/2 orient S* for any u D 0 (S) 1.if u is last in some chain of S*, map u to this chain 2.else i.u’ D 0 (S)contradiction ii.u’ D 1 (S)map u to {u, u’} iii.u’ D 2 (S)map u to u’ uu’ S*
orient S* for u D 0 (S) 1.if u is last in some chain of S*, map u to this chain 2.else i.u’ D 0 (S)contradiction ii.u’ D 1 (S)map u to {u, u’} iii.u’ D 2 (S)map u to u’ uu’ S* d 0 (S) d 2 (S) + chains(S*) + N/2