Page 1
Computing Height-OptimalTangles Faster
Oksana FirmanPhilipp Kindermann
Alexander WolffJohannes Zink
Julius-Maximilians-Universitat Wurzburg,
Germany
Alexander RavskyPidstryhach Institute for Applied Problems
of Mechanics and Mathematics,National Academy of Sciences of Ukraine,
Lviv, Ukraine
PK AW JZ OF Wu AR Lviv
Page 2
Introduction
Given a set of ny -monotone wires
Page 3
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
i j
Page 4
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
Page 5
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
adjacentpermutations
Page 6
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
multiple swaps
adjacentpermutations
Page 7
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
adjacentpermutations
π4
π5
Page 8
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
π′1
π′2
π′3
π′5
adjacentpermutations
π4
π5
π′4
1 2 · · · n
Page 9
Introduction
Given a set of ny -monotone wires
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
adjacentpermutations
π4
π5
Page 10
Introduction
Given a set of ny -monotone wires
as a multiset (`i j)
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
1
3112
adjacentpermutations
π4
π5
Page 11
Introduction
Given a set of ny -monotone wires
as a multiset (`i j)
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
1
3112
Tangle T (L) realizes list L.
adjacentpermutations
π4
π5
Page 12
Introduction
Given a set of ny -monotone wires
as a multiset (`i j)
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
1
3112
Tangle T (L) realizes list L.
adjacentpermutations
π4
π5
Page 13
Introduction
Given a set of ny -monotone wires
as a multiset (`i j)
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
1
3112
Tangle T (L) realizes list L.
adjacentpermutations
not feasible
π4
π5
Page 14
Introduction
Given a set of ny -monotone wires
as a multiset (`i j)
. . . and given a list ofswaps L
1 ≤ i < j ≤ n
1 2 · · · n
swap i j
disjoint swaps
multiple swaps
tangle T ofheight h(T )
π1
π2
π3
π6
A tangle T (L) is height-optimal if it has the minimum heightamong all tangles realizing the list L.
1
3112
Tangle T (L) realizes list L.
adjacentpermutations
π4
π5
Page 15
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
Page 16
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Page 17
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Algorithm for findingoptimal tangles
Page 18
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Algorithm for findingoptimal tangles
Complexity ??
Page 19
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
• Wang. Novel routing schemes for IClayout part I: Two-layer channel routing.DAC 1991
Given:initial andfinal permutations
Algorithm for findingoptimal tangles
Complexity ??
Page 20
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
• Wang. Novel routing schemes for IClayout part I: Two-layer channel routing.DAC 1991
Given:initial andfinal permutations
Objective: minimizethe number of bends
• Bereg et al. Drawing Permutations with Few Corners.GD 2013
Algorithm for findingoptimal tangles
Complexity ??
Page 21
Overview
• Complexity:NP-hardness byreduction from3-Partition.
• New algorithm: using dynamic programming;asymptotically faster than [Olszewski et al., GD’18].
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)
• Experiments: comparison with [Olszewski et al., GD’18]
Page 22
Complexity
Tangle-Height Minimization is NP-hard.Theorem.
Page 23
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
Page 24
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.3-Partition
Given: Multiset A of 3m positive integers.
a1 a2 a3 a3m−2 a3m· · · a3m−1
Page 25
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.3-Partition
∑1 = B · · · ∑
m = B
Given: Multiset A of 3m positive integers.Can A be partitioned into m groups ofthree elements s.t. each group sums up tothe same value B?
Question:
a1 a2 a3 a3m−2 a3m· · ·∑2 = B
a3m−1
Page 26
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.3-Partition
B4 < ai <
B2
B is poly in m
∑1 = B · · · ∑
m = B
Given: Multiset A of 3m positive integers.Can A be partitioned into m groups ofthree elements s.t. each group sums up tothe same value B?
Question:
a1 a2 a3 a3m−2 a3m· · ·∑2 = B
a3m−1
Page 27
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof. B4 < ai <
B2
B is poly in m
∑1 = B · · · ∑
m = B
Given: Multiset A of 3m positive integers.Can A be partitioned into m groups ofthree elements s.t. each group sums up tothe same value B?
Given: Instance A of 3-Partition.
Question:
a1 a2 a3 a3m−2 a3m· · ·∑2 = B
a3m−1
Page 28
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof. B4 < ai <
B2
B is poly in m
∑1 = B · · · ∑
m = B
Given: Multiset A of 3m positive integers.Can A be partitioned into m groups ofthree elements s.t. each group sums up tothe same value B?
Given: Instance A of 3-Partition.Task: Construct L s.t. there is T realizing L with height at
most H = 2m3(∑
A)+7m2 iff A is a yes-instance.
Question:
a1 a2 a3 a3m−2 a3m· · ·∑2 = B
a3m−1
Page 29
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
Given: Instance A of 3-Partition.Task: Construct L s.t. there is T realizing L with height at
most H = 2m3(∑
A)+7m2 iff A is a yes-instance.
∑A
∑1 = B · · · ∑
m = B
a1 a2 a3 a3m−2 a3m−1 a3m· · ·∑2 = B
Page 30
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
Given: Instance A of 3-Partition.Task: Construct L s.t. there is T realizing L with height at
most H = 2m3(∑
A)+7m2 iff A is a yes-instance.
∑A
∑1 = B · · · ∑
m = B
a1 a2 a3 a3m−2 a3m−1 a3m· · ·∑2 = B +1
Page 31
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
Given: Instance A of 3-Partition.Task: Construct L s.t. there is T realizing L with height at
most H = 2m3(∑
A)+7m2 iff A is a yes-instance.
∑A +1
∑1 = B · · · ∑
m = B
a1 a2 a3 a3m−2 a3m−1 a3m· · ·∑2 = B +1
Page 32
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
Given: Instance A of 3-Partition.
∑A +1
Task: construct L s.t. there is T realizing L with height atmost H = 2m3(
∑A )+7m2 iff A is a yes-instance+1
∑1 = B · · · ∑
m = B
a1 a2 a3 a3m−2 a3m−1 a3m· · ·∑2 = B +1
Page 33
Transforming the Instance A into a List Lω ω′
ω ω′
Page 34
Transforming the Instance A into a List Lω ω′
ω ω′
2m swaps
Page 35
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Page 36
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Page 37
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Page 38
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Page 39
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Page 40
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
What is not possible?
split
Page 41
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
α2 α′2
α2 α′2
Ma1M = 2m3
Ma2
Page 42
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
α2 α′2
α2 α′2
Ma1M = 2m3
Ma2
What is not possible?
put it on the same levelwith other α-α′ swaps
Page 43
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
· · ·
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
M = 2m3
Page 44
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 45
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
β2δ2 β1δ1
Page 46
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
β2δ2 β1δ1
β2 δ2β1 δ1
Page 47
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 48
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 49
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 50
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 51
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 52
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Page 53
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
2MB
MB
M = 2m3
Page 54
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
2MB
MB
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
2MB
MB
M = 2m3
Page 55
Making Sure That the “Pockets” Can’t Be Squeezed
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
Page 56
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instance
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
Page 57
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instance
by construction
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
Page 58
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instance
by construction
height ≤ H
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
Page 59
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instanceno
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
Page 60
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instanceno
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
minimum height2m3(
∑A + 1)
Page 61
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instanceno
height > H
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
minimum height2m3(
∑A + 1)
Page 62
Proof of Correctness
α1
ω ω′
ω ω′
γ′1 γ′2δ′1 β′2δ′2β′1
β′1 γ′1γ′2δ′1β′2δ
′2
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
2MB
MB
· · ·
γ2γ1 δ2β1δ1 β2
β2γ2γ1 δ2 β1δ1
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
2MB
MB
M = 2m3
A is a yes-instanceno
height > H
H = 2m3(∑
A) + 7m2
is the maximum allowedheight for the reduction
minimum height2m3(
∑A + 1)
Tangle-Height Minimization is NP-hard.Theorem.
X
Page 63
Overview
• Complexity:NP-hardness byreduction from3-Partition.
• New algorithm: using dynamic programming;asymptotically faster than [Olszewski et al., GD’18].
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)
• Experiments: comparison with [Olszewski et al., GD’18]
Page 64
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
Page 65
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
[Olszewski et al., GD’18]
2O(n2)
n – number of wires
Page 66
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
[Olszewski et al., GD’18]
2O(n2) 2O(n log n)
our runtime
n – number of wires
Page 67
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
[Olszewski et al., GD’18]
2O(n2) 2O(n log n)
our runtime
[Olszewski et al., GD’18]
O(ϕ2|L|
5|L|/nn)
n – number of wires– length of the list L (=
∑`i j )
– golden ratio (≈ 1.618)|L|ϕ
Page 68
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
[Olszewski et al., GD’18]
2O(n2) 2O(n log n)
our runtime
[Olszewski et al., GD’18]
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)our runtime
n – number of wires– length of the list L (=
∑`i j )
– golden ratio (≈ 1.618)|L|ϕ
Page 69
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
[Olszewski et al., GD’18]
2O(n2) 2O(n log n)
our runtime
[Olszewski et al., GD’18]
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)our runtime
polynomial in |L|
n – number of wires– length of the list L (=
∑`i j )
– golden ratio (≈ 1.618)|L|ϕ
polynomial in |L|for fixed n
Page 70
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
Page 71
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.L′ is a sublist of L if`′i j ≤ `i j
Page 72
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.L′ is a sublist of L if`′i j ≤ `i j
Page 73
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
L′ is a sublist of L if`′i j ≤ `i j
Page 74
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.
L′ is a sublist of L if`′i j ≤ `i j
Page 75
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
L′ is a sublist of L if`′i j ≤ `i j
Page 76
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
L′ is a sublist of L if`′i j ≤ `i j
Page 77
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
i 7→ i + |{j : j > i and `′i j is odd}| − |{j : j < i and `′i j is odd}|
L′ is a sublist of L if`′i j ≤ `i j
Page 78
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
i 7→ i + |{j : j > i and `′i j is odd}| − |{j : j < i and `′i j is odd}|
L′ is a sublist of L if`′i j ≤ `i j
Page 79
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
i 7→ i + |{j : j > i and `′i j is odd}| − |{j : j < i and `′i j is odd}|
L′ is a sublist of L if`′i j ≤ `i j
Page 80
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
i 7→ i + |{j : j > i and `′i j is odd}| − |{j : j < i and `′i j is odd}|
L′ is a sublist of L if`′i j ≤ `i j
Page 81
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.i
for each wire i :// find a position where it is after applying L′
i 7→ i + |{j : j > i and `′i j is odd}| − |{j : j < i and `′i j is odd}|check whether the map is indeed a permutation
L′ is a sublist of L if`′i j ≤ `i j
Page 82
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency.
idn L′
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
Page 83
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhidn L′
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
πh and idn L′ are adjacentL′′∪ add. swaps = L′
Page 84
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhidn L′
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
πh and idn L′ are adjacentL′′∪ add. swaps = L′
Page 85
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
Page 86
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Running time
O(λ · (Fn+1 − 1) · n) ≤
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
Page 87
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Running time
O(λ · (Fn+1 − 1) · n) ≤
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
Page 88
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Running time
O(λ · (Fn+1 − 1) · n) ≤
Choose the shortest tangle T (L′′).
Fn is the n-th Fibonacci number
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
Page 89
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Running time
O(λ · (Fn+1 − 1) · n) ≤
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
λ =∏i<j
(`i j + 1) ≤(
2|L|n2
+ 1)n2/2
Fn ∈ O(ϕn)
Page 90
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
λ = # of distinct sublists of L.
Consider them in order of increasing length.
Let L′ be the next list to consider.
Check its consistency. π1π2...
πhAdd the final permutation to its end.idn L′
Running time
O(λ · (Fn+1 − 1) · n) ≤
Choose the shortest tangle T (L′′).
L′ is a sublist of L if`′i j ≤ `i j
Compute the final permutation idn L′.
λ =∏i<j
(`i j + 1) ≤(
2|L|n2
+ 1)n2/2
Fn ∈ O(ϕn)
Page 91
Overview
• Complexity:NP-hardness byreduction from3-Partition.
• New algorithm: using dynamic programming;asymptotically faster than [Olszewski et al., GD’18].
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)
• Experiments: comparison with [Olszewski et al., GD’18]
Page 92
[Olszewski et al., GD’18]
O(ϕ2|L|
5|L|/nn)
O(( 2|L|
n2 + 1) n2
2 ϕnn)Our algorithm
run
tim
e[s
ec]
length |L| of the list L
0 10 20 30 40 50
0.0001
0.01
1
100
3600
Experiments
0 10 20 30 40 0 10 20 30 40
Page 93
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Page 94
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Problem 2
Can we decide a feasibility of a list faster than finding itsoptimal realization?
Page 95
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Problem 2
Can we decide a feasibility of a list faster than finding itsoptimal realization?
Problem 3A list (`i j) is non-separableif ∀i<k<j :
(`ik = `kj = 0 implies `i j = 0
).
i k j
Page 96
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Problem 2
Can we decide a feasibility of a list faster than finding itsoptimal realization?
Problem 3A list (`i j) is non-separableif ∀i<k<j :
(`ik = `kj = 0 implies `i j = 0
).
i k j
necessary
Page 97
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Problem 2
Can we decide a feasibility of a list faster than finding itsoptimal realization?
Problem 3
For lists where all entries are even, is this sufficient?
A list (`i j) is non-separableif ∀i<k<j :
(`ik = `kj = 0 implies `i j = 0
).
i k j
necessary
Page 98
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
Problem 2
Can we decide a feasibility of a list faster than finding itsoptimal realization?
Problem 3
For lists where all entries are even, is this sufficient?
A list (`i j) is non-separableif ∀i<k<j :
(`ik = `kj = 0 implies `i j = 0
).
i k j
necessary
Thank you!