We present CombOL (Combinatorial Objects Library), an open-source library for the enumeration and Boltzmann sampling of combinatorial classes. Classes can be specified by a concise string syntax, and may depend on an arbitrary number of parameters. CombOL automatically derives the associated generating functions, enabling the generation of counting sequences and the compilation of Boltzmann samplers. The library supports exact and approximate-size Boltzmann rejection sampling with automatic parameter tuning to target specific sizes. In addition to implementing established methods, CombOL contributes a novel early-rejection scheme, as well as guaranteed statistical correctness by dynamically increasing the numerical precision, eliminating bias due to floating-point rounding errors. Through the Python interface, sampled structures can be mapped to application-specific objects, enabling direct sampling of domain objects such as graphs, chemical structure representations, or other complex data types. CombOL is available from PyPI as 'combol' (pypi.org/project/combol). The source code is available at gitlab.com/casbjorn/combol.
翻译:我们提出了CombOL(组合对象库),这是一个用于组合类枚举与玻尔兹曼采样的开源库。组合类可通过简洁的字符串语法进行指定,并可依赖任意数量的参数。CombOL自动推导关联生成函数,从而支持计数序列的生成与玻尔兹曼采样器的编译。该库实现了精确规模与近似规模的玻尔兹曼拒绝采样,并可通过自动参数调优来定位特定规模。除实现已有方法外,CombOL贡献了一种新颖的提前拒绝机制,并通过动态提升数值精度来保证统计正确性,从而消除浮点舍入误差带来的偏差。通过Python接口,采样所得结构可映射到应用特定对象,从而实现对领域对象(如图、化学结构表示或其他复杂数据类型)的直接采样。CombOL可通过PyPI以'combol'名称获取(pypi.org/project/combol),源代码托管于gitlab.com/casbjorn/combol。