This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #17048: Faster Posets.RandomPoset
Nathann Cohen wrote on another ticket: "This code could be seriously rewritten, though. In two different ways: 1) Assume from the start that 0,...,n-1 is a linear extension, and only add edges i,j with i<j. With this you don't have to call `is_directed_acyclic` every second (and this is the bottleneck of the implementation). At the end, relabel everything randomly so that the linear extension is random, too 2) Work directly on the Hasse Diagram. Build the random Poset on n elements from a poset on n-1 elements: Consider all minimal elements `m_1,...m_c` of the previous digraph and add the edges `m_i,n` with probability `p`. If some edge `m_i` was not added, consider the immediate predecessors of `m_i` and do the same with them. This second way to build them benefits from the transitivity of posets. The last algorithm was mentionned by Florent and Nicolas to which I asked the question. They seemed to think that this generation of random posets was not standard, and that we could change it a bit if we like, i.e. without caring if by changing the algorithm we change the distribution of posets. It seems that it is only there to provide random posets for computer tests, with no specific property in mind." I add this on wishlist-milestone, so that I don't forget it totally. I'm not going to code this at least for release 6.4. URL: http://trac.sagemath.org/17048 Reported by: jmantysalo Ticket author(s): Jori Mäntysalo Reviewer(s): Frédéric Chapoton
- Loading branch information