JuliaMath / Combinatorics.jl

A combinatorics library for Julia
http://juliamath.github.io/Combinatorics.jl/dev/
Other
214 stars 58 forks source link

function nthcomb to match nthperm #132

Open ajloza opened 1 year ago

ajloza commented 1 year ago

I needed to sample the nth lexicographic combination of from a collection rather than nth permutation for some internal projects. I'm wondering if there's interest to have this functionality as part of Combinatorics.jl to match nthperm(). I've extracted the code to do this from the other project and made this repo https://github.com/ajloza/NthComb.jl Right now it's not using the nomenclature of nthperm for variable names, so if there is interest, I'd refactor it and try to match the api. Apologies if I've missed this functionality or an issue addressing it

ajloza commented 7 months ago

A few use cases have come up that support adding this method: 1) monte carlo sampling across a large combinatoric space 2) being able to perform parallelized operations on a large iterable of combinations, see this discussion Parallelizing over an iterable