You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to implement a new algorithm for the unranking of combinations in the lexicographic order, cf. sage.combinat.combination algorithm from_rank.
The actual implementation is related to McCaffrey's blog.
In a recent paper I have written, cf. https://hal.archives-ouvertes.fr/hal-02462764v1
I compare this method to other from the literature and a new one I have developed with my co-authors. The paper is actually under review.
If possible I would like to commit this new implementation. My function has the same signature from the previous one.
Regards.
Antoine
Example :
Actual implementation (on my laptop : core i7 32GiB Ubuntu Linux)
---n=100k=50set_random_seed(12345678987654321)
r=randint(0, binomial(n,k)-1)
%timeA=combination.from_rank(r,n,k)
---CPUtimes: user1.55ms, sys: 0ns, total: 1.55msWalltime: 1.06ms## With my algorithm## (in the commit the function replace from_rank(.,.,.))%timeB=unrank_combi_direct(r, n, k)
---CPUtimes: user297µs, sys: 53µs, total: 350µsWalltime: 296µs## Finally---A==B---True## A second example with greater values---n=10000k=5000set_random_seed(12345678987654321)
r=randint(0, binomial(n,k)-1)
%timeA=combination.from_rank(r,n,k)
---CPUtimes: user2.9s, sys: 9.69ms, total: 2.91sWalltime: 2.85s## With my algorithm%timeB=unrank_combi_direct(r, n, k)
---CPUtimes: user22.4ms, sys: 4.45ms, total: 26.9msWalltime: 21ms## Finally---A==B---True
I propose to implement a new algorithm for the unranking of combinations in the lexicographic order, cf. sage.combinat.combination algorithm from_rank.
The actual implementation is related to McCaffrey's blog.
In a recent paper I have written, cf. https://hal.archives-ouvertes.fr/hal-02462764v1
I compare this method to other from the literature and a new one I have developed with my co-authors. The paper is actually under review.
If possible I would like to commit this new implementation. My function has the same signature from the previous one.
Regards.
Antoine
Example :
Actual implementation (on my laptop : core i7 32GiB Ubuntu Linux)
Component: combinatorics
Keywords: combination unranking
Author: Antoine Genitrini
Reviewer: Dave Morris
Issue created by migration from https://trac.sagemath.org/ticket/29258
The text was updated successfully, but these errors were encountered: