% Define the variables
var int: x;
var int: y;
% Define the domain for the variables
constraint 1 <= x;
constraint x <= 5;
constraint 1 <= y;
constraint y <= 5;
% Constraint that links the variables
constraint x + y >= 5;
% Objective function: minimize the sum of x and y.
% The minimum possible sum is 1 + 1 = 2.
% However, the constraint x+y >= 5 forces the minimum sum to be 5.
% Multiple pairs (x, y) satisfy x+y = 5 (e.g., (1, 4), (2, 3), (3, 2), (4, 1)).
% Output the solution
output ["x = ", show(x), "; y = ", show(y), "; Sum = ", show(x + y), "\n"];
solve satisfy;
There are several ways this can be 5 which is the minimum:
1+4, 3+2, 2+3 etc.
If I change it to:
solve minimize x+y;
No matter the solver I try to use, it just refuses to ungrey that toggle.
MiniZinc IDE 2.9.4 on Windows
20730142