#14126: Count Number of Linear Extensions of a Poset
-------------------------------------+-------------------------------------
       Reporter:  csar               |        Owner:  sage-combinat
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorics      |   Resolution:
       Keywords:  days45             |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:  u/jmantysalo       |       Commit:
  /count-lin-ext                     |  f908696aa7c63cefbc382af326cfe085e0dfa522
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by kdilks):

 Whatever it is, asymptotics aren't particularly relevant when in practice
 we're not going past |P|>100.

 Even without any wizardry,
 {{{P.order_ideals_lattice().chain_polynomial().leading_coefficient()}}}
 (the naive implementation I mentioned) is significantly faster than
 {{{P.linear_extensions().cardinality()}}} (which defaults to using the
 iterator and generates all of them). Twice as fast on the antichain of 8
 elements, ten times as fast on {{{P=Posets.TamariLattice(4)}}} (14
 elements, 20243 linear extensions), ~600 times as fast on
 {{{P=Posets.IntegerCompositions(5)}}} (16 elements, 1680384 linear
 extensions).

--
Ticket URL: <https://trac.sagemath.org/ticket/14126#comment:33>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to