forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
assignment3.fzn
16 lines (16 loc) · 1.11 KB
/
assignment3.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
array [1..16] of int: cost = [7, 5, 8, 2, 7, 8, 8, 4, 3, 5, 7, 9, 5, 5, 6, 7];
array [1..4] of int: female = [1, 2, 3, 4];
array [1..4] of int: male = [1, 2, 3, 4];
var 0..96: INT____00001 :: is_defined_var :: var_is_introduced;
var 0..96: total_cost :: output_var = INT____00001;
array [1..16] of var 0..1: x :: output_array([1..4, 1..4]);
constraint int_lin_eq([1, 1, 1, 1], [x[1], x[2], x[3], x[4]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[1], x[5], x[9], x[13]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[2], x[6], x[10], x[14]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[3], x[7], x[11], x[15]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[4], x[8], x[12], x[16]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[5], x[6], x[7], x[8]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[9], x[10], x[11], x[12]], 1);
constraint int_lin_eq([1, 1, 1, 1], [x[13], x[14], x[15], x[16]], 1);
constraint int_lin_eq([-1, 7, 5, 8, 2, 7, 8, 8, 4, 3, 5, 7, 9, 5, 5, 6, 7], [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]], 0) :: defines_var(INT____00001);
solve maximize INT____00001;