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).
翻译:程序变换与代数方法在开发高效组合优化算法中的应用,依赖于对问题规约的穷举式组合生成器,随后将剪枝或过滤过程融合至该规约中。然而,此类融合变换的有效性关键取决于目标函数与生成器之间的结构兼容性,这高度依赖于具体问题。实践中,当大多数候选解未被过滤或无法被剔除时——正如大多数难解的组合优化问题所呈现的情况——最终融合程序的整体效率在很大程度上由组合生成器本身的固有效率决定。因此,若规约本身性能欠佳,融合程序将继承相应低效性。我们认为,真正经过设计的流程还应考虑硬件兼容性与可并行化能力——特别是支持在现代硬件架构(包括多级缓存层级和GPU)上高效并行执行的能力。然而,实现形式正确性是否必然与设计支持融合的代数优雅算法相冲突?我们能否同时兼顾二者?本文表明,函数式编程技术为系统性构建此类硬件兼容且可并行化的组合生成器提供了强大的形式化工具。本文研究两种最基础组合结构——组合与排列——的生成器,及其自然扩展至嵌套生成器(例如组合/排列的组合/排列)的应用。