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
Introduction
Given a set of ny -monotone wires
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
i j
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
adjacentpermutations
Introduction
Given a set of ny -monotone wires
1 ≤ i < j ≤ n
swap i j
disjoint swaps
multiple swaps
adjacentpermutations
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
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
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
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
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
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
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
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
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Algorithm for findingoptimal tangles
Related Work• Olszewski et al. Visualizing the template
of a chaotic attractor.GD 2018
mlist
Algorithm for findingoptimal tangles
Complexity ??
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 ??
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 ??
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]
Complexity
Tangle-Height Minimization is NP-hard.Theorem.
Complexity
Reduction from 3-Partition
Tangle-Height Minimization is NP-hard.Theorem.
Proof.
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
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
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
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
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
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
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
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
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
Transforming the Instance A into a List Lω ω′
ω ω′
Transforming the Instance A into a List Lω ω′
ω ω′
2m swaps
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
Ma1M = 2m3
What is not possible?
split
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α1 α′1
α′1
α2 α′2
α2 α′2
Ma1M = 2m3
Ma2
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
Transforming the Instance A into a List L
α1
ω ω′
ω ω′
α6 α1· · · α′1 α′6
α6· · · α′1 α′6· · ·
· · ·
Ma1
Ma4
Ma5
Ma2
Ma3
Ma6
M = 2m3
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
β2δ2 β1δ1
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
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
Making Sure That the “Pockets” Can’t Be Squeezedω ω′
ω ω′δ2β1δ1 β2
β2δ2 β1δ1
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
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
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
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
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
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
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
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)
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)
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
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]
Improving Exact Algorithms
Simple lists
Tangle-Height Minimization can be solved in . . .
General lists
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
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
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|ϕ
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|ϕ
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
Dynamic Programming Algorithm
O(( 2|L|
n2 + 1)n2/2
ϕnn)
Let L = (`i j) be the given list of swaps.
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
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
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
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
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
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
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
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
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
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
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
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′.
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′
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′
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′.
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′.
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′.
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′.
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)
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)
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]
[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
Open Problems
Problem 1
Is it NP-hard to test the feasibility of a given (non-simple) list?
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?
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
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
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
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!