sonet_problem.fzn 8.24 KB
Newer Older
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 93 94 95
array [1..4] of int: capacity_nodes = [3, 2, 2, 1];
array [1..25] of int: demand = [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0];
var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00004 :: 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____00008 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00012 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00022 :: 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____00026 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00027 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00028 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00029 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00030 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00031 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00032 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00033 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00034 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00035 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00036 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00037 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00038 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00039 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00040 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00042 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00043 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00044 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00045 :: is_defined_var :: var_is_introduced;
var 0..20: INT____00001 :: is_defined_var :: var_is_introduced;
array [1..20] of var 0..1: rings :: output_array([1..4, 1..5]);
var 0..20: z :: output_var = INT____00001;
constraint array_bool_or([BOOL____00005, BOOL____00004, BOOL____00003, BOOL____00002], true);
constraint array_bool_or([BOOL____00014, BOOL____00013, BOOL____00012, BOOL____00011], true);
constraint array_bool_or([BOOL____00023, BOOL____00022, BOOL____00021, BOOL____00020], true);
constraint array_bool_or([BOOL____00040, BOOL____00039, BOOL____00038, BOOL____00037], true);
constraint int_lin_eq([-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [INT____00001, rings[1], rings[2], rings[3], rings[4], rings[5], rings[6], rings[7], rings[8], rings[9], rings[10], rings[11], rings[12], rings[13], rings[14], rings[15], rings[16], rings[17], rings[18], rings[19], rings[20]], 0) :: defines_var(INT____00001);
constraint int_lin_le([1, 1, 1, 1, 1], [rings[1], rings[2], rings[3], rings[4], rings[5]], 3);
constraint int_lin_le([1, 1, 1, 1, 1], [rings[6], rings[7], rings[8], rings[9], rings[10]], 2);
constraint int_lin_le([1, 1, 1, 1, 1], [rings[11], rings[12], rings[13], rings[14], rings[15]], 2);
constraint int_lin_le([1, 1, 1, 1, 1], [rings[16], rings[17], rings[18], rings[19], rings[20]], 1);
constraint int_lin_le_reif([-1, -1], [rings[1], rings[2]], -2, BOOL____00002) :: defines_var(BOOL____00002);
constraint int_lin_le_reif([-1, -1], [rings[1], rings[3]], -2, BOOL____00007) :: defines_var(BOOL____00007);
constraint int_lin_le_reif([-1, -1], [rings[1], rings[4]], -2, BOOL____00011) :: defines_var(BOOL____00011);
constraint int_lin_le_reif([-1, -1], [rings[1], rings[5]], -2, BOOL____00016) :: defines_var(BOOL____00016);
constraint int_lin_le_reif([-1, -1], [rings[2], rings[3]], -2, BOOL____00020) :: defines_var(BOOL____00020);
constraint int_lin_le_reif([-1, -1], [rings[2], rings[4]], -2, BOOL____00025) :: defines_var(BOOL____00025);
constraint int_lin_le_reif([-1, -1], [rings[2], rings[5]], -2, BOOL____00029) :: defines_var(BOOL____00029);
constraint int_lin_le_reif([-1, -1], [rings[3], rings[4]], -2, BOOL____00033) :: defines_var(BOOL____00033);
constraint int_lin_le_reif([-1, -1], [rings[3], rings[5]], -2, BOOL____00037) :: defines_var(BOOL____00037);
constraint int_lin_le_reif([-1, -1], [rings[4], rings[5]], -2, BOOL____00042) :: defines_var(BOOL____00042);
constraint int_lin_le_reif([-1, -1], [rings[6], rings[7]], -2, BOOL____00003) :: defines_var(BOOL____00003);
constraint int_lin_le_reif([-1, -1], [rings[6], rings[8]], -2, BOOL____00008) :: defines_var(BOOL____00008);
constraint int_lin_le_reif([-1, -1], [rings[6], rings[9]], -2, BOOL____00012) :: defines_var(BOOL____00012);
constraint int_lin_le_reif([-1, -1], [rings[6], rings[10]], -2, BOOL____00017) :: defines_var(BOOL____00017);
constraint int_lin_le_reif([-1, -1], [rings[7], rings[8]], -2, BOOL____00021) :: defines_var(BOOL____00021);
constraint int_lin_le_reif([-1, -1], [rings[7], rings[9]], -2, BOOL____00026) :: defines_var(BOOL____00026);
constraint int_lin_le_reif([-1, -1], [rings[7], rings[10]], -2, BOOL____00030) :: defines_var(BOOL____00030);
constraint int_lin_le_reif([-1, -1], [rings[8], rings[9]], -2, BOOL____00034) :: defines_var(BOOL____00034);
constraint int_lin_le_reif([-1, -1], [rings[8], rings[10]], -2, BOOL____00038) :: defines_var(BOOL____00038);
constraint int_lin_le_reif([-1, -1], [rings[9], rings[10]], -2, BOOL____00043) :: defines_var(BOOL____00043);
constraint int_lin_le_reif([-1, -1], [rings[11], rings[12]], -2, BOOL____00004) :: defines_var(BOOL____00004);
constraint int_lin_le_reif([-1, -1], [rings[11], rings[13]], -2, BOOL____00009) :: defines_var(BOOL____00009);
constraint int_lin_le_reif([-1, -1], [rings[11], rings[14]], -2, BOOL____00013) :: defines_var(BOOL____00013);
constraint int_lin_le_reif([-1, -1], [rings[11], rings[15]], -2, BOOL____00018) :: defines_var(BOOL____00018);
constraint int_lin_le_reif([-1, -1], [rings[12], rings[13]], -2, BOOL____00022) :: defines_var(BOOL____00022);
constraint int_lin_le_reif([-1, -1], [rings[12], rings[14]], -2, BOOL____00027) :: defines_var(BOOL____00027);
constraint int_lin_le_reif([-1, -1], [rings[12], rings[15]], -2, BOOL____00031) :: defines_var(BOOL____00031);
constraint int_lin_le_reif([-1, -1], [rings[13], rings[14]], -2, BOOL____00035) :: defines_var(BOOL____00035);
constraint int_lin_le_reif([-1, -1], [rings[13], rings[15]], -2, BOOL____00039) :: defines_var(BOOL____00039);
constraint int_lin_le_reif([-1, -1], [rings[14], rings[15]], -2, BOOL____00044) :: defines_var(BOOL____00044);
constraint int_lin_le_reif([-1, -1], [rings[16], rings[17]], -2, BOOL____00005) :: defines_var(BOOL____00005);
constraint int_lin_le_reif([-1, -1], [rings[16], rings[18]], -2, BOOL____00010) :: defines_var(BOOL____00010);
constraint int_lin_le_reif([-1, -1], [rings[16], rings[19]], -2, BOOL____00014) :: defines_var(BOOL____00014);
constraint int_lin_le_reif([-1, -1], [rings[16], rings[20]], -2, BOOL____00019) :: defines_var(BOOL____00019);
constraint int_lin_le_reif([-1, -1], [rings[17], rings[18]], -2, BOOL____00023) :: defines_var(BOOL____00023);
constraint int_lin_le_reif([-1, -1], [rings[17], rings[19]], -2, BOOL____00028) :: defines_var(BOOL____00028);
constraint int_lin_le_reif([-1, -1], [rings[17], rings[20]], -2, BOOL____00032) :: defines_var(BOOL____00032);
constraint int_lin_le_reif([-1, -1], [rings[18], rings[19]], -2, BOOL____00036) :: defines_var(BOOL____00036);
constraint int_lin_le_reif([-1, -1], [rings[18], rings[20]], -2, BOOL____00040) :: defines_var(BOOL____00040);
constraint int_lin_le_reif([-1, -1], [rings[19], rings[20]], -2, BOOL____00045) :: defines_var(BOOL____00045);
solve minimize INT____00001;