Upload
piers-wiggins
View
220
Download
0
Embed Size (px)
Citation preview
1
Convex Recoloring of Trees
Reuven Bar-YehudaIdo Feldman
2
Convex Coloring
A Coloring is Convex if each color induces a block.
Convex Coloring
Non-Convex Coloring
3
Problem Definition
Input: Colored Tree (T,,W) Output: Convex Coloring ’ Cost: Weight of recolored
vertices
Cost=2
4
is a cover if there is a recoloring which changes only vertices from .
X V
Coloring Cover
X
5
Formal Definition Input: Weight vector W, Tree T, Coloring
. Output: Coloring Cover . Cost:
4
1
3
6
2
5
87 9
0,1n
xw x
0
1
1 0
0 00
0 0
Cost=2+9=11
6
Motivation Phylogenetic trees
Each node represents a specie Each color represents an attribute “Real world” examples are convex
Linguistics
Strongly NP complete [Moran,Snir] Hardness holds for strings Exponential Algorithms / Polynomial Approximations
7
r-approximation Given a weight vector w, Tree T, Coloring .
Minimize w∙xSubject to: x is a coloring cover
x is r-approximation if w∙x≤r∙w∙x* An algorithm is r-approximation if for any
w,T, it returns an r-approximation.
8
Previous Results
[Snir,Moran]: Dynamic Programming algorithm
(EXP) 3 Approximation for trees 2 Approximation for strings
9
Our Contribution
A 2+ε approximation algorithm for trees Time complexity: poly(n)exp(1/ ε)
Faster Dynamic Programming Though still exponential time.
10
The Local Ratio Theoremx is an r-approximation with respect to w1
x is an r-approximation with respect to w2
x is an r-approximation with respect to w1+w2
Proof: Let x*, x1*, x2* opts w.r.t. w, w1, w2.
w1 · x r × w1x1*
w2 · x r × w2x2*
w · x r × (w1x1* + w2x2*)
r × ( w1 x* + w2 x* )
= r × ( w1+ w2 ) x*
11
Example: 3-approximation
v separates 3 different colors. For every feasible x:
v
1 1
1
1 1
1
0
0
12 6w x
12
3-aprx algorithmAlgorithm MinCR3(T,,W)
If there is no node separating 3 colorsReturn Optimal(T,,W)
Else,Let V’ be the set of the corresponding 6
verticesDefine
Let
Return MinCR3(T,,W-W1)
'minv V w v
1
'
0 '
v Vw v
v V
13
Running Example
4
141 2 2
5
4
3
14
Running Example (2)
0 1
4
1 1
4
3
4
2
15
Running Example (3)
0 0
3
0 1
3
2
4
1
No More Weight Reductions. Need to calculate optimal cover.
16
(t,d)-separator
v is a (t,d)-separator if in T-{v}, there are t colors such that each appear on at least d components.
{d1
1
1
2 2 2
t t t
17
Example: (2,3)-seperator
3
2
22
1
11
4
v
2 colors ( , ) are separated to 3 components.
1 2
18
Weight reduction On a (t,d)-separator, assign a weight of 1
to each one of the t∙d vertices.
1
1
1
1 1 1
1 1 1
For every feasible x:
1 1
tdr
t d
1
1
1
2 2 2
t t t 11 1t d w x td
At most one color left on
≥2 sides
19
Weight Reduction #1
1 1
2 2
k k
1
1
1
1
1
1
2
2 1 1
kr
k
, 2t k d
22
1r
k
20
Weight Reduction #2
1 2
1 2
1 2
1
1
1
1
1
1
K nodes 2,t d k
22
1r
k
21
Weight Reduction #3
1 2
1 2
1 2
3 3 3
1 2
1
1
1
1
1
1
1
11
1 1
1
3
3 4
3 1 4 1r
3, 4t d
2r
22
Weight Reduction #4
1 2
1 2
1 2
3 3 3
4 4 4
1
1
1
1
1
1
11 1
11 1
4, 3t d
2r
23
Light Colorings
A coloring is lightk if it does not contain: (2,k)-separator (k,2)-separator (3,4)-separator (4,3)-separator
24
2+2/(k-1)-aprx algorithmAlgorithm MinCR(T,,W)
If is a lightk coloringReturn SolveLight(T,,W)
Find (t,d)-separator ( )Let V’ be the set of it’s t∙d verticesDefine
Let
Return MinCR(T,,W-W1)
, 2, , , 2 , 3,4 , 4,3t d k k
'minv V w v
1
'
0 '
v Vw v
v V
25
Algorithm Correctness
Claim: MinCR returns an -apx Proof: By induction on recursion
depth: Base: (Light Coloring) X is optimal. Step:
X is an r-aprx w.r.t. W-W1 (Induction hyp.).
Every solution is an r-aprx w.r.t. W1. Thus, X is an r-aprx w.r.t. to W (LR Theorem).
22
1r
k
26
What’s Next?
We show how to handle lightk colorings…
27
Separated colors
Sep(v,c) – Number of connected components containing c in T-{v}.
For a vertex v, let si=sep(v,i). Assume wlog si≥si+1.
3
3
22
1
11
4
v
Sep(v,1)=3
Sep(v,3)=2
S=(3,2,2,1)
28
In a Light Coloring,for any v: s1≤deg(v) s2≤k-1 s3≤3 s4≤2 sk≤1
Lemma 1
Trivial. There are at most deg(v) components.
29
Otherwise, s1≥s2≥k.
Not a light coloring. Contradiction.
For every v: s1≤deg(v) s2≤k-1 s3≤3 s4≤2 sk≤1
Lemma 1 (cont.)
1 21 2
1 2
K nodes
30
Otherwise, s1≥s2≥s3≥4.
Not a light coloring. Contradiction.
For every v: s1≤deg(v) s2≤k-1 s3≤3 s4≤2 sk≤1
Lemma 1 (cont.)
1 21 21 2
3 3 3
1 2
3
31
Otherwise, s1≥s2≥s3≥s4≥3.
Not a light coloring. Contradiction.
For every v: s1≤deg(v) s2≤k-1 s3≤3 s4≤2 sk≤1
Lemma 1 (cont.)
1 21 21 2
3 3 3
4 4 4
32
Otherwise, s1≥s2≥…≥sk≥2.
Not a light coloring. Contradiction.
For every v: s1≤deg(v) s2≤k-1 s3≤3 s4≤2 sk≤1
Lemma 1 (cont.)
1 1
2 2
k k
33
Conclusion We would like to assign colors to
connected components. We will assign each color only to
components containing it.
1 2
3 ...
Deg
(v)
1 2
3 …
k-1
1 2
3
1 2
1 2..
1 2
1k 25 4 3…
#
2 deg
i
k
Part s
O k v
34
Definitions
Color(v) – The color of v. NewColor(v) – The new color of v. OutDeg(v) – The outgoing degree
of v. vi – The i’th son of v (0=father). Subtree(v) – The subtree rooted at
v.
35
Observation 1
v
vjvi
NewColor v i jNC SubTreeN vC SubTree v
36
Conclusion 2
v
v2v1
NewColor(v)= ,
NewColor(v2)≠
c
c
No c No c No c
37
Dynamic Programming - Idea
v
Recoloring subtree(v)
Sum cost of subtrees
Add cost of root
Recoloring subtree(v)
Sum cost of subtrees
Add cost of root
Reserved Colors
Allowed Colors
38
Dynamic Programming
OPT(v) - the optimal recoloring of Subtree(v), while are reserved colors.
OPT,c(v) - the optimal recoloring of Subtree(v), while are reserved colors, and NewColor(v)=c.
Observation:
39
Cost of recoloring a subtree
- cost of recoloring subtree(vi) while i are reserved colors and NewColor(v)=c.
v
vi
Case 1:
Case 2:
v
vi
40
Dynamic Programming – Cont.
Lemma: It is enough to scan
partitions.
2 degkO k v
41
Summary
Total time complexity:
Setting we get: Approximation Ratio:
Time Complexity:
2 22kO k n n
log 2k n
2O n
82 2 1
logo
n
42
Thank you!