Combinatorial Generation by Fusing Loopless Algorithms
Some combinatorial generation problems can be broken down into subproblems for which loopless algorithms already exist. We discuss means by which existing loopless algorithms for subproblems can be combined or fused to produce a new loopless algorithm that solves the original problem. We demonstrate this method with two new loopless algo- rithms, MULTPERM and MIXPAR. MULTPERM generates multiset permutations using only arrays and requiring only linear space; it is simpler and more efficient in both time and space than the recent algorithm of Korsh and LaFollette. MIXPAR generates well-formed parenthesis strings containing two different types of parentheses.