forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
assignment5.fzn
92 lines (92 loc) · 6.41 KB
/
assignment5.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
array [1..25] of int: cost = [4, 1, 3, 5, 2, 2, 1, 3, 4, 5, 3, 2, 4, 1, 5, 2, 3, 4, 5, 1, 4, 2, 3, 1, 5];
var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00023 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00025 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00027 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00029 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00031 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00033 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00035 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00037 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00039 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00041 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00043 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00045 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00047 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00049 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00051 :: is_defined_var :: var_is_introduced;
var 0..75: INT____00001 :: is_defined_var :: var_is_introduced;
array [1..5] of var 0..5: jobs :: output_array([1..5]);
var 0..75: summax :: output_var = INT____00001;
array [1..25] of var 0..1: x :: output_array([1..5, 1..5]);
constraint int_eq_reif(jobs[1], 1, BOOL____00003);
constraint int_eq_reif(jobs[1], 2, BOOL____00005);
constraint int_eq_reif(jobs[1], 3, BOOL____00007);
constraint int_eq_reif(jobs[1], 4, BOOL____00009);
constraint int_eq_reif(jobs[1], 5, BOOL____00011);
constraint int_eq_reif(jobs[2], 1, BOOL____00013);
constraint int_eq_reif(jobs[2], 2, BOOL____00015);
constraint int_eq_reif(jobs[2], 3, BOOL____00017);
constraint int_eq_reif(jobs[2], 4, BOOL____00019);
constraint int_eq_reif(jobs[2], 5, BOOL____00021);
constraint int_eq_reif(jobs[3], 1, BOOL____00023);
constraint int_eq_reif(jobs[3], 2, BOOL____00025);
constraint int_eq_reif(jobs[3], 3, BOOL____00027);
constraint int_eq_reif(jobs[3], 4, BOOL____00029);
constraint int_eq_reif(jobs[3], 5, BOOL____00031);
constraint int_eq_reif(jobs[4], 1, BOOL____00033);
constraint int_eq_reif(jobs[4], 2, BOOL____00035);
constraint int_eq_reif(jobs[4], 3, BOOL____00037);
constraint int_eq_reif(jobs[4], 4, BOOL____00039);
constraint int_eq_reif(jobs[4], 5, BOOL____00041);
constraint int_eq_reif(jobs[5], 1, BOOL____00043);
constraint int_eq_reif(jobs[5], 2, BOOL____00045);
constraint int_eq_reif(jobs[5], 3, BOOL____00047);
constraint int_eq_reif(jobs[5], 4, BOOL____00049);
constraint int_eq_reif(jobs[5], 5, BOOL____00051);
constraint int_eq_reif(x[1], 1, BOOL____00003) :: defines_var(BOOL____00003);
constraint int_eq_reif(x[2], 1, BOOL____00005) :: defines_var(BOOL____00005);
constraint int_eq_reif(x[3], 1, BOOL____00007) :: defines_var(BOOL____00007);
constraint int_eq_reif(x[4], 1, BOOL____00009) :: defines_var(BOOL____00009);
constraint int_eq_reif(x[5], 1, BOOL____00011) :: defines_var(BOOL____00011);
constraint int_eq_reif(x[6], 1, BOOL____00013) :: defines_var(BOOL____00013);
constraint int_eq_reif(x[7], 1, BOOL____00015) :: defines_var(BOOL____00015);
constraint int_eq_reif(x[8], 1, BOOL____00017) :: defines_var(BOOL____00017);
constraint int_eq_reif(x[9], 1, BOOL____00019) :: defines_var(BOOL____00019);
constraint int_eq_reif(x[10], 1, BOOL____00021) :: defines_var(BOOL____00021);
constraint int_eq_reif(x[11], 1, BOOL____00023) :: defines_var(BOOL____00023);
constraint int_eq_reif(x[12], 1, BOOL____00025) :: defines_var(BOOL____00025);
constraint int_eq_reif(x[13], 1, BOOL____00027) :: defines_var(BOOL____00027);
constraint int_eq_reif(x[14], 1, BOOL____00029) :: defines_var(BOOL____00029);
constraint int_eq_reif(x[15], 1, BOOL____00031) :: defines_var(BOOL____00031);
constraint int_eq_reif(x[16], 1, BOOL____00033) :: defines_var(BOOL____00033);
constraint int_eq_reif(x[17], 1, BOOL____00035) :: defines_var(BOOL____00035);
constraint int_eq_reif(x[18], 1, BOOL____00037) :: defines_var(BOOL____00037);
constraint int_eq_reif(x[19], 1, BOOL____00039) :: defines_var(BOOL____00039);
constraint int_eq_reif(x[20], 1, BOOL____00041) :: defines_var(BOOL____00041);
constraint int_eq_reif(x[21], 1, BOOL____00043) :: defines_var(BOOL____00043);
constraint int_eq_reif(x[22], 1, BOOL____00045) :: defines_var(BOOL____00045);
constraint int_eq_reif(x[23], 1, BOOL____00047) :: defines_var(BOOL____00047);
constraint int_eq_reif(x[24], 1, BOOL____00049) :: defines_var(BOOL____00049);
constraint int_eq_reif(x[25], 1, BOOL____00051) :: defines_var(BOOL____00051);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[1], x[2], x[3], x[4], x[5]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[1], x[6], x[11], x[16], x[21]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[2], x[7], x[12], x[17], x[22]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[3], x[8], x[13], x[18], x[23]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[4], x[9], x[14], x[19], x[24]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[5], x[10], x[15], x[20], x[25]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[6], x[7], x[8], x[9], x[10]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[11], x[12], x[13], x[14], x[15]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[16], x[17], x[18], x[19], x[20]], 1);
constraint int_lin_eq([1, 1, 1, 1, 1], [x[21], x[22], x[23], x[24], x[25]], 1);
constraint int_lin_eq([-1, 4, 1, 3, 5, 2, 2, 1, 3, 4, 5, 3, 2, 4, 1, 5, 2, 3, 4, 5, 1, 4, 2, 3, 1, 5], [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]], 0) :: defines_var(INT____00001);
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], jobs[1], jobs[2], jobs[3], jobs[4], jobs[5]], first_fail, indomain_max, complete) minimize INT____00001;