Optimal Random Bit Complexity in Efficient Sampling of Set Partition-Like Structures
摘要
In this paper (This paper is eligible for the best student paper award), we present an algorithm designed to generate set partitions efficiently while adhering to the Shannon entropy principle, achieving an optimal time complexity of \(O(n\log (n))\) . Building on the framework of Stam (1983), for which we propose a combinatorial interpretation, we improve its efficiency by integrating the method developed by Devroye (1987) for generating an appropriate random variable. A significant portion of our algorithm’s execution time—up to 80%—is dedicated to random generation, highlighting the importance of considering random bit consumption. Our method extends to other combinatorial structures, such as weak orderings and linearly ordered set partitions. We implemented the algorithm in Python and conducted experiments to evaluate its practical efficiency, confirming its scalability even for large input sizes.