fast monotone summation over disjoint sets
play

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


  1. 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 Computer Science, University of Helsinki

  2. Introduction: Algebrisation and k -Path

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

  4. Problem: counting 2 k -paths Input : graph G = ( V , E ) Output : number of 2 k -paths with middle vertex v ◮ Trivial algorithm n O ( 1 ) � n � 2 k ◮ Counting in halves n O ( 1 ) � n � [Björklund et al. 2009] k

  5. 1. Let f ( X ) = # of k -paths on X ∪ { v } ending at v .

  6. 1. Let f ( X ) = # of k -paths on X ∪ { v } ending at v . 2. Recover the number of 2 k -paths as 1 � f ( Y ) · f ( X ) 2 X , Y : X ∩ Y = ∅

  7. ◮ Inclusion-exclusion in time n O ( 1 ) � n � : k � e ( Y ) = f ( X ) X : X ∩ Y = ∅ ( − 1 ) | X | � � e ( Y ) = f ( Z ) X ⊆ Y Z ⊇ X ◮ Recover the result as � � f ( Y ) · f ( X ) = f ( Y ) · e ( Y ) X , Y : X ∩ Y = ∅ Y

  8. What if we do not have additive inverses?

  9. Definition ( k -disjoint summation) Let [ n ] = { 1 , 2 , . . . , n } . f ( X ) Input : for all X , � Output : e ( Y ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of [ n ] of size k .

  10. Definition ( k -disjoint summation) Let [ n ] = { 1 , 2 , . . . , n } . f ( X ) Input : for all X , � Output : e ( Y ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of [ n ] of size k . Inputs Outputs � n � f e � n � k k

  11. Definition ( k -disjoint summation) Let [ n ] = { 1 , 2 , . . . , n } . f ( X ) Input : for all X , � Output : e ( Y ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of [ n ] of size k . �� n �� n − k �� ◮ Trivial algorithm O . k k � � n �� ◮ Inclusion-exclusion O k [Björklund et al. 2009]: k � ( − 1 ) | X | � e ( Y ) = f ( Z ) X ⊆ Y Z ⊇ X

  12. 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 ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of X of size k .

  13. 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 ) = f ( X ) for all Y , X : X ∩ 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 ) = X : X ∩ Y = ∅ f ( X ) max for all Y .

  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 ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of X of size k . �� n �� n − k �� ◮ Trivial algorithm O . k k ◮ Inclusion-exclusion? ( − 1 ) | X | � � e ( Y ) = f ( Z ) X ⊆ Y Z ⊇ X

  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 ) = f ( X ) for all Y , X : X ∩ Y = ∅ where X and Y range over subsets of X of size k .

  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 ) = f ( X ) for all Y , X : X ∩ 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 ( n k + 2 polylog ( n )) .

  17. Semiring Encodings

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

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

  20. Counting maximum-weight 2 k -paths Input : graph G = ( V , E ) with edge weights Output : number of 2 k -paths with middle vertex v and weight w ∗ , where w ∗ the maximum weight of a 2 k -path. ◮ If weights are integers at most W , then problem can be solved with counting in halves and polynomial encoding in time W · n O ( 1 ) � n � k

  21. Counting maximum-weight 2 k -paths Input : graph G = ( V , E ) with edge weights Output : number of 2 k -paths with middle vertex v and weight w ∗ , where w ∗ the maximum weight of a 2 k -path. ◮ If weights are integers at most W , then problem can be solved with counting in halves and polynomial encoding in time W · n O ( 1 ) � n � k ◮ Counting in halves with semiring encoding and monotone disjoint summation n k + O ( 1 )

  22. The Cartesian product N × ( R ∪ {−∞} ) is a commutative semiring when equipped with operations  ( c , w ) if w > v ,    ( c , w ) ⊕ ( d , v ) = ( d , v ) if w < v ,   ( c + d , w ) if w = v  and ( c , w ) ⊙ ( d , v ) = ( cd , w + v ) .

  23. 3 3 1 2 3 2 5 3 4 1 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 .

  24. 1 3 2 3 1 2 1 2 3 2 5 3 5 1 4 1 3 1 1 3 (3 , 18) ⊗ (2 , 15) = (6 , 33) ◮ Compute ( c , w ∗ ) = � f ( Y ) ⊗ f ( X ) X , Y : X ∩ Y = ∅ ◮ Then the maximum weight of a path is w ∗ and the number of maximum weight paths is 1 2 c

  25. Further Applications ◮ k × n matrix permanent in time n k / 2 + O ( 1 ) over noncommmutative semirings: A ∈ S k × n Input : � Output : perm ( A ) = a 1 σ ( 1 ) a 2 σ ( 2 ) · · · a k σ ( k ) σ ◮ Maximisation with restrictions, e.g. in machine � 2 : learning, n k + O ( 1 ) vs. n O ( 1 ) � n k f ( X ) ∈ Q Input : for all X Output : e ( Y ) = X : X ∩ Y = ∅ f ( X ) max for all Y

  26. Computing Monotone Disjoint Sums

  27. Special Case: 1-Disjoint Summation Let [ n ] = { 1 , 2 , . . . , n } and let ( S , ⊕ ) be a commutative semigroup. Input : f i ∈ S for i = 1 , 2 , . . . , n � Output : e j = f i for j = 1 , 2 , . . . , n i � = j

  28. Special Case: 1-Disjoint Summation Let [ n ] = { 1 , 2 , . . . , n } and let ( S , ⊕ ) be a commutative semigroup. Input : f i ∈ S for i = 1 , 2 , . . . , n � Output : e j = f i for j = 1 , 2 , . . . , n i � = j Lemma [Valiant 1986] There is an S -arithmetic circuit of size O ( n ) for monotone 1-disjoint summation.

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

  30. Monotone k -disjoint summation, extended Let [ n ] = { 1 , 2 , . . . , n } and let ( S , ⊕ ) be a commutative semigroup. Input : f ( X ) ∈ S for all X , � e ( Y ) = f ( X ) for all Y , Output : X : X ∩ Y = ∅ where X and Y range over subsets of [ n ] of size at most k .

  31. Monotone k -disjoint summation, extended Let [ n ] = { 1 , 2 , . . . , n } and let ( S , ⊕ ) be a commutative semigroup. Input : f ( X ) ∈ S for all X , � e ( Y ) = f ( X ) for all Y , Output : X : X ∩ 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 ( n k log n ) for extended monotone k -disjoint summation. Furthermore, the circuit can be constructed in time O ( k 2 n k polylog n ) .

  32. [ n ]

  33. 0 1 2 3 [ n ] 4

  34. 0 1 2 3 X 4

  35. 0 1 X | 2 2 3 X 4

  36. 0 X | 1 1 X | 2 2 3 X 4

  37. 0 1 W 2 3 4

  38. 0 1 W 2 3 4 Y

  39. 0 1 W 2 3 4 Y

  40. { r } 0 1 2 3 4 Y

  41. Concluding Remarks ◮ Working with semigroups and -rings

  42. Concluding Remarks ◮ Working with semigroups and -rings ◮ Open question: � � n �� O ( n k log n ) vs. O k ? k

  43. Concluding Remarks ◮ Working with semigroups and -rings ◮ Open question: � � n �� O ( n k log n ) vs. O k ? k ◮ [Sergeev 2012]: √ � � n �� α = 3 + 5 α k O , k 2

  44. Concluding Remarks ◮ Working with semigroups and -rings ◮ Open question: � � n �� O ( n k log n ) vs. O k ? k ◮ [Sergeev 2012]: √ � � n �� α = 3 + 5 α k O , k 2 Thank you – Questions?

Recommend


More recommend