int: nMachines; int: nOuvriers; set of int: MACHINES = 1..nMachines; set of int: OUVRIERS = 1..nOuvriers; array[OUVRIERS,MACHINES] of int : productivite; var int: total; array[OUVRIERS,MACHINES] of var bool: x; % Constraints constraint forall(o in OUVRIERS)(sum(m in MACHINES)(x[o,m]) == 1); constraint forall(m in MACHINES)(sum(o in OUVRIERS)(x[o,m]) == 1); % First Situation %constraint total = sum(o in OUVRIERS, m in MACHINES)(x[o,m] * productivite[o,m]); % Second Situation constraint forall(o in OUVRIERS)(total <= sum(m in MACHINES)(productivite[o,m] * x[o,m])); solve maximize total;