Reptorian's Combinatorics Library
Description
A library for permutation and combinatorial enumeration.The library provides commands for generation, ranking (list2index),
and unranking (index2list) of many combinatorial structures.
Supported structures include permutations, combinations,
cartesian product, sum-constrained permutations,
incremental combination, and repeated distinct element (RDE)
variants of many of these structures.
RDE structures represent multisets where each element type
has a fixed number of occurrences.
The library is designed to enable deterministic traversal
and indexing of large combinatorial spaces inside G'MIC pipeline.
Enumeration Order and Indexing
All combinatorial structures in this library are:Enumerated in lexicographic order (left-to-right comparison of elements)
Zero-based indexed (indices start at 0)
Terminology
PermutationsOrdered arrangements of elements where position matters.
Combinations
Selections of elements where order does not matter.
Cartesian Product
The set of all ordered items formed by combining elements
from multiple sets.
Sum-constrained Combinatorics
Combinatorics tools for non-negative integers where the values
are restricted by a maximum sum constraint.
Incremental Combinations
Combinations represented as non-decreasing integer sequences.
Repeated Distinct Elements (RDE)
Combinatorial structures formed from multisets where each
element type has a fixed number of allowed occurrences.
Commands
Permutations:
Combinations:
| rep_ncr_combinations | rep_ncr_combination_index2list | rep_ncr_combination_list2index |
| rep_r_combinations | rep_r_combination_index2list | rep_r_combination_list2index |
Cartesian Product:
| rep_cartesian_product | rep_cartesian_product_index2list | rep_cartesian_product_list2index |
Sum-Constrained Combinatorics:
Repeated Distinct Elements (RDE):
Incremental Combinations:
| rep_inc_combinations | rep_inc_combination_index2list | rep_inc_combination_list2index |


Home
Download
News
Mastodon
Bluesky
X
Summary - 18 Years
Summary - 17 Years
Summary - 16 Years
Summary - 15 Years
Summary - 13 Years
Summary - 11 Years
Summary - 10 Years
Resources
Technical Reference
Scripting Tutorial
Video Tutorials
Wiki Pages
Image Gallery
Color Presets
Using libgmic
G'MIC Online
Community
Discussion Forum (Pixls.us)
GimpChat
IRC
Report Issue