Fast Monotone Summation over Disjoint Sets Petteri Kaski 1 , 2 - - PowerPoint PPT Presentation

fast monotone summation over disjoint sets
SMART_READER_LITE
LIVE PREVIEW

Fast Monotone Summation over Disjoint Sets Petteri Kaski 1 , 2 - - PowerPoint PPT Presentation

Fast Monotone Summation over Disjoint Sets Petteri Kaski 1 , 2 Mikko Koivisto 1 , 3 Janne H. Korhonen 1 , 3 1 Helsinki Institute for Information Technology HIIT 2 Department of Information and Computer Science, Aalto University 3 Department of


slide-1
SLIDE 1

Fast Monotone Summation over Disjoint Sets

Petteri Kaski1,2 Mikko Koivisto1,3 Janne H. Korhonen1,3

1Helsinki Institute for Information Technology HIIT 2Department of Information and Computer Science, Aalto University 3Department of Computer Science, University of Helsinki

slide-2
SLIDE 2

Introduction: Algebrisation and k-Path

slide-3
SLIDE 3

Problem: counting 2k-paths

Input: graph G = (V, E) Output: number of 2k-paths with middle vertex v

slide-4
SLIDE 4

Problem: counting 2k-paths

Input: graph G = (V, E) Output: number of 2k-paths with middle vertex v

◮ Trivial algorithm nO(1) n 2k

  • ◮ Counting in halves nO(1)n

k

  • [Björklund et al. 2009]
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
  • 1. Let f (X) = # of k-paths on X ∪ {v} ending at v.
slide-8
SLIDE 8
  • 1. Let f (X) = # of k-paths on X ∪ {v} ending at v.
  • 2. Recover the number of 2k-paths as

1 2

  • X,Y : X∩Y=∅

f (Y) · f (X)

slide-9
SLIDE 9

◮ Inclusion-exclusion in time nO(1)n k

  • :

e(Y) =

  • X : X∩Y=∅

f (X) e(Y) =

  • X⊆Y

(−1)|X|

Z⊇X

f (Z)

◮ Recover the result as

  • X,Y : X∩Y=∅

f (Y) · f (X) =

  • Y

f (Y) · e(Y)

slide-10
SLIDE 10

What if we do not have additive inverses?

slide-11
SLIDE 11

Definition (k-disjoint summation)

Let [n] = {1, 2, . . . , n}. Input: f (X) for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of [n] of size k.

slide-12
SLIDE 12

Definition (k-disjoint summation)

Let [n] = {1, 2, . . . , n}. Input: f (X) for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of [n] of size k. f e n k

  • n

k

  • Inputs

Outputs

slide-13
SLIDE 13

Definition (k-disjoint summation)

Let [n] = {1, 2, . . . , n}. Input: f (X) for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of [n] of size k.

◮ Trivial algorithm O

n

k

n−k

k

  • .

◮ Inclusion-exclusion O

  • k

n

k

  • [Björklund et al. 2009]:

e(Y) =

  • X⊆Y

(−1)|X|

Z⊇X

f (Z)

slide-14
SLIDE 14

Definition (Monotone k-disjoint summation)

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of X of size k.

slide-15
SLIDE 15

Definition (Monotone k-disjoint summation)

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of X of size k.

Example ((S, ⊕) = (Q, max))

Input: f (X) ∈ Q for all X, Output: e(Y) = max

X : X∩Y=∅ f (X)

for all Y.

slide-16
SLIDE 16

Definition (Monotone k-disjoint summation)

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of X of size k.

◮ Trivial algorithm O

n

k

n−k

k

  • .

◮ Inclusion-exclusion?

e(Y) =

  • X⊆Y

(−1)|X|

Z⊇X

f (Z)

slide-17
SLIDE 17

Definition (Monotone k-disjoint summation)

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of X of size k.

slide-18
SLIDE 18

Definition (Monotone k-disjoint summation)

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of X of size k.

Our Result

Monotone k-disjoint summation can be solved in time O(nk+2 polylog(n)).

slide-19
SLIDE 19

Semiring Encodings

slide-20
SLIDE 20

Counting maximum-weight 2k-paths

Input: graph G = (V, E) with edge weights Output: number of 2k-paths with middle vertex v and weight w∗, where w∗ the maximum weight of a 2k-path.

1 2 3 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 3 5 3 3 3 3 3 3 3 1 4 4 4 4 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 5 3 3 3 3 3 1 1 1 1 1 5 2 3 3

slide-21
SLIDE 21

Counting maximum-weight 2k-paths

Input: graph G = (V, E) with edge weights Output: number of 2k-paths with middle vertex v and weight w∗, where w∗ the maximum weight of a 2k-path.

2 1 3 3 1 1 2 2 3 3 1 5 3 1

slide-22
SLIDE 22

Counting maximum-weight 2k-paths

Input: graph G = (V, E) with edge weights Output: number of 2k-paths with middle vertex v and weight w∗, where w∗ the maximum weight of a 2k-path.

◮ If weights are integers at most W, then problem can be

solved with counting in halves and polynomial encoding in time W · nO(1)n

k

slide-23
SLIDE 23

Counting maximum-weight 2k-paths

Input: graph G = (V, E) with edge weights Output: number of 2k-paths with middle vertex v and weight w∗, where w∗ the maximum weight of a 2k-path.

◮ If weights are integers at most W, then problem can be

solved with counting in halves and polynomial encoding in time W · nO(1)n

k

  • ◮ Counting in halves with semiring encoding and

monotone disjoint summation nk+O(1)

slide-24
SLIDE 24

The Cartesian product N × (R ∪ {−∞}) is a commutative semiring when equipped with operations (c, w) ⊕ (d, v) =

      

(c, w) if w > v, (d, v) if w < v, (c + d, w) if w = v and (c, w) ⊙ (d, v) = (cd, w + v) .

slide-25
SLIDE 25

2 1 1 3 3 2 3 3 4 5 3

f (X) = (3, 18)

◮ Let

f (X) = (c, w), where

◮ w is the maximum weight of k-path on X ∪ {v} ending

at v, and

◮ c is the number of such paths with weight w.

slide-26
SLIDE 26

2 1 1 3 3 2 3 3 4 5 3 2 1 1 1 2 3 1 1 5

(3, 18) ⊗ (2, 15) = (6, 33)

◮ Compute

(c, w∗) =

  • X,Y : X∩Y=∅

f (Y) ⊗ f (X)

◮ Then the maximum weight of a path is w∗ and the

number of maximum weight paths is 1

2c

slide-27
SLIDE 27

Further Applications

◮ k × n matrix permanent in time nk/2+O(1) over

noncommmutative semirings: Input: A ∈ Sk×n Output: perm(A) =

  • σ

a1σ(1)a2σ(2) · · · akσ(k)

◮ Maximisation with restrictions, e.g. in machine

learning, nk+O(1) vs. nO(1)n

k

2:

Input: f (X) ∈ Q for all X Output: e(Y) = max

X : X∩Y=∅ f (X)

for all Y

slide-28
SLIDE 28

Computing Monotone Disjoint Sums

slide-29
SLIDE 29

Special Case: 1-Disjoint Summation

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: fi ∈ S for i = 1, 2, . . . , n Output: ej =

  • i=j

fi for j = 1, 2, . . . , n

slide-30
SLIDE 30

Special Case: 1-Disjoint Summation

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: fi ∈ S for i = 1, 2, . . . , n Output: ej =

  • i=j

fi for j = 1, 2, . . . , n

Lemma [Valiant 1986]

There is an S-arithmetic circuit of size O(n) for monotone 1-disjoint summation.

slide-31
SLIDE 31

f₁ f₂ f₃ f₄ f₅ f₆ f₇ f₈ e₁ e₂ e₃ e₄ e₅ e₆ e₇ e₈

slide-32
SLIDE 32

Monotone k-disjoint summation, extended

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of [n] of size at most k.

slide-33
SLIDE 33

Monotone k-disjoint summation, extended

Let [n] = {1, 2, . . . , n} and let (S, ⊕) be a commutative semigroup. Input: f (X) ∈ S for all X, Output: e(Y) =

  • X : X∩Y=∅

f (X) for all Y, where X and Y range over subsets of [n] of size at most k.

Main theorem

There is an S-arithmetic circuit of size O(nk log n) for extended monotone k-disjoint summation. Furthermore, the circuit can be constructed in time O(k2nk polylog n).

slide-34
SLIDE 34

[n]

slide-35
SLIDE 35

[n] 1 2 3 4

slide-36
SLIDE 36

1 2 3 4 X

slide-37
SLIDE 37

1 2 3 4 X X|2

slide-38
SLIDE 38

1 2 3 4 X X|2 X|1

slide-39
SLIDE 39

1 2 3 4 W

slide-40
SLIDE 40

1 2 3 4 W Y

slide-41
SLIDE 41

1 2 3 4 W Y

slide-42
SLIDE 42

1 2 3 4 {r} Y

slide-43
SLIDE 43

Concluding Remarks

◮ Working with semigroups and -rings

slide-44
SLIDE 44

Concluding Remarks

◮ Working with semigroups and -rings ◮ Open question:

O(nk log n) vs. O

  • k

n

k

  • ?
slide-45
SLIDE 45

Concluding Remarks

◮ Working with semigroups and -rings ◮ Open question:

O(nk log n) vs. O

  • k

n

k

  • ?

◮ [Sergeev 2012]:

O

  • αk

n

k

  • ,

α = 3 + √ 5 2

slide-46
SLIDE 46

Concluding Remarks

◮ Working with semigroups and -rings ◮ Open question:

O(nk log n) vs. O

  • k

n

k

  • ?

◮ [Sergeev 2012]:

O

  • αk

n

k

  • ,

α = 3 + √ 5 2

Thank you – Questions?