this repo has no description
at develop 966 B view raw
1/*** 2!Test 3solvers: [chuffed] # Too slow on cbc 4options: 5 all_solutions: true 6expected: !Result 7 status: ALL_SOLUTIONS 8 solution: 9 - !Solution 10 sets: 11 - !Range 1..3 12 - !!set {1, 2, 4} 13 - !!set {1, 2, 5} 14 - !!set {1, 2, 6} 15 - !!set {1, 3, 4} 16 - !!set {1, 3, 5} 17 - !!set {1, 3, 6} 18 - !!set {1, 4, 5} 19 - !!set {1, 4, 6} 20 - !!set {1, 5, 6} 21 - !Range 2..4 22 - !!set {2, 3, 5} 23 - !!set {2, 3, 6} 24 - !!set {2, 4, 5} 25 - !!set {2, 4, 6} 26 - !!set {2, 5, 6} 27 - !Range 3..5 28 - !!set {3, 4, 6} 29 - !!set {3, 5, 6} 30 - !Range 4..6 31***/ 32 33% Lexicographic order of 3-subsets of 1..6 34 35set of int: elems = 1..6; 36int: n = 3; 37int: m = (product (i in card(elems)-n+1..card(elems)) (i)) div (product (i in 1..n) (i)); % choose n from elems 38 39array [1..m] of var set of elems: sets; 40 41constraint forall (i in 1..m) (card(sets[i]) = n); 42constraint forall (i in 1..m-1) (sets[i] < sets[i+1]); 43 44solve satisfy; 45 46output [show(sets)];