// output of ./demo/comb/composition-gray-rec-demo.cc: // Description: //% Generating all compositions of n into k parts in minimal-change order. arg 1: 3 == Np [Compositions of n (n>=1)] default=3 arg 2: 5 == Kp [Into k parts (k-compositions of n) (k>=1) ] default=5 arg 3: 3 == rq [Order: 0 ==> lexicographic 1 ==> ordering from (complemented) Gray code for combinations 2 ==> Eades-McKay, homogeneous moves 3 ==> enup moves, two-close, homogeneous moves 4 ==> Gray code, homogeneous moves 5 ==> Gray code, homogeneous moves] default=3 ( 7 choose 3 ) = 35 1: [ . . . 3 . ] ...111. [ 3 4 5 ] 2: [ . 1 . 2 . ] .1..11. [ 1 4 5 ] 3: [ 1 . . 2 . ] 1...11. [ 0 4 5 ] 4: [ . . 1 2 . ] ..1.11. [ 2 4 5 ] 5: [ . . 2 1 . ] ..11.1. [ 2 3 5 ] 6: [ . 1 1 1 . ] .1.1.1. [ 1 3 5 ] 7: [ 1 . 1 1 . ] 1..1.1. [ 0 3 5 ] 8: [ 2 . . 1 . ] 11...1. [ 0 1 5 ] 9: [ 1 1 . 1 . ] 1.1..1. [ 0 2 5 ] 10: [ . 2 . 1 . ] .11..1. [ 1 2 5 ] 11: [ . 3 . . . ] .111... [ 1 2 3 ] 12: [ 1 2 . . . ] 1.11... [ 0 2 3 ] 13: [ 2 1 . . . ] 11.1... [ 0 1 3 ] 14: [ 3 . . . . ] 111.... [ 0 1 2 ] 15: [ 2 . 1 . . ] 11..1.. [ 0 1 4 ] 16: [ 1 1 1 . . ] 1.1.1.. [ 0 2 4 ] 17: [ . 2 1 . . ] .11.1.. [ 1 2 4 ] 18: [ . 1 2 . . ] .1.11.. [ 1 3 4 ] 19: [ 1 . 2 . . ] 1..11.. [ 0 3 4 ] 20: [ . . 3 . . ] ..111.. [ 2 3 4 ] 21: [ . . 2 . 1 ] ..11..1 [ 2 3 6 ] 22: [ . 1 1 . 1 ] .1.1..1 [ 1 3 6 ] 23: [ 1 . 1 . 1 ] 1..1..1 [ 0 3 6 ] 24: [ 2 . . . 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