SLIDE 1 Finding Permutations with Prefix Targets Alantha Newman Universit´ e Grenoble Alpes Heiko R¨
Universit¨ at Bonn Johanna Seif ENS Lyon
1
SLIDE 2
The Problem
Input: – An ordered set of nonnegative integers X = {x1, x2, . . . , xn} inter- spersed with free slots. – Another set of nonnegative integers Y = {y1 ≥ y2 ≥ · · · ≥ yn}. Goal: Assign each element of Y to a free slot to minimize maximum value of a prefix. The value of a prefix P is X ∩ P − Y ∩ P. If every prefix has value in range [α, β], then value of solution is β − α. Example: X = {8, , 5, , 2, , 3, }, Y = {7, 6, 2, 3}. Solution: {8, 7, 5, 6, 2, 2, 3, 3} has value 8.
2
SLIDE 3 The Problem
- We can assume the free slots alternate with the X values.
- If two xi’s are adjacent, add them together.
- If two free slots are adjacent, put a 0 between them.
- Generalizing 3-Partition:
– X-input: 1, , 0, , 0, , 1, , 0, , 0, , 1, . . . . – Y -input: Instance of 3-Partition, i.e. 3n numbers strictly between 1
4 and 1 2 that sum to n.
– Does every prefix have value in range [0, 1]?
- Hybrid Bin-Packing/Bin-Covering.
3
SLIDE 4 Problem: Geometric Interpretation
Input: X = {x1, x2, . . . , xn}, Y = {y1 ≥ y2 ≥ · · · ≥ yn}. Goal: Find permutation π of Y to minimize distance between highest and lowest point, i.e. min β − α. ∀k :
k
xj −
k−1
n
yπ(i) ≤ β,
k
xj −
k
n
yπ(i) ≥ α.
α β
4
SLIDE 5 Lower Bounds
Input: X = {x1, x2, . . . , xn}, Y = {y1 ≥ y2 ≥ · · · ≥ yn}. µx = maxi{xi}, µy = maxi{yi}, µ = max{µx, µy}. OPT ≥ µ. But optimal solution may be much greater than µ. Example: OPT = n/2, µ = 2. X = {2, 2, . . . , 2
2 entries
, 0, 0, . . . , 0
2 entries
}, Y = {1, 1, . . . , 1, 1, 1, . . . , 1
}. Greedy/combinatorial algorithms can be terrible: X = {2, 0, 2, 0, . . . , 2, 0
2 entries
, 2, . . . , 2
4 entries
, 0, . . . , 0
4 entries
}, Y = {2, . . . , 2
4 entries
, 1, 1, 1, 1, . . . , 1, 1
2 entries
, 0, . . . , 0
4 entries
}.
5
SLIDE 6 LP Relaxation
min β − α ∀i ∈ [1, n] :
n
zij = 1, ∀i ∈ [1, n] :
n
zij = 1, ∀k :
k
xj −
k−1
n
yi · zij ≤ β,
k
xj −
k
n
yi · zij ≥ α, zij ≥ 0. Integer solution is a permutation matrix. LP solution Z is doubly stochastic matrix. Z =
z11 z12 . . . z1n z21 z22 . . . z2n . . . . . . . . . . . . zn1 zn2 . . . znn
,
zj =
n
zij · yi.
6
SLIDE 7
This Talk: Two Algorithms
Algorithm I. – Uses iterative rounding (` a la Karmarker-Karp). – Has approximation factor OPTLP + log n · O(µx + µy). Algorithm II. – Transforms the support of Z (the doubly stochastic LP solution matrix). – Has approximation factor OPTLP + µy.
7
SLIDE 8
Algorithm I: Rounding Up Items
Let OPTLP denote optimal LP value for original instance. Round up items (groups of eight consecutive items). Substitute rounded-up values into LP solution to obtain OPT ′
LP ≤ OPTLP + 8µy.
Let OPTf be any feasible LP solution for rounded up instance such that: OPTf ≤ OPT ′
LP.
Replace rounded up values with original values into LP solution to obtain OPT ′
f ≤ OPTf + 8µy.
Finally: OPT ′
f ≤ OPTLP + 16µy.
8
SLIDE 9
Algorithm I: Rearranging Items
Let OPTLP denote optimal LP value for original instance. Rearrange from alternating X-Y to alternating X8-Y 8. Obtain LP solution by rearranging columns: OPT ′
LP ≤ OPTLP + 8µx + 8µy.
Let OPTf be any feasible LP solution for rounded up instance such that: OPTf ≤ OPT ′
LP.
Put columns of the LP solution back into alternating order: OPT ′
f ≤ OPTf + 8µy.
Finally: OPT ′
f ≤ OPTLP + 16µy + 8µx.
9
SLIDE 10
Algorithm I: Iterative Rounding
Round up items. Rearrange items. Obtain permutation instance on n/8 variables with new LP. Let z′
ij denote new variables and y′ i denote rounded-up items and
rearranged items. Assign y′
i’s to positions in the 8 × 8 boxes such that resulting matrix is
doubly stochastic and so that integer parts are unit. Un-rearrange and round down. Total cost: OPTLP + log n · O(µx + µy).
10
SLIDE 11 New LP Relaxation
min β − α ∀i ∈ [1, n′] :
n
zij = 8, ∀i ∈ [1, n′] :
n
zij = 8, ∀k :
k
xj −
k−1
n′
y′
i · zij ≤ β, k
xj −
k
n′
y′
i · zij
≥ α, zij ≥ 0. There are 4n′ constraints ⇒ at most 4n′ nonzero variables in a BFS. If n′ = n
8 ⇒ there are n 2 nonzero variables in a BFS.
But total weight is n. So at least half the weight belongs to the integer parts.
11
SLIDE 12 LP Relaxation
min β − α ∀i ∈ [1, n] :
n
zij = 1, ∀i ∈ [1, n] :
n
zij = 1, ∀k :
k
xj −
k−1
n
yi · zij ≤ β,
k
xj −
k
n
yi · zij ≥ α, zij ≥ 0. Integer solution is a permutation matrix. LP solution Z is doubly stochastic matrix. Z =
z11 z12 . . . z1n z21 z22 . . . z2n . . . . . . . . . . . . zn1 zn2 . . . znn
,
zj =
n
zij · yi.
12
SLIDE 13 Algorithm II: Approximating zj’s
Recall LP relaxation. zj =
n
zij · yi. Goal: Find permutation of Y = {y′
1, y′ 2, . . . y′ n} such that:
zj ≤
y′
j ≤
zj + γ. Solution size at most ⇒ β − α + γ = OPT + γ.
13
SLIDE 14 Relaxation
Z =
z11 z12 . . . z1n z21 z22 . . . z2n . . . . . . . . . . . . zn1 zn2 . . . znn
,
zj =
n
zij · yi. Approach: Decompose Z into permutation matrices ` a la Birkoff-von Neumann. Bad example: Y = {1, 1, . . . , 1
, B, . . . , B
}. xi = (k·B)+(n−k)
n
= zj. {B, B, . . . , B, 1, 1, . . . 1, 1, 1} {1, B, B, . . . , B, 1, 1, . . . 1, 1} {1, 1, B, B, . . . , B, 1, 1, . . . 1}. {1, 1, . . . 1, B, 1 . . . , 1, B, 1, . . . 1}.
14
SLIDE 15
Rounding: Transformation
We transform doubly stochastic Z into a doubly stochastic matrix T. Preserves the weighted column sums {zj}. (Still feasible for LP.) We say a row i is finished at column j, if columns 1 through j sum to 1 in row i. Matrix T will have consecutiveness property: In each column, there are at most two non-zero entries that are not in finished rows, and in between them, all the rows are finished. T =
.7 .3 . . . .5 .3 .2 . . . . . . .5 .5 . . . . . . .3 .7 . . . .2 . . . .8 . . .
15
SLIDE 16
Rounding: Transformation
If za, zb, zc > 0 all appear in an unfinished row. Then: increase zb → zb + δ decrease za → za − δ · yb−yc
ya−yc
decrease zc → zc − δ · ya−yb
ya−yc
For some column (to the right) where row of b has value at least δ: decrease value in row b by δ increase values in rows a and c
16
SLIDE 17 Rounding: Transformation Example
Z =
.6 .4 .3 .1 .4 .2 .4 .4 .2 .3 .6 .1 .3 .3 .4 .4 .6
, Y =
16 8 6 4 2 1
, ZtY =
12 9 5.6 3 1.4 .
.6 .4 .1 .2 .1 .4 .2 .8 .2 .1 .2 .6 .1 .3 .3 .4 .4 .6
,
.6 .4 .2 .2 .4 .2 1 .2 .1 .6 .1 .3 .3 .4 .4 .6
,
.5 .4 .1 .5 .2 .1 .2 1 .1 .8 .1 .3 .3 .4 .4 .6
17
SLIDE 18 Rounding: Transformation Example
Z =
.6 .4 .3 .1 .4 .2 .4 .4 .2 .3 .6 .1 .3 .3 .4 .4 .6
, Y =
16 8 6 4 2 1
, ZtY =
12 9 5.6 3 1.4 .
.6 .4 .1 .2 .1 .4 .2 .8 .2 .1 .2 .6 .1 .3 .3 .4 .4 .6
⇒
.5 .25 .15 .1 .5 .5 1 .25 .75 .1 .5 .4 .4 .6
18
SLIDE 19
Rounding: Using T
T =
.7 .3 . . . .5 .3 .2 . . . . . . .5 .5 . . . . . . .3 .7 . . . .2 . . . .8 . . .
, R =
1 . . . 1 . . . . . . 1 . . . . . . 1 . . . 1 . . . . . .
For each column, connect the vertices (e.g. add a clique on vertices) in rows of support.
5
G0 G1 G G
2 3
G
19
SLIDE 20
Rounding: Using T
T =
.7 .3 . . . .5 .3 .2 . . . . . . .5 .5 . . . . . . .3 .7 . . . .2 . . . .8 . . .
, R =
1 . . . 1 . . . . . . 1 . . . . . . 1 . . . 1 . . . . . .
For each column, connect the vertices (e.g. add a clique on vertices) in rows of support.
5
G0 G1 G G
2 3
G
20
SLIDE 21 Rounding
Main Theorem: Rounding results in permutation of Y with guarantee OPT + µ. Main idea: For each prefix [1, ℓ], we want to approximate
j∈[1,ℓ] zj.
Finished block contribute equally to T and R. T =
.7 .5 .3 .2 .5 .5 .3
,
R =
1 1 1
In prefix [1, 3], the difference is .3(y1 − y4) ≤ (y1 − y4). Each unfinished block B contributes at most (yb − ya) to R than to T. yb (ya) is max (min) y-value in B. Total difference between T and R over all blocks is:
(yb − ya) = µy.
21
SLIDE 22
Open Problems: Better Upper and Lower Bounds in Higher Dimensions
Input: {v1, v2, . . . , vn}, vi ∈ Rd, ||vi|| ≤ 1. Steinitz Problems: Input + fact that vi = 0. Find permutation of vectors so that each prefix is small. Signed Series Problems: (Upper bound on Steinitz constant) Assign signs to each vector so that all prefixes are small. 2-dimensional problem: 2 [Lund, Magazinov 2015] Alternating Problems: Input + vi = 0, hyperplane H. Find permutation of vectors alternating between sides of hyperplane. Gasoline Problems: Fix half the vectors. Permute the other half. Find permutation so each prefix is small.
22