Counting Linear Extensions of Sparse Posets Kustaa Kangas , Teemu - - PowerPoint PPT Presentation

counting linear extensions of sparse posets
SMART_READER_LITE
LIVE PREVIEW

Counting Linear Extensions of Sparse Posets Kustaa Kangas , Teemu - - PowerPoint PPT Presentation

HELSINGIN YLIOPISTO HELSINGFORS UNIVERSITET UNIVERSITY OF HELSINKI Counting Linear Extensions of Sparse Posets Kustaa Kangas , Teemu Hankala, Teppo Niinimki, Mikko Koivisto July 13, 2016 University of Helsinki Department of Computer


slide-1
SLIDE 1

HELSINGIN YLIOPISTO HELSINGFORS UNIVERSITET UNIVERSITY OF HELSINKI

Counting Linear Extensions of Sparse Posets

Kustaa Kangas, Teemu Hankala, Teppo Niinimäki, Mikko Koivisto July 13, 2016

University of Helsinki Department of Computer Science

slide-2
SLIDE 2

Partially ordered set (poset)

A set P with an antisymmetric, transitive relation

slide-3
SLIDE 3

Partially ordered set (poset)

Cover graph

slide-4
SLIDE 4

Linear extensions

A linear extension = order preserving permutation

slide-5
SLIDE 5

Counting linear extensions

#P-complete (Brightwell & Winkler, ’91) Applications: sequence analysis, preference reasoning, sorting, learning probabilistic models, ...

slide-6
SLIDE 6

Counting linear extensions

Currently we can do O(2nn) time for n elements. We give two algorithms, based on

  • 1. recursion (exploiting low connectivity)
  • 2. variable elimination (exploiting low treewidth)
slide-7
SLIDE 7

Counting linear extensions

Currently we can do O(2nn) time for n elements. We give two algorithms, based on

  • 1. recursion (exploiting low connectivity)
  • 2. variable elimination (exploiting low treewidth)
slide-8
SLIDE 8

Recursive counting

ℓ(P) = the number of linear extensions of poset P Rule 1 ℓ(P) =

  • x ∈ min(P)

ℓ(P \ x) Rule 2 ℓ(P) =

  • (D,U)

ℓ(D) · ℓ(U) Rule 3 ℓ(P) =

k

  • i=1

ℓ(Si) Rule 4 ℓ(P) = ℓ(A) · ℓ(B) · |P| |A|

slide-9
SLIDE 9

Recursive counting

P \ a P \ b P

slide-10
SLIDE 10

Recursive counting

P \ a P \ b P

slide-11
SLIDE 11

Recursive counting

A B P

slide-12
SLIDE 12
slide-13
SLIDE 13

Recursive counting

Experiments on sparse posets for n = 30, . . . , 100

20 40 60 80 100 Percentage of posets solved 10−1 100 101 102 103 Time (s)

R14-a R134 R1 R24

slide-14
SLIDE 14

Counting linear extensions

Currently we can do O(2nn) time for n elements. We give two algorithms, based on

  • 1. recursion (exploiting low connectivity)
  • 2. variable elimination (exploiting low treewidth)
slide-15
SLIDE 15

Variable elimination

  • a,b,c,d,e,f

φ1(a, b, d) φ2(a, c) φ3(b, c, e) φ4(d, f)

slide-16
SLIDE 16

Variable elimination

  • a,b,c,d,e,f

φ1(a, b, d) φ2(a, c) φ3(b, c, e) φ4(d, f)

slide-17
SLIDE 17

Variable elimination

  • a,b,c,d,e,f

φ1(a, b, d) φ2(a, c) φ3(b, c, e) φ4(d, f)

slide-18
SLIDE 18

Variable elimination

  • a,b,c,d,e,f

φ1(a, b, d) φ2(a, c) φ3(b, c, e) φ4(d, f) Polynomial time for bounded treewidth

slide-19
SLIDE 19

Variable elimination

For every permutation σ : P → [n] define Φ(σ) =

  • x ≺ y

[σx < σy]

slide-20
SLIDE 20

Variable elimination

For every permutation σ : P → [n] define Φ(σ) =

  • x ≺ y

[σx < σy] Φ(σ) = [σa < σc] [σa < σd] [σb < σd] [σc < σe] [σd < σe]

slide-21
SLIDE 21

Variable elimination

For every permutation σ : P → [n] define Φ(σ) =

  • x ≺ y

[σx < σy] Then, Φ(σ) = 1, if σ is a linear extension, 0, otherwise.

slide-22
SLIDE 22

Variable elimination

For every permutation σ : P → [n] define Φ(σ) =

  • x ≺ y

[σx < σy] Then, Φ(σ) = 1, if σ is a linear extension, 0, otherwise. As a consequence ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ)

slide-23
SLIDE 23

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ)

slide-24
SLIDE 24

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ) Can’t apply variable elimination because of the bijectivity constraint.

slide-25
SLIDE 25

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ) =

  • X ⊆ [n]

(−1)n−|X|

  • σ : P → X

Φ(σ) =

n

  • k=0

n k

  • (−1)n−k
  • σ : P → [k]

Φ(σ) Inclusion–exclusion principle

slide-26
SLIDE 26

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ) =

  • X ⊆ [n]

(−1)n−|X|

  • σ : P → X

Φ(σ) =

n

  • k=0

n k

  • (−1)n−k
  • σ : P → [k]

Φ(σ) O(nt+4) time for treewidth t

slide-27
SLIDE 27

Variable elimination

VEIE: Variable elimination via inclusion–exclusion

30 40 50 60 70 80 90 100 Poset size (n) 10−1 100 101 102 103 Time (s) t = 2

VEIE R1 R14-a

slide-28
SLIDE 28

Summary

Recursion: often fast in practice Variable elimination: polynomial time for bounded treewidth Thank you!