The application of program transformation and algebraic methods to the development of efficient combinatorial optimization (CO) algorithms relies on an exhaustive combinatorial generator for the problem specification, followed by the fusion of thinning or filtering processes into this specification. However, the effectiveness of such fusion transformations critically depends on the structural compatibility between the objective function and the generator, which is highly problem dependent. In practice, when the majority of candidate solutions remain unfiltered or are not eliminated-as is the case for most intractable CO problems-the overall efficiency of the resulting fused program is largely determined by the intrinsic efficiency of the combinatorial generator. Consequently, if the specification itself exhibits suboptimal performance, the fused program will inherit a correspondingly inferior level of efficiency. We argue that a genuine designed process should also account for hardware compatibility and parallelizability-particularly the ability to support efficient parallel execution on modern hardware architectures, including multi-level cache hierarchies and GPUs. However, does achieving formal correctness necessarily conflict with designing algebraically elegant algorithms that support fusion? Can we obtain both simultaneously? In this paper, we show that techniques from functional programming, provide powerful formal tools for the systematic construction of such hardware-compatible and parallelizable combinatorial generators. This paper investigates generators for two of the most fundamental combinatorial structures-combinations and permutations-together with their natural extension to nested generators (e.g., combinations/permutations of combinations/permutations).
翻译:程序变换和代数方法在开发高效组合优化(CO)算法中的应用,依赖于对问题规范进行穷举组合生成,再将剪枝或过滤过程融合到该规范中。然而,这种融合变换的有效性关键取决于目标函数与生成器之间的结构兼容性,而这种兼容性高度依赖于具体问题。在实践中,当大部分候选解未被过滤或消除时——正如大多数难解组合优化问题的情况——最终融合程序的整体效率主要取决于组合生成器本身的固有效率。因此,如果规范本身性能欠佳,融合程序将继承相应低效的水平。我们认为,真正的设计过程还应兼顾硬件兼容性和可并行化能力——特别是支持在现代硬件架构(包括多级缓存层次结构和GPU)上高效并行执行的能力。然而,实现形式正确性是否必然与支持融合的代数学优雅算法设计相冲突?我们能否同时实现二者?在本文中,我们证明函数式编程技术为系统化构建此类硬件兼容且可并行化的组合生成器提供了强大的形式化工具。本文研究了两种最基本组合结构——组合与排列——的生成器,并进一步将其自然扩展到嵌套生成器(例如,组合/排列的组合/排列)。