Clearly
description
Transcript of Clearly
Bertinoro, 5/5/08 1/57
Clearly
But this is a complicated way to write this.Hereby we suggest some improvement.
First lecture in Mathematics
1 + 1 = 2
Bertinoro, 5/5/08 2/57
StepStep 11
and
and
Bertinoro, 5/5/08 3/57
which is clearly more intuitive
So can be simplifid as 1 + 1 = 2
Bertinoro, 5/5/08 4/57
and
StepStep 22
Bertinoro, 5/5/08 5/57
So
can be further simplifid as
1 + 1 = 2
Bertinoro, 5/5/08 6/57
StepStep 22
and
hence
Bertinoro, 5/5/08 7/57
So eventually gets its final form: 1 + 1 = 2
Now, decide for yourself:
1. which of the forms is the simplest.
2. which of the forms will make your career faster?
3. which of the forms will mostly impress your
boss/boyfriend/girlfriend/mother?
Bertinoro, 5/5/08 8/57
We are given lightpathswe want to get a coloring SS such that cost(S)cost(S) is minimal.What is cost(S)cost(S) ?
1.21.2. . Cost Cost functionsfunctions
Bertinoro, 5/5/08 9/57
1. number of wavelengths
#colors = 4
1.21.2. . Cost Cost functionsfunctions
Bertinoro, 5/5/08 10/57
ADM
OADM
#ADMs + #OADMs
2. Switching cost
Bertinoro, 5/5/08 11/57
ADM
OADM
#ADMs + #OADMs = 12 + 8
Bertinoro, 5/5/08 12/57
but number of OADMs is fixed, so …
Bertinoro, 5/5/08 13/57
2. number of ADMs
#ADMs = 12
Bertinoro, 5/5/08 14/57
#ADMs=12 #ADMs=9
Bertinoro, 5/5/08 15/57
#ADMs=12
#colors=4
#ADMs=9
#colors=3
Trade-off between #colors and #ADMs
Bertinoro, 5/5/08 16/57
#ADMs=8
#colors=2
#ADMs=7
#colors=3
Bertinoro, 5/5/08 17/57
g=2
#ADMs=9
#ADMs=8
With grooming
Bertinoro, 5/5/08 18/57
Minimize the number of ADMs Minimize the number of ADMs with and without groomingwith and without grooming ComplexityComplexity special networks, general networksspecial networks, general networks Approximation algorithmsApproximation algorithms on-lineon-line
1.31.3. P. Problems in this roblems in this talktalk
Bertinoro, 5/5/08 19/57
RingRingFlammini, Moscardeli, Gianpierro, Shalom, Z.
2005/6/7
ln g
Traffic Traffic GroomingGrooming
Shalom, Wong, Zaks, 2007
On-line On-line
74
Bertinoro, 5/5/08 20/57
ALG 2N N OPT ALG 2 x OPT
N: # of lightpathsALG: #ADMs used by the algorithmOPT: #ADMs used by an optimal solution
2.1 approximation 2.1 approximation ratioratio
Bertinoro, 5/5/08 21/57
w/out grooming: N ALG 2N N OPT 2N
ALG 2 x OPT
R: # of lightpathsALG: #ADMs used by the algorithmOPT: #ADMs used by an optimal solution
w/ grooming: N/g ALG
2N N/g OPT
2N ALG 2g x OPT
Bertinoro, 5/5/08 22/57
#ADMs = N + #chains
N lightpaths
cycles
chains
2.2 Basic 2.2 Basic relationrelation
Cycles are good, chains are bad
Bertinoro, 5/5/08 23/57
In the approximation algorithms there are two common techniques for saving ADMs:
Eliminate cycles of lightpaths Find matchings of lightpaths
#ADMs = N + #chains
Bertinoro, 5/5/08 24/57
cost(S) = N + chains=13+6=19 Every path costscosts 1 ADM
cost(S) = 2N-savings=26-7=19 Every connection savessaves 1 ADM
N lightpaths
2.3 2.3 NoteNote
N=13
Min ADM problem: (cost=#ADMs)(cost=#ADMs)
Connections are good, chains are bad
Bertinoro, 5/5/08 25/57
Assume that an optimal solution S* saves x ADMs,
and a solution S saves y ADMs
³
£
cost(S*) if y then
k1
cost(S) (2- )cost(S*)k
Lemma:
2.4 a basic 2.4 a basic lemmalemma
³
£
cost(S*) if y then
23
cost(S
f o
)
r example:
cost2
(S*)
Bertinoro, 5/5/08 26/57
Optimal solution S* saves x ADMsa solution S saves y ADMs
³ ³
= £ £ = =
cost(S*) Ny
k k
cost(S) = 2N - y
cost(S*) =2N - x
N N N2N - 2N - 2N -2N - ycost(S) 1k k k 2-
cost(S*) 2N - x 2N - x 2N -N N k
Bertinoro, 5/5/08 27/57
D0(S) – lightpath not sharing any ADM
D1(S) – lightpath sharing ONE ADM
D2(S) – lightpath sharing BOTH ADMs
d0(S) = 2
d1(S) = 4
d2(S) = 19
d0(S) + d1(S) + d2(S) = 25 = N
N=25 lightpaths
2.5 2.5 notaton
Bertinoro, 5/5/08 28/57
S – ALG, S* - OPT
0 1 2d (S)+d(S)+d (S) =N
0 110
2d (S)+d (S)-2#chains(S*)d (S)=d (S)+ - #chains(S*) =
2 2
0 2N +d (S)- d (S)-2#chains(S*)=
2
Solution S=chains + cycles
#ADMs = N + #chains
cost(S)- cost(S*) =#chains(S)- #chains(S*) =
0 2d (S)- d (S)-2#chains(S*)1N(1+ )
2 N
0 1 0 22d (S)+d(S) =N +d (S)- d (S)
2.6 a basic 2.6 a basic tooltool
Bertinoro, 5/5/08 29/57
We define:
and get
= 0 2d (S)- d (S)-2 #chains(S*)ε(S)
N
1cost(S) =cost(S*)+ N(1+ε(S))
2
0 2d (S)- d (S)-2#chains(S*)1N(1+ )
2 Ncost(S)- cost(S*) =
Bertinoro, 5/5/08 30/57
D0(S) – lightpath not sharing any ADM
D1(S) – lightpath sharing ONE ADM
D2(S) – lightpath sharing BOTH ADMs
d0(S) = 2
d1(S) = 4
d2(S) = 19
d0(S) + d1(S) + d2(S) = 25 = N
N=25 lightpaths
2.7 2.7 exampleexample
#ADMs=29
Bertinoro, 5/5/08 31/57
= =
=-
0 2d (S)- d (S)-2 #chains(S*)ε(S)
2-19- 4 21N
25 25
d0(S) = 2
d2(S) = 19
N=25
suppose #chains(S*)=2, cost(S*)=25+2=27
1 25 21cost(S) =cost(S*)+ N(1+ε(S)) =cost(S*)+ (1- ) =
2 2 25cost(S*)+2=29
Bertinoro, 5/5/08 32/57
path of length 2
3.3 minADM with grooming is NP-complete 3.3 minADM with grooming is NP-complete
for a starfor a star
path of length 1
Bertinoro, 5/5/08 33/57
path of length 2
path of length 1
Star, g=1( trivial )
Bertinoro, 5/5/08 34/57
The number of used ADM is exactly equal to the lower bound of needed ADM:
é ùê ú
é ùê úê úê úê úê ú ê úê ú
ê úê ú
åå
n
i ni ii=1
i=1
yx +y
+2 2node
0
nodes 1,…,n
01
n
2
ixi paths of length
2
yi paths of length
1
Star, g=2
Bertinoro, 5/5/08 35/57
Sketch for g=3:
3-Exact Cover
Edge Partition into 3-regular graphs
Star grooming, g=3
Star, g≥3 - NP-complete
Bertinoro, 5/5/08 36/57
3-Exact Cover:
Input:Input: set A of size 3n, and a collection S of subsets of A of size 3 each.
Output:Output: are there n subsets in the collection S that cover A?
Bertinoro, 5/5/08 37/57
Edge Partition into 3-regular graphs:
Input:Input: undirected graph G = (V,E).
Output:Output: can E be partitioned into subsets E1,…,Em , each inducing a 3-regular subgraph G=(Vt,Et), t=1,…,m ?
Bertinoro, 5/5/08 38/57
3-Exact Cover
Edge Partition into 3-regular graphs
Star grooming, g=3
Bertinoro, 5/5/08 39/57
sets
elements
Bertinoro, 5/5/08 40/57
3-Exact Cover
Edge Partition into 3-regular graphs
Star grooming, g=3
Bertinoro, 5/5/08 41/57
Claim: there exists a solution using at most 2|E|/3 ADMs iff the edges of G can be partitioned into 3-regular graphs.
0
1
2
1
2
4
3
3
4
G S
Bertinoro, 5/5/08 42/57
2
1
5 4
3
5 4
3
2
10
g=2=2
Bertinoro, 5/5/08 43/57
Preprocessing: While there is a cycle C of length ≤
do: Remove (the lightpaths of) C from the
instance
Processing: Designate each lightpath as a chain Do
Build the matching graph M of the chains Find a maximum matching MM of M Combine chains according to MM
Until M has no edges
4.1 basic algorithm4.1 basic algorithm
eliminate short cycles, then find matchings
( )PI M l
Bertinoro, 5/5/08 44/57
The running time of the algorithm is exponential in due to the preprocessing phase
By removing the preprocessing phase (=1) we obtain algorithm PIM(1)
Recall:
= 0 2d (S)- d (S)-2 #chains(S*)ε(S)
N
1cost(S) =cost(S*)+ N(1+ε(S))
2
Bertinoro, 5/5/08 45/57
algorithm PIM()
( ) (1 )2
NPIM OPT l
10
2
l
Bertinoro, 5/5/08 46/57
1
2= £
+0 2d (S)- d (S)-2 #chains(S*)
ε(S)N l
2£ £
+0 2 0 2
Nd (S)- d (S)-2 #chains(S*) d (S)- d (S)- #chains(S*)
l
Need to prove:
We will show:
Bertinoro, 5/5/08 47/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
Take S*:
in the example :
38 lightpaths, 5 chains, 3 cycles
Bertinoro, 5/5/08 48/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
preprocessing stage of S: eliminate cycles of
The lightpaths that we used are colored red:
£size l . . .
in the example : 10 lightpaths are used to form cycles in S
Bertinoro, 5/5/08 49/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
So, after preprocessing stage of S: in S* we have the following lightpaths:
Bertinoro, 5/5/08 50/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
Now the algorithm is doing MM,MM,MM,…
We show that already after the first MM we are ok.
Bertinoro, 5/5/08 51/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
We show that in the remaining lightpaths there is a
MM’ ≤ MM that is ok.
Bertinoro, 5/5/08 52/57
in the example : 0d (S) =8
0d (S) - number of isolated lightpaths
1 for each odd path and for each odd cycle
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
Bertinoro, 5/5/08 53/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
0 0 0d (S) = d (odd cycles)+d (odd chains)
2£
+0
Nd (odd cycles)
l
£0 2d (odd chains) d (S)+ #chains(S*)
Which implies
Show:
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
Bertinoro, 5/5/08 54/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
2£
+0
Nd (odd cycles)
l
Since there are at most N lightpath left, and each odd cycle is of size at least 2+l
Bertinoro, 5/5/08 55/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
1. Original chain of S* that was untouched
£0 2d (odd chains) d (S)+ #chains(S*)
1 here is matched with 1 here
Bertinoro, 5/5/08 56/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
2. A a chain of S* that was partitioned into t parts
£0 2d (odd chains) d (S)+ #chains(S*)
t-1 here are matched with t-1 here
1 here is matched with 1 here
Bertinoro, 5/5/08 57/57
2£
+0 2
Nd (S)- d (S)- #chains(S*)
l
3. A a cycle S* that was partitioned into t parts
£0 2d (odd chains) d (S)+ #chains(S*)
Each 1 here is matched with at least 1 here
Bertinoro, 5/5/08 58/57
Preprocessing: While there is a cycle C of length ≤ do:
Remove (the lightpaths of) C from the instance
Processing: Designate each lightpath as a chain Do
Build the matching graph M of the chains Find a maximum matching MM of M Combine chains according to MM
Until M has no edges
4.2 basic algorithm without 4.2 basic algorithm without preprocessingpreprocessing
PIM(l)
Bertinoro, 5/5/08 59/57
This is optimal.
£1
ε5
£ +3
PI M(1) OPT N5
1cost(S) =cost(S*)+ N(1+ε(S))
2
Without preprocessing:
Bertinoro, 5/5/08 60/57
Upper bound
Recall: and
to show that
we prove that (S) ≤ 1/5
0 2d (S)- d (S)-2#chains(S*)ε(S) =
N1
cost(S) =cost(S*)+ N(1+ε(S))2
£ +3
PI M(1) OPT N5
Bertinoro, 5/5/08 61/57
Orient the chains and cycles of S*.
Bertinoro, 5/5/08 62/57
Let LAST be the set of nodes which are last elements of the chains according to this orientation.
Bertinoro, 5/5/08 63/57
By mapping a path in D0(S) to either
a path of D2(S)or to a chainor to a cycle of size ≥ 5
£0 2d (S)- d (S)-2#chains(S*) 1ε(S) =
N 5
£
£
0 2
0 2
show:
Nd (S)- d (S)-2#chains(S*)
5or
Nd (S) d (S)+#chains(S*)+
5
Bertinoro, 5/5/08 64/57
The Mapping
0 ( )p D SÎ
q0=p
If q0 is the last node of a path of S* then:
p’=q0
map p to p’
return
Otherwise, q1 is the next node in q0’s path/cycle in S*
q1
q1 can not be in D0(S), otherwise the algorithm would add the edge (q0,q1) to the matching.If q1 is in D2(S) then:
p”=q1
map p to p”
return
q2
Otherwise q1 has exactly one neighbor q2 in GS. Obviously q2 is not in D0(S).
If q2 is in D2(S) then:
p”=q2
map p to p”
return
If q2 is the last node of a path of S* then:
p’=q2
map p to p’
return
Otherwise, q3 is the next node in q2’s path/cycle in S*
q3
q3 can not be in D0(S), otherwise the above path would be an augmenting path of the maximum matching found by the algorithm.
As the graph is finite, this process continues until p is mapped, or we re-encounter a node. In this case:
C = {qi}
Map p to C
return
It is easy to see that |C| is odd. We also show that |C| > 3.
Bertinoro, 5/5/08 65/57
Algorithm
¬ ÈS S {A}
Input: Graph G, set of lightpaths P, g > 0
Step 1: Choose a parameter k = k(g).
Step 2: Consider all subsets of P of size
If a subset A is 1-colorable (i.e., any edge is used at most g times) then
weight[A]=endpoints(A)
£ ×k g
5.1 5.1 algorithm algorithm
Bertinoro, 5/5/08 66/57
Step 3: COVER an approximation to the Minimum Weight Set Cover of S
Step 4: Convert COVER to a PARTITION
Output: the coloring induced by PARTITION
S – collection of all legal sets of at most kg lightpaths, each with its switching cost.
Bertinoro, 5/5/08 67/57
Legal coloring
For any fixed g, the number of subsets constructed in the first phase is g kO n
Bertinoro, 5/5/08 68/57
Legal coloring
, B is 1-colorable
A is 1-colorable ( correctness).
(and cost(A) cost(B).)
A B
5.2 analysis: ln(g)-approximation for a 5.2 analysis: ln(g)-approximation for a ringring
Bertinoro, 5/5/08 69/57
k g
cost(PARTI TI ON)
weight(COVER)
H weight(MI NCOVER)
(1+ln(k g))weight
ALG=
(SC)
for every set cover SC.
Bertinoro, 5/5/08 70/57
Lemma: There is a set cover SC, s.t.: 2g
weight(SC) 1+ Ok
PT
=cost(PARTI TI ON)
(1+ln(k g)) weigh
AL
C
G
t(S )
Bertinoro, 5/5/08 71/57
k g
cost(PARTI TI ON)
weight(COVER)
H weight(MI NCOVE
ALG=
SC
R)
(1+ln(k g))weight( )
2g(1+ln(k g)) 1+
kOPT
Conclusion:
For k = g ln g : 2lng+ALGOP
)T
o(lng
Bertinoro, 5/5/08 72/57
Lemma: There is a set cover SC, s.t.:
2gweight(SC) 1+ O
kPT
5.3 proof of 5.3 proof of lemma lemma
Bertinoro, 5/5/08 73/57
Consider OPT x - a color of OPT. Px - paths colored x. endpoints(Px) - the set of ADMs operating at wavelength x. (assume |endpoints(Px)|= ) Partition endpoints(Px) into m sets of k consecutive nodes in the example: k=5, m=4
m k
Use OPT to build SC
Bertinoro, 5/5/08 74/57
k k k k
iweight[S ] k+g k g
S1 S2 Sm
M=4 k=5
{paths starting at S1}, {paths starting at S2}, …,
{paths starting at Sm}
Each of these sets was in S !
All these sets, for all colors, cover A
Bertinoro, 5/5/08 75/57
i
m
ii=1
m
i xi=1
weight[S ] k+g
weight[S ] m(k+g)
( OPT =m k)
gweight[S ] OPT 1+
k
x
w/o the assumption we have: m
i xi=1
2gweight[S ] OPT 1+
k
1
m
ii
2gweight[S ] OPT 1+
k
x
Bertinoro, 5/5/08 76/57
undirected:
ALG 2ln( g) OPT
directed:
ALG 2lng OPT
5.4 trees 5.4 trees
Bertinoro, 5/5/08 77/57
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-line6.1 on-line
Bertinoro, 5/5/08 78/57
When a new path arrives:1. if closes a unicolor cycle2. if any endpoint colored3. else (no side colored)
- assign same color
- assign same color- assign a new color
#ADMs=7
6.2 algorithm ALG6.2 algorithm ALG
Bertinoro, 5/5/08 79/57
3
2
32
21
When a new path arrives:
1. if closes a unicolor cycle2. if any endpoint colored3. else (no side colored)
- assign same color- assign same color
- assign a new color
32
Bertinoro, 5/5/08 80/57
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.
6.3 6.3 ResultsResults
Bertinoro, 5/5/08 81/57
ALG: ADM=7
OPT: ADM=4
ALG ≥ 7/4
6.4 ALG 6.4 ALG ≥ 7/4 even for a ring
Bertinoro, 5/5/08 82/57
k paths
k-1 spaces:
x between same colork-1-x between different colors
k=12
x=6
6.5 any algorithm for a path 6.5 any algorithm for a path ≥ 3/2
Bertinoro, 5/5/08 83/57
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, 12-1-6=5
Bertinoro, 5/5/08 84/57
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
Bertinoro, 5/5/08 85/57
OPT: the short paths ≤ 2k ADMsfor the long paths 2x ADMs
any algorithm/OPT 3/2 – 1/(2k)
We showed: any algorithm uses ≥ 3k+3x-1 ADMs
OPT 2k + 2x
Bertinoro, 5/5/08 86/57
Optimal solution S* saves x ADMsOur solution S saves y ADMs
) ) )
)
£ = £ £
Þ £
cost(S)- cost(S*) =(2N - y)- (2N - x) =
x 1 1 1=x- y x - (1
Proo
- (1- (1-k k k k
1c
x N
ost(S) cost(S*
cost(
)(2
S )
f
-
:
k
*
³ Þ £x 1
y cost(S) (2- )cLem ost(S*)k k
ma: ≤ -> ≤
≤ ≤ ≤
≤£ £ x N costNote: (S*)
6.6 ALG for a path 6.6 ALG for a path ≤ 3/2
Bertinoro, 5/5/08 87/57
³
£
x if y then
k1
cost(S) (2- )co
Lemma
k
:
st(S*)
³x
y2
We show that
Þ £3
cost(S) cost(S*)2
≤
≤
≤
≤
Bertinoro, 5/5/08 88/57
³x
y2
Claim:
optimal S* – max matching at each point
≤
Bertinoro, 5/5/08 89/57
For the proof choose a specific S*
savings of S* (x)savings of S (y)
Bertinoro, 5/5/08 90/57
a b
a came before bc
c
map
1-1
Bertinoro, 5/5/08 91/57
savings of S (y)
³ 2
³x
y2
Savings of S* (x)
≤
≤
Bertinoro, 5/5/08 92/57
Lemmas
1. cost(S) - cost(S*) =
= N/2 + (d0(S)-d2(S)-2|chains(S*)|)/2
2. d0(S) d2(S) + |chains(S*)| + N/2
Combining, we have
|cost(S)| - |cost(S*)| 3N/4 3 |cost(S*)|/4
next slide
previous slide
Theorem: cost(S) 7cost(S*)/4
6.7 ALG is 6.7 ALG is 7/4-competitve for any topology
Bertinoro, 5/5/08 93/57
Lemma 1 d0(S) d2(S) + |chains(S*)| + N/2orient S*
for any u D0(S)
1. if u is last in some chain of S*, map u to this chain
2.else
i. u’ D0(S) contradiction
ii. u’ D1(S) map u to {u, u’}
iii.u’ D2(S) map u to u’
u u’S*
Bertinoro, 5/5/08 94/57
Case a:
7/4=1.75
6.8 6.8 lower bound of lower bound of 7/4 , even for a ring
Bertinoro, 5/5/08 95/57
Case b: Case b1:
6/3 = 2
Case b2: 5/3 = 1.67
any algorithm ≥ 1.67 any algorithm ≥ 1.75-
Exercise:
Bertinoro, 5/5/08 96/57
K M
C
HBDG
EFG
A
D
F
E
G
B
6.9. 6.9. a simpler lower bound of 7/a simpler lower bound of 7/4 (not for a ring)
so: BDG
Bertinoro, 5/5/08 97/57
K M
C
HBDG
EFG
A
D
F
E
G
B
Bertinoro, 5/5/08 98/57
K M
C
HBDG
EABDG
GFEAB
EFG
A
D
F
E
G
B
#ADMS=7
#OPT=4
Competitive Ratio: 7/4Competitive Ratio: 7/4
Bertinoro, 5/5/08 99/57
K M
C
HBDG
EFG
A
D
F
E
G
B
#ADMS=6
#OPT=3
Competitive Ratio: 6/3 > 7/4Competitive Ratio: 6/3 > 7/4
BAE
so: BAE
Bertinoro, 5/5/08 100/57
K M
C
HBDG
EFG
A
D
F
E
G
B
BAE
EFKMHG
so: EFKMHG
Bertinoro, 5/5/08 101/57
K M
C
HBDG
EFG
A
D
F
E
G
B
BAE
EFKMHG
Bertinoro, 5/5/08 102/57
K M
C
HBDG
EFG
A
D
F
E
G
B
BAE
EFKMHG
EABDCHG#ADMS=9
#OPT=5
Competitive Ratio: 9/5 > 7/4Competitive Ratio: 9/5 > 7/4
Bertinoro, 5/5/08 103/57
K M
C
HBDG
EFG
A
D
F
E
G
B
BAE
EFKMHG
Hw: finish this case
Bertinoro, 5/5/08 104/57
K M
C
HBDG
EFG
A
D
F
E
G
B
BAE
Hw: finish this case
Bertinoro, 5/5/08 105/57
#colors=2, #ADMs=8
#colors=3, #ADMs=7
1st open problem: what can be said about the trade-off between #colors and #ADMs=8 ?
Bertinoro, 5/5/08 106/57
Optimal solution S* saves x ADMsOur solution S saves y ADMs
ALG, path ≤ 3/2
³
£
cost(S*) if y then
k1
cost(S) (2- )cost(S*)k
Lemma:
Bertinoro, 5/5/08 107/57
Optimal solution S* saves x ADMsOur solution S saves y ADMs
³ ³
= £ £ = =
cost(S*) Ny
k k
cost(S) = 2N - y
cost(S*) =2N - x
N N N2N - 2N - 2N -2N - ycost(S) 1k k k 2-
cost(S*) 2N - x 2N - x 2N -N N k
Bertinoro, 5/5/08 108/57
Optimal solution S* saves x ADMsOur solution S saves y ADMs
,³ £
= £ = =
xy x N
k
cost(S) = 2N - y
cost(S*) =2N - x
x x2N - 2N -2N - ycost(S) k k
cost(S*) 2N - x 2N -N N
x=2-
Nk
Bertinoro, 5/5/08 109/57
On-line algorithms
when a request arrives: if no endpoint common with others then assign a new color if one endpoint in common with other(s)
then assign same color if two endpoints in common with others
then assign one of the colors
Bertinoro, 5/5/08 110/57
Recall Algorithm ALG When a new path arrives:
if closes a unicolor cycle if closes a unicolor path if any endpoint colored
else (no side colored)
- assign same color
- assign same color
- assign same color
- assign a new color
ADM=7
Bertinoro, 5/5/08 111/57
ALG-TRIANGLEWhen a lightpath arrives1. if p is length-2
if closes unicolor cycle, assign same color else assign new color
2. if p is length-1 if closes unicolor cycle containing length-2
lightpath p’, assign same color if there are two unmarked length-1
lightpaths p’ & p’’ with different color, assign to color of either p’ or p’’ and mark p, p’, p’’
else assign new color
Bertinoro, 5/5/08 112/57
When a new path arrives:if closes a unicolor cycleif closes a unicolor pathif any endpoint colored
else (no endpoint colored)
- assign same color
- assign same color
- assign same color
- assign a new color
Bertinoro, 5/5/08 113/57
Optimal solution S* saves x ADMsOur solution S saves y ADMs
,³ £
= £ = =
xy x N
k
cost(S) = 2N - y
cost(S*) =2N - x
x x2N - 2N -2N - ycost(S) k k
cost(S*) 2N - x 2N -N N
x=2-
Nk
Bertinoro, 5/5/08 114/57
ONLINE COLORING – INPUT 2
w(BDG)=2
w(BAE)=1
w(EFKMHG)=2
w(EFG)=1
Total ADMS: 0
w(GFEAB)=3
w(EABDG)=4
w(BDGFE)=5
w(EABCDG)=6
24568101214
K M
H
DF
E
G
BA C
Bertinoro, 5/5/08 115/57
OFFLINE COLORING – INPUT 2
w(BDG)=2
w(BAE)=3
w(EFKMHG)=4
w(EFG)=1
Total ADMS:
w(GFEAB)=2
w(EABDG)=1
w(BDGFE)=3
w(EABCDG)=4K M
H
DF
E
G
BA C
Competitive Ratio: 14/8=7/4
Competitive Ratio: 14/8=7/4
8
Bertinoro, 5/5/08 116/57
ONLINE COLORING – INPUT 3
w(BDG)=2
w(BAE)=1
w(EFKMHG)=3
w(EFG)=1
Total ADMS: 0
w(EABDCHG)=4
24579
K M
H
DF
E
G
BA C
Bertinoro, 5/5/08 117/57
OFFLINE COLORING – INPUT 3
w(BDG)=2
w(BAE)=1
w(EFKMHG)=3
w(EFG)=1
Total ADMS: 0
w(EABDCHG)=4
5
K M
H
DF
E
G
BA C
Competitive Ratio: 9/5 >7/4
Competitive Ratio: 9/5 >7/4
Bertinoro, 5/5/08 118/57
ONLINE COLORING – INPUT 4
w(BDG)=2
w(BAE)=2
w(BDCHG)=1
w(EFG)=1
Total ADMS: 0
w(EABDG)=3
24568
K M
H
DF
E
G
C
w(GFEAB)=4
w(GKFEAB)=5
w(EFGDB)=6
101214
BA
Bertinoro, 5/5/08 119/57
OFFLINE COLORING – INPUT 4
w(BDG)= 2
w(BAE)=3
w(BDCHG)=4
w(EFG)=1
Total ADMS: 8
w(EABDG)=1
K M
H
DF
E
G
C
w(GFEAB)=4
w(GKFEAB)=2
w(EFGDB)=3
BA
Competitive Ratio: 14/8=7/4
Competitive Ratio: 14/8=7/4
Bertinoro, 5/5/08 120/57
ONLINE COLORING – INPUT 5
w(BDG)=2
w(BAE)=2
w(BDCHG)=3
w(EFG)=1
Total ADMS: 0
w(GHMKFEAB)=4
24579
K M
H
DF
E
G
BA C
Bertinoro, 5/5/08 121/57
OFFLINE COLORING – INPUT 5
w(BDG)=2
w(BAE)=1
w(BDCHG)=1
w(EFG)=1
Total ADMS: 5
w(GHMKFEAB)=2
K M
H
DF
E
G
BA C
Competitive Ratio: 9/5>7/4
Competitive Ratio: 9/5>7/4