Algorithms for Lattice Transforms and Lattice Transforms for Algorithms
Thore Husfeldt Lund University and IT University of Copenhagen
2 3 23 24 39 234 239 248 2348 2349
Algorithms for Lattice Transforms and 2348 2349 Lattice - - PowerPoint PPT Presentation
Algorithms for Lattice Transforms and 2348 2349 Lattice Transforms for 234 248 239 Algorithms 23 39 24 Thore Husfeldt 2 Lund University and IT University of Copenhagen 3 This Talk in 60 Seconds In Prefix sum Out y i = x
Thore Husfeldt Lund University and IT University of Copenhagen
2 3 23 24 39 234 239 248 2348 2349
This Talk in 60 Seconds
x1 x2 x4 x3 y1 y2 y3 y4
In Out “Prefix sum”
yi = ∑
j≤i
xj
This Talk in 60 Seconds
5 32 4 1 5
32+5=
37
32+5+1=38
32+5+1+4=42
In Out “Prefix sum”
yi = ∑
j≤i
xj
Time: Quadratic
This Talk in 60 Seconds
5 32 4 1 5
32+5=
37
32+5+1=38
32+5+1+4=42
In Out “Prefix sum”
yi = ∑
j≤i
xj
5
32+5=
37
37+1=38
38+4=42
Out Time: Quadratic But: can do better
In This Talk
Nice combinatorics Nice algebra Recent developments in algorithms for NP-hard problems Our SODA result from last week Fast Algorithms for computing the zeta transform on various lattices with applications
Collaborators
Andreas Björklund (Lund), Petteri Kaski (Helsinki), Mikko Koivisto (Helsinki), Jesper Nederlof (Bergen), Pekka Parviainen (Helsinki)
Lattices & Partial Orders
Graph colouring
Partial Orders & Lattices
Partial Orders & Lattices
Partial Orders & Lattices
Partial Orders & Lattices
Partial Orders & Lattices
join of 2 and 3
Partial Orders & Lattices
join of 2 and 3 lattice
Partial Orders & Lattices
join of 2 and 3 lattice zero join- irreducible
Zeta Transform f: L → R
f ζ(x) = ∑
y≤x
f (y)
Zeta Transform f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 4 7
Zeta Transform f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 4 7 4 3 1 6 4 14 5 10
Zeta Transform (linear algebra view) f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
f = 3 6 1 4
Zeta Transform (linear algebra view) f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
f = 3 6 1 4 ζ = 1 1 1 1 1 1 1 1 1
Zeta Transform (linear algebra view) f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
f = 3 6 1 4 ζ = 1 1 1 1 1 1 1 1 1
Note: zeta transform has inverse, called the Möbius transform
Zeta Transform (categoric view) f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
≤∈ FREL: L → L
induces a map Partial order on finite sets (here, a lattice)
RL → RL
Zeta Transform (categoric view) f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
≤∈ FREL: L → L
induces a map Partial order on finite sets (here, a lattice)
RL → RL
≤ S T RS RT
for i ∈ {1,…,N} g(i) = 0 for j ∈ {1,…,N} if j ≤ i: g(i) = g(i) + f(j)
for i ∈ {1,…,N} g(i) = 0 for j ∈ {1,…,N} if j ≤ i: g(i) = g(i) + f(j)
4 1 32 5 0 5 37 38 42 0 5 37 38 38 38 38 38 0 5 37 37 37 37 37 37 37 37 37 0 5 5 5 5 5 5 5 5 5 5 5 5
f g
for i ∈ {1,…,N} g(i) = 0 for j ∈ {1,…,N} if j ≤ i: g(i) = g(i) + f(j)
4 1 32 5 0 5 37 38 42 0 5 37 38 38 38 38 38 0 5 37 37 37 37 37 37 37 37 37 0 5 5 5 5 5 5 5 5 5 5 5 5
f g
time = # steps = # gates f fζ
time = # steps = # gates f fζ
v2 gates
time = # steps = # gates f fζ
v2 gates v gates
[Frank Yates, The Design and analysis of factorial experiments, Imperial Bureau of Soil Science Tech. Comm. 35, 1937.]
“The Fast Zeta Transform”, FZT
The subset lattice
{} {2} {1} {1,2}
The subset lattice
{} {2} {1} {1,2}
Circuits for Zeta Transform f: L → R
f ζ(x) = ∑
y≤x
f (y)
4 3 1 6 4 14 5 10
Circuits for Zeta Transform f: L → R
f ζ(x) =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”) in Hasse diagram e = v log v < v2
#edges
#lattice points (vertices)
Fast Zeta Transform for v = 24
∅
A B AB C AC BC ABC D AD BD ABD CD ACD BCD ABCD 1 1 1 1 1 1
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
g0 g1 g2 g3 g4 1 2 2 1 2 2 3 1 2 3 4 3 4 5 6
Subset lattice in time O(v⋅log v) [Yates] What we know v = |L| = # vertices in Hasse diagram e = # “edges” in Hasse diagram Every lattice in time O(v2) [Brute force] Most lattices not in time o(v3/2/log v) [Count] Subset lattice in time O(e) [Yates] No lattice in time o(e) [Kennes]
There are exp(Θ(v3/2)) lattices
1 (v/2)–1 “atoms” (v/2)–1 “hyperatoms”
There are exp(Θ(v3/2)) lattices
1 (v/2)–1 “atoms” (v/2)–1 “hyperatoms” possible edges
2Θ(v2)
There are exp(Θ(v3/2)) lattices
1 (v/2)–1 “atoms” (v/2)–1 “hyperatoms” possible edges
2Θ(v2)
Doesn’t quite work (not a lattice, isomorphisms,…), but OK with more care.
[Klotz und Lucht, Endliche Verbände, J. Reine Angew. Math., 247:58–68, 1971]
There are exp(O(s log s)) circuits on s gates
gate input 1 input 2 1 v1 v2 2 v3 v4 3 v5 v6 4 v7 v8 5 g1 g2 6 v2 v4 7 g3 g4 8 v6 v8 9 g5 g7 10 g6 g8 11 g2 g4 12 v4 v8
g9 g10 g11 g12 g7 g8 g4 v8
O(log s) bits
There are exp(O(s log s)) circuits on s gates There are exp(Θ(v3/2)) lattices
Thus, most lattices need exp(Θ(v3/2/log v)) gates
f ζ(x) = ∑
y≤x
f (y)
Need to argue: some gate handles this contribution only.
f ζ(x) = ∑
y≤x
f (y)
Need to argue: some gate handles this contribution only.
f ζ(x) = ∑
y≤x
f (y)
[Kennes, Computational aspects of the Möbius transform of graphs, IEEE Transactions on Systems, Man and Cybernetics, 22(2):201–223, 1992.]
Subset lattice in time O(v⋅log v) [Yates] What we know v = |L| = # vertices in Hasse diagram e = # “edges” in Hasse diagram Every lattice in time O(v2) [Brute force] Most lattices not in time o(v3/2/log v) [Count] Subset lattice in time O(e) [Yates] No lattice in time o(e) [Kennes]
A B C D I1 I2 I3
Graph Colouring # colourings = # covers with independent sets
artistic freedom; should say “partitions”
1 1 1 1 1 1 f 1 1 1 1 6 6 6 6
25 256
24 24 66 18( f ζ)3µ
A B C D I1 I2 I3
Graph 3-Colouring
g
1 1 1 1 1 1 f 1 1 1 1 6 6 6 6
25 256
24 24 66 18( f ζ)3µ
A B C D I1 I2 I3
Graph 3-Colouring f(S) = 1 iff S is independent g(S) = # triplets of independent subsets covering S
g
1 1 1 1 1 1 f 1 1 1 1 6 6 6 6
25 256
24 24 66 18( f ζ)3µ
A B C D I1 I2 I3
Graph 3-Colouring f(S) = 1 iff S is independent g(S) = # triplets of independent subsets covering S
g
f ζ gζ
1 1 1 1 1 1 f 1 1 1 1 2 2 2 2 3 3 3 4 4 5 6 f ζ 1 1 1 1 8 8 8 8
27 27 27 64 64 125 216( f ζ)3
1 1 1 1 6 6 6 6
25 256
24 24 66 18( f ζ)3µ
ζ µ x ⌅⇤ x3
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
[Björklund, H., Koivisto, Set partitioning via inclusion-exclusion. SIAM J. Comput., 39(2):546–563, 2009.]
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Theory of NP-hardness
1960 1980 2000
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Theory of NP-hardness
1960 1980 2000
Let’ s give up
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Theory of NP-hardness
1960 1980 2000
Let’ s give up Approximation algorithms Let’ s find the wrong answer real fast!
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Theory of NP-hardness
1960 1980 2000
Let’ s give up Approximation algorithms Let’ s find the wrong answer real fast! Exponential time (exact) algorithms Let’ s find the right answer faster.
Graph k-colouring in time O*(2|V|).
Trivial algorithm: time O*(k|V|).
Exciting new trend in algorithms for hard problems
Theory of NP-hardness
1960 1980 2000
Let’ s give up Approximation algorithms Let’ s find the wrong answer real fast! Exponential time (exact) algorithms Let’ s find the right answer faster.
French connection: Kratsch, Liedloff, Thomassé, Paul, Havet, Escoffier, Paschos,…
Multiply polynomials (1x0+1x1+3x2) ⋅ (1x0+2x1)
= 1x0+3x1+5x2+6x3
Multiply polynomials (1x0+1x1+3x2) ⋅ (1x0+2x1)
= 1x0+3x1+5x2+6x3
elements in semigroup S (monomials) mapping f from S to some field K multiplication on S
Multiplication in semigroups (1x0+1x1+3x2) ⋅ (1x0+2x1)
= 1x0+3x1+5x2+6x3
( f ∨ g)(c) =
a,b∈L: a∨b=c
f (a)g(b)
For lattices: join product
semigroup S monomial lattice point field K of scalars coefficient f,g: S → K product in the semigroup algebra multiplication of polynomials join product
Algebraic view
Fourier meets Möbius
p q
F(p) F(q) ˙
F−1
polynomial multiplication join product
f g
ζ ζ ∨ µ
C’EST FRAIS!
[Björklund, H. Kaski, Koivisto, Nederlof, Parviainen, SODA, last week]
C’EST FRAIS!
9 6 4 8 1 3 2 12 18 36 24 72
5 nonzero irreducibles Divisors of 72 “6” is reducible (join of 2 and 3)
9 6 4 8 1 3 2 12 18 36 24 72
prime powers
9 6 4 8 1 3 2 12 18 36 24 72
prime powers ground set A
vn = e = 2|A||A|
9 6 4 8 1 3 2 12 18 36 24 72
prime powers ground set A
vn = e = 2|A||A| Also works optimally for sublattices of the subset lattice that are downward closed intersection closed union closed
9 6 4 8 1 3 2 12 18 36 24 72
prime powers ground set A
vn = e = 2|A||A| Also works optimally for sublattices of the subset lattice that are downward closed intersection closed union closed e = Θ(v)
9 6 4 8 1 3 2 12 18 36 24 72
The Spectrum Map
9 6 4 8 1 3 2 12 18 36 24 72 {3,9} {2,3} {2,4} {2,4,8} Ø {3} {2} {2,3,4} {2,3,9} {2,3,4,9} {2,3,4,8} {2,3,4,8,9}
The Spectrum Map
9 6 4 8 1 3 2 12 18 36 24 72 {3,9} {2,3} {2,4} {2,4,8} Ø {3} {2} {2,3,4} {2,3,9} {2,3,4,9} {2,3,4,8} {2,3,4,8,9}
The Spectrum Map
9 6 4 8 1 3 2 12 18 36 24 72 {3,9} {2,3} {2,4} {2,4,8} Ø {3} {2} {2,3,4} {2,3,9} {2,3,4,9} {2,3,4,8} {2,3,4,8,9}
The Spectrum Map
2 3 23 24 39 234 239 248 2348 2349Arbitrary finite lattice can be embedded into the subset lattice 2[n]. Result is closed under intersection. n = # nonzero, join-irreducible elements.
2 3 23 24 39 234 239 248 2348 2349
The Spectrum Map
9 6 4 8 1 3 2 12 18 36 24 72
2 3 23 24 39 234 239 248 2348 2349
What we can’t just do Yates’s algorithm takes time 2nn. Exponential in # irreducibles
What we do: walks
S T
Every pair S, T of elements is connected by a unique walk
2 3 23 24 39 234 239 248 2348 2349
39 2 239 3 239 4 2349 8 2349 9 2349
(Not necessarily walks in the Hasse diagram)
Ø 2 1 12 Ø 2 1 12
Ø 1 {1} 2 {1,2} Ø 1 {1} 2 {1,2}
From Ø to {1,2}
(Not necessarily walks in the Hasse diagram)
Ø 2 1 12 Ø 2 1 12
Ø 1 {1} 2 {1,2} Ø 1 {1} 2 {1,2}
From Ø to {1,2} For i = 1,2,…,n walk from Bi–1 to Bi using
Bi = (Bi−1 ∪ {i})⊥
(Not necessarily walks in the Hasse diagram)
Ø 2 1 12 Ø 2 1 12
Ø 1 {1} 2 {1,2} Ø 1 {1} 2 {1,2}
From Ø to {1,2} For i = 1,2,…,n walk from Bi–1 to Bi using
Bi = (Bi−1 ∪ {i})⊥
“bottom” above
(Not necessarily walks in the Hasse diagram)
Ø 2 1 12 Ø 2 1 12
Ø 1 {1} 2 {1,2} Ø 1 {1} 2 {1,2}
From Ø to {1,2} For i = 1,2,…,n walk from Bi–1 to Bi using
Bi = (Bi−1 ∪ {i})⊥
A⊥ = min
B⊇A B∈L
B
“bottom” above
2 3 23 24 39 234 239 248 2348 2349
Summary Embed L in subset lattice using spectrum map. Define unique family of “bottom” walks. Circuit sums over these. Time = # irreducibles ⋅ # elements = # covering pairs (Hasse edges)
Applications of FZT
Dempster–Schafer belief propagation?
Which other semigroups allow FZTs?
Faster? Lower bounds?
Killer application beyond graph colouring?