forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
assignment2_2.fzn
20 lines (20 loc) · 2.38 KB
/
assignment2_2.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
array [1..40] of int: cost = [54, 54, 51, 53, 50, 60, 70, 80, 90, 100, 51, 57, 52, 52, 40, 50, 60, 70, 80, 90, 50, 53, 54, 56, 40, 50, 60, 80, 93, 69, 56, 54, 55, 53, 60, 80, 40, 60, 50, 100];
var 0..2477: INT____00001 :: is_defined_var :: var_is_introduced;
var 0..2477: summax :: output_var = INT____00001;
array [1..40] of var 0..1: x :: output_array([1..4, 1..10]);
constraint int_lin_eq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [x[21], x[22], x[23], x[24], x[25], x[26], x[27], x[28], x[29], x[30]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [x[31], x[32], x[33], x[34], x[35], x[36], x[37], x[38], x[39], x[40]], 1);
constraint int_lin_eq([-1, 54, 54, 51, 53, 50, 60, 70, 80, 90, 100, 51, 57, 52, 52, 40, 50, 60, 70, 80, 90, 50, 53, 54, 56, 40, 50, 60, 80, 93, 69, 56, 54, 55, 53, 60, 80, 40, 60, 50, 100], [INT____00001, x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24], x[25], x[26], x[27], x[28], x[29], x[30], x[31], x[32], x[33], x[34], x[35], x[36], x[37], x[38], x[39], x[40]], 0) :: defines_var(INT____00001);
constraint int_lin_le([1, 1, 1, 1], [x[1], x[11], x[21], x[31]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[2], x[12], x[22], x[32]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[3], x[13], x[23], x[33]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[4], x[14], x[24], x[34]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[5], x[15], x[25], x[35]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[6], x[16], x[26], x[36]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[7], x[17], x[27], x[37]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[8], x[18], x[28], x[38]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[9], x[19], x[29], x[39]], 1);
constraint int_lin_le([1, 1, 1, 1], [x[10], x[20], x[30], x[40]], 1);
solve :: int_search([x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24], x[25], x[26], x[27], x[28], x[29], x[30], x[31], x[32], x[33], x[34], x[35], x[36], x[37], x[38], x[39], x[40]], first_fail, indomain_min, complete) minimize INT____00001;