Skip to content
m·amathatlas
ExploreAboutOpen problemsCited authorsMy libraryFeedback
Sign in
FRENES
Loading views…Recent views only, across all languages. Vercel history is unavailable for this page. Repeat visits in the same tab are grouped for 30 minutes.
ShareLinkedInXFacebookWhatsApp
← All open problems
Unanswered question

Are there fast rank and unrank algorithms for integer vectors under the action of a permutation group?

Combinatorics

Imported on November 28, 2026

The forum classified this question as unanswered when collected. This does not certify an open research problem; check the answers and revision history at the source.

Read the question with its definitions and background below. The source provides the full formulation and further discussion; the glossary and Wikipedia links offer additional reading aids.

Problem statement

We are distributing mmm indistinguishable balls in kkk numbered boxes S={1,2,…,k}S=\{1,2,\ldots,k\}S={1,2,…,k}. A distribution is a tuple of nonnegative integers a=(a1,…,ak)a=(a_1,\ldots,a_k)a=(a1​,…,ak​) whose sum is mmm. We also have a permutation group GGG acting on SSS, and two distributions a,ba,ba,b are considered equivalent, if there is a permutation g∈Gg \in Gg∈G such that bi=ag(i)b_i = a_{g(i)}bi​=ag(i)​ for all i=1,…,ki=1,\ldots,ki=1,…,k. Denote the set of the equivalence classes by VVV. An equivalence class can be represented by some canonical element of it, for example the distribution that comes first in reverse lexical order.

Question: Are there known fast rank and unrank algorithms for VVV?

A rank function is a bijection r:V→{1,…,∣V∣}r : V \to \{1,\ldots,\lvert V\rvert\}r:V→{1,…,∣V∣}, and its inverse uuu is an unrank function. So the unranking u(i)u(i)u(i) gives "the iiith member", in some linear order, and the ranking tells the index of a given member.

By "fast" I mean clearly faster than iterating the distributions in a linear order until a match is found. Let's say a "fast" unranking u(i)u(i)u(i) takes time O(∣V∣α)O(\lvert V \rvert^\alpha)O(∣V∣α), where α\alphaα is a constant, 0≤α<10 \le \alpha < 10≤α<1. The naive iteration takes time Ω(∣V∣)\Omega(\lvert V \rvert)Ω(∣V∣) when accessing the last element (i=∣V∣i = \lvert V \rverti=∣V∣).

Some observations and related problems

  • The counting problem is well understood: ∣V∣\lvert V \rvert∣V∣ can be efficiently calculated using the cycle index theorem, a.k.a. Pólya counting (see e.g. this blog post)

  • The iterating problem is also well understood: there are nice algorithms for going through VVV in some linear order, see e.g. Borie (2013). This algorithm is implemented in SageMath, class IntegerVectorsModPermutationGroup.

  • For some groups GGG the ranking and unranking are well understood.

  • If GGG is trivial, then we have simply the ranking/unranking problem of nonnegative integer vectors having a fixed sum, and its solutions are well known.

  • If G=SkG=S_kG=Sk​, then the ball distributions are partitions of the integer mmm. The answers to MO question "Computing the lexicographic indices of integer partition" describe a general unranking method that seems applicable: basically, consider values for a1a_1a1​, and solve the counting problem for the remaining boxes with the remaining balls; then compare the count to your index, and either increment a1a_1a1​, or fix it and solve the remaining boxes recursively.

However, even in some relatively simple special cases, like GGG containing swaps of some boxes (and fixing some other boxes), or the boxes arranged as a necklace (cyclic permutations) or a bracelet (cyclic permutations + reflection), I could not find a known algorithm. In special cases one can of course cook up a solution, but I'm wondering if the general case is solved somewhere. I would also like to hear of any interesting special cases that have been already solved, perhaps even implemented somewhere.

As mentioned, SageMath's IntegerVectorsModPermutationGroup is good for iterating; but it has simply the "default" rank and unrank functions that iterate until match. In fact even its cardinality function works by iterating: if we have k=8k=8k=8 boxes with no symmetry (GGG is trivial), and m=20m=20m=20 balls, it takes something like 20 seconds to calculate ∣V∣=888030\lvert V \rvert = 888030∣V∣=888030. (Of course, by stars and bars, it is (20+8−120)\binom{20+8-1}{20}(2020+8−1​).)

My motivation for the question is that this is needed as a subroutine in my work with some classes of graphs (basically, I would like to find the iiith way of adding some indistinguishable vertices at some locations in the graph, where the symmetry of the graph makes some solutions equivalent).

Update (2.1.2024): While wading through literature, I found the following opinion by Kopparty, Kumar and Saks 2016 (boldface mine):

However, it seems that not all combinatorial counting arguments lead to efficient indexing algorithms. A prime example of this situation is when we have a finite group acting on a finite set, and the set we want to index is the set of orbits of the action. The associated counting problem can be solved using the Burnside counting lemma, and there seems to be no general way to use this to get an efficient indexing algorithm.

This somewhat dims my hopes of finding an existing efficient algorithm for the general case. Hence I would be interested even in solved special cases. (Kopparty et al. discuss the unranking of necklaces, which have circular symmetry.)

References

Borie, Nicolas, Generation modulo the action of a permutation group, Proceedings of the 25th international conference on formal power series and algebraic combinatorics, FPSAC 2013, Paris, France, June 24–28, 2013. Nancy: The Association. Discrete Mathematics & Theoretical Computer Science (DMTCS). Discrete Mathematics and Theoretical Computer Science. Proceedings, 767-778, electronic only (2013). ZBL1294.05183.

Kopparty, Swastik; Kumar, Mrinal; Saks, Michael, Efficient indexing of necklaces and irreducible polynomials over finite fields, Theory Comput. 12, Paper No. 7, 27 p. (2016). ZBL1373.11080.

Statement and context adapted from MathOverflow · Jukka Kohonen

CC BY-SA 4.0 · Formatting adapted; mathematical formulas preserved · Source history

A few useful definitions

Cardinal and countability
A cardinal measures the size of a set. A countably infinite set can be listed using the positive integers; an uncountable set is larger. The symbols ℵ₀, ℵ₁, … distinguish infinite sizes.
Prime number
An integer greater than 1 whose only positive divisors are 1 and itself. Examples include 2, 3, 5 and 7.
Graph
A set of vertices connected by edges. A vertex’s degree counts the incident edges; the statement specifies whether directions or multiple edges are allowed.
Group / abelian group
A set with an associative operation, an identity and an inverse for each element. It is abelian when swapping the order of two elements does not change their product.

Topics : co.combinatorics · permutations · bijective-combinatorics

Authors listed by the source : Jukka Kohonen

Sources and original status

  • MathOverflow Status in source : unanswered at collection

Last activity on the question : January 2, 2024

Coverage, sources and method

This count measures imported entries, including distinct variants. It is not a count of all open mathematical questions worldwide. One entry may belong to several fields and sources.

This directory is neither exhaustive nor updated in real time. “Reported open” describes the source classification observed at import; imported entries have not each undergone independent mathematical verification. The 32 explained entries were reviewed separately.

Formal Conjectures: only “research open” statements with no reported formal proof are retained; their tag is checked in a pinned repository revision. Variants remain distinct. A “sorry” placeholder is not sufficient to establish open status.

Erdős: solved or independent problems and entries with a Lean solution are excluded, including “open (Lean)”. Exact matches to the main Formal Conjectures statements are merged.

Open Problem Garden: the open index is checked against the solved index; spam, identified clones and some outdated statuses are excluded. Statements and definition context are attributed to their original pages; formulas are preserved and the content remains under the GFDL. Recognized duplicates across sources are merged; this does not resolve every mathematical equivalence.

OEIS: direct extraction of conjectural comments and formulas, one entry per sequence, excluding mentioned resolutions. MathOverflow and Math Stack Exchange: questions classified as unanswered by their API, excluding closed posts and non-research categories. They remain distinct from problems reported open. This is a partial, dated collection; every entry credits its authors and license.

Documented exclusions account for recent announcements and conflicting statuses. A stronger variant or a special case can remain open after a different statement is settled.

Attribution: The Formal Conjectures Authors; teorth/erdosproblems and contributors; Open Problem Garden and contributors. Each source retains its license.

  • Formal Conjectures · 1,924 · Apache-2.0 / CC-BY-4.0
  • Erdős Problems (teorth) · 622 · Apache-2.0
  • Open Problem Garden · 404 · GFDL (source content); only title/category/link metadata imported
  • OEIS · 18,857 · CC BY-SA 4.0
  • MathOverflow · 19,035 · CC BY-SA (version on each entry)
  • Mathematics Stack Exchange · 35 · CC BY-SA (version on each entry)
Report a development or correction
mathatlas

An independent atlas to understand, read, and question research.

The papers present claimed results at different stages of verification.
NewsletterShare feedbackAbout Data and privacy
Created by Sonny Mupfuni