// output of ./demo/comb/mset-perm-pref-demo.cc: // Description: //% Multiset permutations via prefix shifts ("cool-lex" order). //% See //% Aaron Williams: Loopless Generation of Multiset Permutations using //% a Constant Number of Variables by Prefix Shifts, //% ACM-SIAM Symposium on Discrete Algorithms (SODA09), (2009). args: multiplicities of elements multiplicities: ( 2, 2, 1 ) k=3 n=5 1: [ . 2 1 1 . ] 5 2: [ 2 . 1 1 . ] 2 3: [ 1 2 . 1 . ] 3 4: [ . 1 2 1 . ] 3 5: [ 1 . 2 1 . ] 2 6: [ 2 1 . 1 . ] 3 7: [ . 2 1 . 1 ] 5 8: [ 2 . 1 . 1 ] 2 9: [ . 2 . 1 1 ] 4 10: [ . . 2 1 1 ] 3 11: [ 2 . . 1 1 ] 3 12: [ 1 2 . . 1 ] 4 13: [ . 1 2 . 1 ] 3 14: [ 1 . 2 . 1 ] 2 15: [ . 1 . 2 1 ] 4 16: [ . . 1 2 1 ] 3 17: [ 1 . . 2 1 ] 3 18: [ 2 1 . . 1 ] 4 19: [ 1 2 1 . . ] 5 20: [ 1 1 2 . . ] 3 21: [ . 1 1 2 . ] 4 22: [ 1 . 1 2 . ] 2 23: [ 1 1 . 2 . ] 3 24: [ . 1 1 . 2 ] 5 25: [ 1 . 1 . 2 ] 2 26: [ . 1 . 1 2 ] 4 27: [ . . 1 1 2 ] 3 28: [ 1 . . 1 2 ] 3 29: [ 1 1 . . 2 ] 4 30: [ 2 1 1 . . ] 5 ct=30