Given a partially-ordered set (poset), what is an algorithm for estimating the probability of an element being top-most in a linear extension, assuming that all linear extensions are equally likely?
-
If memory serves, this is a #P-hard problem. Your poset wouldn't happen to be series-parallel, would it? – David Eisenstat May 06 '15 at 15:44
-
Unfortunately, no, though I'm considering ways to make it so. :) According to my research so far, saying anything useful about the whole poset or about a particular element is #P-hard, and approximations are generally O(n^6) and change, but I was curious whether this problem could yield anything nicer. – alltom May 06 '15 at 15:56
2 Answers
Approximate counting seems to be slower than approximate sampling, so your algorithm should simply be based on rejection sampling: repeatedly pick (approximately) random samples from the set of all linear extension, and directly calculate the proportion of those where your element is topmost.
Picking each random sample can certainly be done in O(n^3 log n), so depending on how accurate you need to be, it will end up being faster than the O(n^6) you quoted.

- 392
- 2
- 10
-
Interesting, thanks! The first sampling algorithm that comes to mind is one that sequentially introduces randomly directed pairwise orderings… Did you include "(approximately)" because we're not lucky enough to have such a simple algorithm? – alltom Feb 23 '22 at 20:21
For each item in the poset:
Remove the item from the poset
Count the number of linear extensions of the remaining items
Normalize the counts
You have the distribution!
However, counting the number of linear extensions is #P-complete, so this is super slow. In the end, only the proportion of the counts matters, so perhaps there is a more efficient algorithm?
There are approximation algorithms for counting linear extensions that could be plugged in, but I'm wondering if there is a more specific algorithm for getting right to the answer.

- 3,162
- 4
- 31
- 47