# \#combinatorics

**URL:** https://discourse.julialang.org/tag/combinatorics/631.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Iterating over integer simplex](https://discourse.julialang.org/t/iterating-over-integer-simplex/135060)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 14\
**Last updated:** [January 16, 2026, 12:29pm UTC](https://discourse.julialang.org/t/iterating-over-integer-simplex/135060 "2026-01-16T12:29:59Z")

</div>

I need to iterate over all K-tuples of nonnegative Ints that sum to N. Eg if K is 3 and N==3, (0,0,3) (0,1,2) (0,2,1) (0,3,0) (1,0,2) (1,1,1) (1,2,0) (2,0,1) (2,1,0) (3,0,0) Ordering does not matter, just full travers…

---

## [Fully Unique Combinations from Multiple Arrays](https://discourse.julialang.org/t/fully-unique-combinations-from-multiple-arrays/133626)

<div class="topic-metadata">

**Author:** [@wes648](https://discourse.julialang.org/u/wes648)\
**Replies:** 15\
**Last updated:** [November 5, 2025, 5:57pm UTC](https://discourse.julialang.org/t/fully-unique-combinations-from-multiple-arrays/133626 "2025-11-05T17:57:19Z")

</div>

Hello! I have a model with n terms and the ability to remove k of them. However each of the k removal options can only act on an arbitrary list of model terms. I want a memory-efficient way to generate every unique comb…

---

## [Finding all arrays of length L that add up to a certain number](https://discourse.julialang.org/t/finding-all-arrays-of-length-l-that-add-up-to-a-certain-number/119932)

<div class="topic-metadata">

**Author:** [@AbhayGupta115](https://discourse.julialang.org/u/AbhayGupta115)\
**Replies:** 11\
**Last updated:** [September 30, 2024, 1:09pm UTC](https://discourse.julialang.org/t/finding-all-arrays-of-length-l-that-add-up-to-a-certain-number/119932 "2024-09-30T13:09:54Z")

</div>

I want to create an array of tuples where each tuple is of length L and the sum of all elements come to a defined number. I do have a solution currently, but it is not scalable till what I need, I get thrown an OutOfMem…

---

## [\[pre-ANN\] RingStarProblems.jl ⸺ A RSPSolver](https://discourse.julialang.org/t/pre-ann-ringstarproblems-jl-a-rspsolver/116992)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 5\
**Last updated:** [August 1, 2024, 11:24pm UTC](https://discourse.julialang.org/t/pre-ann-ringstarproblems-jl-a-rspsolver/116992 "2024-08-01T23:24:20Z")

</div>

A Ring Star Problem variants Solver I am super happy to share the package RingStarProblems.jl. This package aims to provide a solver to the Ring Star Problem and its variants. You can checkout the Labbé et al. (2004) …

---

## [New package \`Posets\`](https://discourse.julialang.org/t/new-package-posets/117981)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 8\
**Last updated:** [August 9, 2024, 4:33pm UTC](https://discourse.julialang.org/t/new-package-posets/117981 "2024-08-09T16:33:27Z")

</div>

Announcing a new package for working with partially ordered sets: Posets. This package is based on Julia Graphs both in terms of dependency and design philosophy. Posets is available now in the Julia registry and more …

---

## [AnalyticComb.jl - Analytic Combinatorics in Julia](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196)

<div class="topic-metadata">

**Author:** [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Replies:** 9\
**Last updated:** [May 30, 2024, 2:18pm UTC](https://discourse.julialang.org/t/analyticcomb-jl-analytic-combinatorics-in-julia/104196 "2024-05-30T14:18:38Z")

</div>

Hello, fellow Julia enthusiasts, I started to implement symbolic methods for combinatorial problems ( GitHub - fargolo/AnalyticComb.jl: Solutions for combinatorial problems using symbolic methods. ) following Flajolet & …

---

## [Time-series analysis - Probabilistic inference on RQA ( SymbolicInference.jl)](https://discourse.julialang.org/t/time-series-analysis-probabilistic-inference-on-rqa-symbolicinference-jl/114701)

<div class="topic-metadata">

**Author:** [@fargolo](https://discourse.julialang.org/u/fargolo)\
**Replies:** 0\
**Last updated:** [May 24, 2024, 8:15pm UTC](https://discourse.julialang.org/t/time-series-analysis-probabilistic-inference-on-rqa-symbolicinference-jl/114701 "2024-05-24T20:15:40Z")

</div>

How it started The SymbolicInference.jl package uses Analytic Combinatorics to perform probabilistic inference over certain combinatorial classes. The first application is explained in this white paper Probabilistic in…

---

## [Type-stable alternatives to Iterators.product?](https://discourse.julialang.org/t/type-stable-alternatives-to-iterators-product/113790)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [May 3, 2024, 12:50pm UTC](https://discourse.julialang.org/t/type-stable-alternatives-to-iterators-product/113790 "2024-05-03T12:50:19Z")

</div>

I’m dealing with a combinatorial problem. Given N vectors of integers of varied lengths, I want to find all possible ways to select one integer from each vector. Here’s my code, which is unfortunately not type-stable: j…

---

## [Show Combinatorics.jl some (easy?) love](https://discourse.julialang.org/t/show-combinatorics-jl-some-easy-love/108847)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 1\
**Last updated:** [February 8, 2024, 9:51pm UTC](https://discourse.julialang.org/t/show-combinatorics-jl-some-easy-love/108847 "2024-02-08T21:51:11Z")

</div>

Combinatorics.jl amassed a fair number of small PRs over the last 12 months. I see lots of passing tests. Could someone from JuliaMath have a look and merge anything that looks good to go?

---

## [\[ANN\] New package FinitePosets](https://discourse.julialang.org/t/ann-new-package-finiteposets/96707)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 0\
**Last updated:** [March 28, 2023, 11:44am UTC](https://discourse.julialang.org/t/ann-new-package-finiteposets/96707 "2023-03-28T11:44:31Z")

</div>

This new (registered) package is at FinitePosets. Here is the README “”" This package deals with finite posets. There are two types of posets. A “canonical poset” or CPoset is on the elements 1:n where n=leng…

---

## [How to use Combinatorics.jl for permutations](https://discourse.julialang.org/t/how-to-use-combinatorics-jl-for-permutations/90766)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 2\
**Last updated:** [November 24, 2022, 7:43pm UTC](https://discourse.julialang.org/t/how-to-use-combinatorics-jl-for-permutations/90766 "2022-11-24T19:43:02Z")

</div>

I would like to gather all permutations of a certain number of elements of a set. I read that Combinatorics.jl can be used for that. However, I do not know how to use it. I do the following using Combinatorics: permutat…

---

## [Issues using multithreading with Combinatorics](https://discourse.julialang.org/t/issues-using-multithreading-with-combinatorics/85318)

<div class="topic-metadata">

**Author:** [@Philip\_Stuckey](https://discourse.julialang.org/u/Philip_Stuckey)\
**Replies:** 1\
**Last updated:** [August 4, 2022, 11:44pm UTC](https://discourse.julialang.org/t/issues-using-multithreading-with-combinatorics/85318 "2022-08-04T23:44:56Z")

</div>

When I try to run the following code using Combinatorics using Base.Threads five\_letter\_words = \["taxis", "deans", "krone", "unset", "other", "ovens", "spilt", "yanks", "flout", "clang"\] @threads :static for combo in co…

---

## [Why does Base.findmin assume that Combinatorics.Permutations has a \`keys\` method?](https://discourse.julialang.org/t/why-does-base-findmin-assume-that-combinatorics-permutations-has-a-keys-method/82774)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [June 14, 2022, 7:03pm UTC](https://discourse.julialang.org/t/why-does-base-findmin-assume-that-combinatorics-permutations-has-a-keys-method/82774 "2022-06-14T19:03:29Z")

</div>

With Julia 1.8.0-rc1: julia\> using Combinatorics julia\> findmin(collect(permutations(1:3, 1))) # Works fine. (\[1\], 1) julia\> findmin(permutations(1:3, 1)) # Fails. ERROR: MethodError: no method matching keys(::Combi…

---

## [Generate all possible codewords given a dictionary](https://discourse.julialang.org/t/generate-all-possible-codewords-given-a-dictionary/81388)

<div class="topic-metadata">

**Author:** [@Alehud](https://discourse.julialang.org/u/Alehud)\
**Replies:** 2\
**Last updated:** [May 20, 2022, 9:29pm UTC](https://discourse.julialang.org/t/generate-all-possible-codewords-given-a-dictionary/81388 "2022-05-20T21:29:27Z")

</div>

I have a 1D array that is my “dictionary”. E.g., d = \['a', 'b', 'c'\] I want to generate all possible codewords of length n composed of elements from d. For example, if n = 2, then the output I expect is \['a', 'a'\] \['a…

---

## [In what format does the "permutations" command in the Combinatorics library compute the permutations?](https://discourse.julialang.org/t/in-what-format-does-the-permutations-command-in-the-combinatorics-library-compute-the-permutations/74451)

<div class="topic-metadata">

**Author:** [@BinChicken42](https://discourse.julialang.org/u/BinChicken42)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 8:27am UTC](https://discourse.julialang.org/t/in-what-format-does-the-permutations-command-in-the-combinatorics-library-compute-the-permutations/74451 "2022-01-12T08:27:20Z")

</div>

I’m talking about this command: \[Docstrings · Combinatorics.jl\], Combinatorics version is 1.0.2, Julia version is 1.7.1 I want to see if the digits in a number (except one digit, called dig) add up to dig. My plan is to…

---

## [Why is the intersection of a polyhedra with itself not equal to itself?](https://discourse.julialang.org/t/why-is-the-intersection-of-a-polyhedra-with-itself-not-equal-to-itself/72585)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 7\
**Last updated:** [December 4, 2021, 7:38pm UTC](https://discourse.julialang.org/t/why-is-the-intersection-of-a-polyhedra-with-itself-not-equal-to-itself/72585 "2021-12-04T19:38:42Z")

</div>

using Polyhedra import CDDLib lib = CDDLib.Library() P = polyhedron(vrep(Acolums,Is),lib) #(lines=Acolums , rays = Is) println(intersect(P,P) == P ) # it should be true but it gives false How can it be made to ret…

---

## [How to find generators of right kernel of a matrix](https://discourse.julialang.org/t/how-to-find-generators-of-right-kernel-of-a-matrix/71874)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 4\
**Last updated:** [December 3, 2021, 12:36pm UTC](https://discourse.julialang.org/t/how-to-find-generators-of-right-kernel-of-a-matrix/71874 "2021-12-03T12:36:52Z")

</div>

(Matrix R^m x d s = subset(1:m,d)) and correspend this math notation. Is there any funtions for these

---

## [How to find dimesion of a polyhedron](https://discourse.julialang.org/t/how-to-find-dimesion-of-a-polyhedron/72383)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 2\
**Last updated:** [December 1, 2021, 4:36pm UTC](https://discourse.julialang.org/t/how-to-find-dimesion-of-a-polyhedron/72383 "2021-12-01T16:36:14Z")

</div>

K = polyhedron(vrep(\[Ray(\[0.0,0.0,1.0\])\] )) let say we have K polyhedron is there any function like dim(k) which give the dimension of k if no how to find dimesion? using LinearAlgebra using Combinatorics using Poly…

---

## [Is there a polyhedra package that will meet my need](https://discourse.julialang.org/t/is-there-a-polyhedra-package-that-will-meet-my-need/71010)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 1\
**Last updated:** [November 5, 2021, 3:24pm UTC](https://discourse.julialang.org/t/is-there-a-polyhedra-package-that-will-meet-my-need/71010 "2021-11-05T15:24:22Z")

</div>

I need to implement this algorithm, but need exact same constructor of polyhedra. I don’t know julia, can someone help? or for “I\_s” , rigt kernel of matrix, power set … are there functions for these?

---

## [Randomized Hypothesis Test (row-level analysis): DimensionMismatch ERROR](https://discourse.julialang.org/t/randomized-hypothesis-test-row-level-analysis-dimensionmismatch-error/70663)

<div class="topic-metadata">

**Author:** [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Replies:** 16\
**Last updated:** [November 1, 2021, 3:47pm UTC](https://discourse.julialang.org/t/randomized-hypothesis-test-row-level-analysis-dimensionmismatch-error/70663 "2021-11-01T15:47:49Z")

</div>

Hello Everyone, Using = Pluto 0.17.\* using Combinatorics, StatsBase Am working with the following DF P1 = DataFrame(Col1 = rand(1:5:100,10), Col2 = rand(1:3:150,10), Col3=rand(1:4:250,10) and another dataframe where…

---

## [Need a combinatorial optimizer for black box function](https://discourse.julialang.org/t/need-a-combinatorial-optimizer-for-black-box-function/68791)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 6\
**Last updated:** [September 27, 2021, 1:34pm UTC](https://discourse.julialang.org/t/need-a-combinatorial-optimizer-for-black-box-function/68791 "2021-09-27T13:34:03Z")

</div>

I’m looking for a combinatorial optimizer (decision variables are a permutation of the integers 1, 2, \\ldots, N, where N is between, say, 50, and 500, for a black box function (i.e., only the value of the objective funct…

---

## [Help speedup a brute-force solution](https://discourse.julialang.org/t/help-speedup-a-brute-force-solution/62894)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 13\
**Last updated:** [June 18, 2021, 8:50am UTC](https://discourse.julialang.org/t/help-speedup-a-brute-force-solution/62894 "2021-06-18T08:50:36Z")

</div>

The following function calculates all possible subsets of a set 1:n such that all subsets are primes. This is only a brute-force algorithm to test a solution, so it’s too slow as expected. The number of allocations is hu…

---

## [Permutations of a vector that retain the vector "structure"](https://discourse.julialang.org/t/permutations-of-a-vector-that-retain-the-vector-structure/56790)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [March 10, 2021, 12:16am UTC](https://discourse.julialang.org/t/permutations-of-a-vector-that-retain-the-vector-structure/56790 "2021-03-10T00:16:24Z")

</div>

Is there a built-in function that returns the permutations of a vector that are based on the unique elements of the vector, i.e. where the “structure” of the vector is retained ? For example given y = \["a","a","a","b","…
