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

counting linear extensions of sparse posets
SMART_READER_LITE
LIVE PREVIEW

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

Counting Linear Extensions of Sparse Posets Kustaa Kangas October 20, 2016 Papers Kustaa Kangas, Teemu Hankala, Teppo Niinimki, and Mikko Koivisto. Counting linear extensions of sparse posets, IJCAI16 Eduard Eiben, Robert Ganian,


slide-1
SLIDE 1

Counting Linear Extensions of Sparse Posets

Kustaa Kangas October 20, 2016

slide-2
SLIDE 2

Papers

◮ Kustaa Kangas, Teemu Hankala, Teppo Niinimäki,

and Mikko Koivisto. Counting linear extensions of sparse posets, IJCAI’16

◮ Eduard Eiben, Robert Ganian, Kustaa Kangas, and

Sebastian Ordyniak. Counting linear extensions: Parameterizations by treewidth, ESA’16

slide-3
SLIDE 3

Partially ordered set (poset)

A finite set + a reflexive, antisymmetric, transitive relation

slide-4
SLIDE 4

Partially ordered set (poset)

Cover relation / cover graph (transitive reduction)

slide-5
SLIDE 5

Linear extensions

Linear order: all pairs are comparable

slide-6
SLIDE 6

Linear extensions

A linear extension = order preserving permutation

slide-7
SLIDE 7

Counting linear extensions

Determining the number of linear extensions of a given poset is #P-complete (Brightwell & Winkler, ’91) (by reduction from #3SAT)

slide-8
SLIDE 8

Motivation

Classic application: sorting Other uses: preference reasoning, planning, convex rank tests, sequence analysis, ...

slide-9
SLIDE 9

Motivation

Sampling Bayesian networks from a posterior distribution

slide-10
SLIDE 10

Motivation

Markov Chain Monte Carlo

◮ States are DAGs ◮ Stationary distribution is the posterior

Order MCMC:

◮ States are linear orders ◮ Sample first an order, then a compatible DAG ◮ Faster mixing but requires bias correction via

counting linear extensions of sampled DAGs

slide-11
SLIDE 11

Known algorithms

Trivial solution: enumerate all orders (factorial time) The best we can do is O(2nn) time for n elements Polynomial time for special cases:

◮ Polytrees ◮ Series-parallel ◮ Bounded width ◮ Bounded decomposition diameter ◮ N-free orders of bounded activity

A fpras also exists

slide-12
SLIDE 12

First paper

We give two algorithms, exploiting sparsity of the poset

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

First paper

We give two algorithms, exploiting sparsity of the poset

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

Recursive counting

ℓ(P) = the number of linear extensions of poset P A simple observation: ℓ(P) =

  • x ∈ min(P)

ℓ(P \ x)

slide-15
SLIDE 15

Recursive counting

P \ a P \ b P

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19

Recursive counting

If A and B partition P and are mutually disconnected, then ℓ(P) = ℓ(A) · ℓ(B) · |P| |A|

slide-20
SLIDE 20

Recursive counting

A B P

slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25

Recursive counting

Deciding whether to transpose is not trivial. We consider two heuristics

  • 1. Only count minimal and maximal elements
  • 2. Estimate the size of subproblem space recursively

In practice both heuristics almost always make the better choice.

slide-26
SLIDE 26

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-27
SLIDE 27

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-28
SLIDE 28

Recursive counting

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

10−1 100 101 102 103 Running time of R14-worst (s) 10−1 100 101 102 103 Running time of R14-best (s)

slide-29
SLIDE 29

First paper

We give two algorithms, exploiting sparsity of the poset

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

Variable elimination

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

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

slide-31
SLIDE 31

Variable elimination

  • a,b,c,d,e

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

  • f

φ4(d, f)

slide-32
SLIDE 32

Variable elimination

  • a,b,c,d,e

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

slide-33
SLIDE 33

Variable elimination

  • a,b,c,e

φ2(a, c) φ3(b, c, e)

  • d

φ1(a, b, d) λ1(d)

slide-34
SLIDE 34

Variable elimination

  • a,b,c,e

φ2(a, c) φ3(b, c, e) λ2(a, b)

slide-35
SLIDE 35

Variable elimination

  • a
  • b
  • e

φ3(b, c, e)

  • c

φ2(a, c)

d

φ1(a, b, d)

  • f

φ4(d, f)

  • Elimination order matters!
slide-36
SLIDE 36

Variable elimination

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

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

slide-37
SLIDE 37

Variable elimination

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

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

slide-38
SLIDE 38

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-39
SLIDE 39

Variable elimination

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

  • x ≺ y

[σx < σy]

slide-40
SLIDE 40

Variable elimination

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

  • x ≺ y

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

slide-41
SLIDE 41

Variable elimination

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

  • x ≺ y

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

slide-42
SLIDE 42

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-43
SLIDE 43

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

Φ(σ)

slide-44
SLIDE 44

Variable elimination

ℓ(P) =

  • σ : P → [n]

bijection

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

slide-45
SLIDE 45

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-46
SLIDE 46

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-47
SLIDE 47

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-48
SLIDE 48

Parameterized complexity

Let n be input size and k an additional numerical parameter of the input.

◮ XP: problems solvable in time nf(k) ◮ FPT: problems solvable in time f(k) · nO(1).

Problems in FPT are called fixed-parameter tractable.

slide-49
SLIDE 49

Parameterized complexity

Results: Counting linear extensions is...

◮ W[1]-hard when parameterized by the treewidth of

the cover graph

◮ in FPT when parameterized by the treewidth of the

incomparability graph A W[1]-hard problem is not in FPT unless FPT = W[1].

slide-50
SLIDE 50

Summary

◮ Recursion: often fast in practice ◮ Variable elimination: polynomial time for bounded

treewidth Thank you!