Document

# Lexicographic Unranking Algorithms for the Twelvefold Way

## File

LIPIcs.AofA.2024.17.pdf
• Filesize: 0.85 MB
• 14 pages

## Acknowledgements

The authors thank the anonymous referees for their comments and suggested improvements. All these remarks have increased the quality of the paper.

## Cite As

Amaury Curiel and Antoine Genitrini. Lexicographic Unranking Algorithms for the Twelvefold Way. In 35th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (AofA 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 302, pp. 17:1-17:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.AofA.2024.17

## Abstract

The Twelvefold Way represents Rota’s classification, addressing the most fundamental enumeration problems and their associated combinatorial counting formulas. These distinct problems are connected to enumerating functions defined from a set of elements denoted by 𝒩 into another one 𝒦. The counting solutions for the twelve problems are well known. We are interested in unranking algorithms. Such an algorithm is based on an underlying total order on the set of structures we aim at constructing. By taking the rank of an object, i.e. its number according to the total order, the algorithm outputs the structure itself after having built it. One famous total order is the lexicographic order: it is probably the one that is the most used by people when one wants to order things. While the counting solutions for Rota’s classification have been known for years it is interesting to note that three among the problems have yet no lexicographic unranking algorithm. In this paper we aim at providing algorithms for the last three cases that remain without such algorithms. After presenting in detail the solution for set partitions associated with the famous Stirling numbers of the second kind, we explicitly explain how to adapt the algorithm for the two remaining cases. Additionally, we propose a detailed and fine-grained complexity analysis based on the number of bitwise arithmetic operations.

## Subject Classification

##### ACM Subject Classification
• Mathematics of computing → Combinatorial algorithms
• Theory of computation → Generating random combinatorial structures
##### Keywords
• Twelvefold Way
• Set partitions
• Unranking
• Lexicographic order

## Metrics

• Access Statistics
• Total Accesses (updated on a weekly basis)
0

## References

1. N. Ali, A. Shamoon, N. Yadav, and T. Sharma. Peptide Combination Generator: a Tool for Generating Peptide Combinations. ACS Omega, 5(11):5781-5783, 2020. URL: https://doi.org/10.1021/acsomega.9b03848.
2. O. Bodini, A. Genitrini, C. Mailler, and M. Naima. Strict monotonic trees arising from evolutionary processes: Combinatorial and probabilistic study. Advances in Applied Math., 133:102284, 2022. URL: https://doi.org/10.1016/J.AAM.2021.102284.
3. Amaury Curiel and Antoine Genitrini. Set Partition Unranking. Software, swhId: https://archive.softwareheritage.org/swh:1:dir:b01a69e78b0fd972fdafc0c080421688cd9c9be6;origin=https://github.com/AMAURYCU/setpartition_unrank;visit=swh:1:snp:f9a49d6aee1aa584fc947cfbe7d63150624f674b;anchor=swh:1:rev:6fe83b16cb6c88237b5345b8090cbe63d700463e (visited on 2024-07-09). URL: https://github.com/AMAURYCU/setpartition_unrank.
4. C. Defant. Highly sorted permutations and Bell numbers. Enumerative Combinatoricas and Applications, 1(1), 2021. URL: https://doi.org/10.48550/arXiv.2012.03869.
5. A. Dzhumadil'daev and D. Yeliussizov. Walks, partitions, and normal ordering. Electronic Journal of Combinatorics, 22(4):4, 2015. URL: https://doi.org/10.37236/5181.
6. P. Flajolet, P. Zimmermann, and B. Van Cutsem. A calculus for the random generation of labelled combinatorial structures. Theoretical Computer Science, 132(1-2):1-35, 1994. URL: https://doi.org/10.1016/0304-3975(94)90226-7.
7. A. Genitrini and M. Pépin. Lexicographic Unranking of Combinations Revisited. Algorithms, 14(3), 2021. URL: https://doi.org/10.3390/A14030097.
8. R. L. Graham, D. E. Knuth, and O. Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, Reading, MA, second edition, 1989. URL: https://www-cs-faculty.stanford.edu/%7Eknuth/gkp.html.
9. I. Grebennik and O. Lytvynenko. Developing software for solving some combinatorial generation and optimization problems. In 7th Int. Conf. on Application of Information and Communication Technology and Statistics in Economy and Education, pages 135-143, 2017. URL: http://openarchive.nure.ua/handle/document/5498.
10. A. Hertz and H. Mélot. Counting the number of non-equivalent vertex colorings of a graph. Discrete Applied Mathematics, 203:62-71, 2016. URL: https://doi.org/10.1016/J.DAM.2015.09.015.
11. D. E. Knuth. The Art of Computer Programming, Volume 4A, Combinatorial Algorithms. Addison-Wesley Professional, 2011. URL: https://www-cs-faculty.stanford.edu/~knuth/taocp.html.
12. D. L. Kreher and D. R. Stinson. Combinatorial Algorithms: generation, enumeration, and search. CRC Press, 1999. URL: https://doi.org/10.1145/309739.309744.
13. G. Louchard. Asymptotics of the Stirling numbers of the second kind revisited. Applicable Analysis and Discrete Mathematics, 7(2):193-210, 2013. URL: https://doi.org/10.46298/dmtcs.501.
14. Q. Lutz, E. de Panafieu, M. Stein, and A. Scott. Active clustering for labeling training data. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, pages 8469-8480, 2021. URL: https://proceedings.neurips.cc/paper/2021/hash/47841cc9e552bd5c40164db7073b817b-Abstract.html.
15. T. Mansour. Combinatorics of Set Partitions. Discrete Mathematics and Its Applications. Taylor & Francis, 2012. URL: https://doi.org/10.1201/b12691.
16. C. Martínez and X. Molinero. A generic approach for the unranking of labeled combinatorial classes. Random Structures & Algorithms, 19(3-4):472-497, 2001. URL: https://doi.org/10.1002/RSA.10025.
17. A. F. Myers. k-out-of-n:G System Reliability With Imperfect Fault Coverage. IEEE Transactions on Reliability, 56(3):464-473, 2007. URL: https://doi.org/10.1109/TR.2007.903229.
18. A. Nijenhuis and H. S. Wilf. Combinatorial algorithms. Computer science and applied mathematics. Academic Press, New York, NY, 1975. URL: https://www2.math.upenn.edu/~wilf/website/CombAlgDownld.html.
19. B.C. Rennie and A.J. Dobson. On stirling numbers of the second kind. Journal of Combinatorial Theory, 7(2):116-121, 1969. URL: https://doi.org/10.1016/S0021-9800(69)80045-1.
20. F. Ruskey. Combinatorial Generation, 2003.
21. Y. Shablya, D. Kruchinin, and V. Kruchinin. Method for Developing Combinatorial Generation Algorithms Based on AND/OR Trees and Its Application. Mathematics, 8(6):962, 2020. URL: https://doi.org/10.3390/math8060962.
22. S. Skiena. The Algorithm Design Manual, Third Edition. Texts in Computer Science. Springer, 2020.
23. R. P. Stanley. Enumerative Combinatorics: Volume 1. Cambridge Univ. Press, 2011. URL: https://doi.org/10.1017/CBO9781139058520.
24. Y. Tamada, S. Imoto, and S. Miyano. Parallel Algorithm for Learning Optimal Bayesian Network Structure. J. Mach. Learn. Res., 12:2437-2459, 2011. URL: https://doi.org/10.5555/1953048.2021080.
X

Feedback for Dagstuhl Publishing

### Thanks for your feedback!

Feedback submitted

### Could not send message

Please try again later or send an E-mail