Skip to content

Instantly share code, notes, and snippets.

@PolynomialDivision
Created May 4, 2018 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PolynomialDivision/f79e5b20bd2a31aeb92f701fdaea8c6b to your computer and use it in GitHub Desktop.
Save PolynomialDivision/f79e5b20bd2a31aeb92f701fdaea8c6b to your computer and use it in GitHub Desktop.
var x1, binary;
var x2, binary;
var x3, binary;
var x4, binary;
minimize obj: 170 * x1 + 200 * x2 + 50 * x3 + 150 * x4;
s.t. c1: 8 * x1 + 30 - 30 * x1 + 3 * x2 + 10 - 10 * x2 + 7 * x4 + 15 - 15 * x4 <= 50;
s.t. c2: 8 * x1 + 30 - 30 * x1 + 15 * x3 + 25 - 25 * x3 + 7 * x4 + 15 - 15 * x4 <= 50;
s.t. c3: -1000 * x2 - 1000 * x3 + 8 * x1 + 30 - 30 * x1 + 3 * x2 + 10 - 10 * x2 + 15 * x3 + 25 - 25 * x3 + 7 * x4 + 15 - 15 * x4 <= 50;
solve;
display x1, x2, x3, x4;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment