// output of ./demo/comb/ksubset-twoclose-demo.cc: // Description: //% k-subsets (kmin<=k<=kmax) in two-close order. //% Recursive algorithm. arg 1: 5 == n [Subsets of n-element set.] default=5 arg 2: 2 == kmin [Minimal number of elements in subsets.] default=2 arg 3: 4 == kmax [Maximal number of elements in subsets.] default=4 1: .1111 ..... { 1, 2, 3, 4 } 2: ..111 .M... { 2, 3, 4 } 3: 1.111 P.... { 0, 2, 3, 4 } 4: 11.11 .PM.. { 0, 1, 3, 4 } 5: .1.11 M.... { 1, 3, 4 } 6: ...11 .M... { 3, 4 } 7: 1..11 P.... { 0, 3, 4 } 8: 11..1 .P.M. { 0, 1, 4 } 9: .1..1 M.... { 1, 4 } 10: 1...1 PM... { 0, 4 } 11: ..1.1 M.P.. { 2, 4 } 12: 1.1.1 P.... { 0, 2, 4 } 13: .11.1 MP... { 1, 2, 4 } 14: 111.1 P.... { 0, 1, 2, 4 } 15: 1111. ...PM { 0, 1, 2, 3 } 16: .111. M.... { 1, 2, 3 } 17: ..11. .M... { 2, 3 } 18: 1.11. P.... { 0, 2, 3 } 19: 11.1. .PM.. { 0, 1, 3 } 20: .1.1. M.... { 1, 3 } 21: 1..1. PM... { 0, 3 } 22: 11... .P.M. { 0, 1 } 23: 1.1.. .MP.. { 0, 2 } 24: .11.. MP... { 1, 2 } 25: 111.. P.... { 0, 1, 2 } ct=25