-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise2.lst
261 lines (178 loc) · 9.27 KB
/
exercise2.lst
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 1
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
C o m p i l a t i o n
Laboratory 1 - MOS
Exercise 2
Made by:
Juan Andrés Romero C - 202013449
Juan Sebastián Alegría - 202011282
9
10 Sets e 'Employees' /e1, e2, e3, e4/
11 j 'Jobs' /j1, j2, j3, j4/;
12
13 Table t(e, j) 'Required time'
14
15 j1 j2 j3 j4
16 e1 14 5 8 7
17 e2 2 12 6 5
18 e3 7 8 3 9
19 e4 2 4 6 10;
20
21 Variables x(e,j) 'Employee/Job pair selected'
22 z 'Target function';
23
24 Binary Variable x;
25
26 Equations targetFunc 'Target Function'
27 uniqueConstraintE(e) 'Every employee can only do one job'
28 uniqueConstraintJ(j) 'Every job can be done by only one employee';
29
30 targetFunc.. z =e= sum((e,j), t(e,j)*x(e,j));
31 uniqueConstraintE(e).. sum((j), x(e,j)) =e= 1;
32 uniqueConstraintJ(j).. sum((e), x(e,j)) =e= 1;
33
34 Model Exercise2 /all/;
35 option MIP=CPLEX;
36 Solve Exercise2 using mip minimizing z;
37 Display x.l;
38 Display z.l;
COMPILATION TIME = 0.003 SECONDS 3 MB 40.1.0 93c2a77b DEX-DEG
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Equation Listing SOLVE Exercise2 Using MIP From line 36
---- targetFunc =E= Target Function
targetFunc.. - 14*x(e1,j1) - 5*x(e1,j2) - 8*x(e1,j3) - 7*x(e1,j4) - 2*x(e2,j1) - 12*x(e2,j2) - 6*x(e2,j3) - 5*x(e2,j4) - 7*x(e3,j1) - 8*x(e3,j2) - 3*x(e3,j3) - 9*x(e3,j4) - 2*x(e4,j1) - 4*x(e4,j2) - 6*x(e4,j3) - 10*x(e4,j4) + z =E= 0 ; (LHS = 0)
---- uniqueConstraintE =E= Every employee can only do one job
uniqueConstraintE(e1).. x(e1,j1) + x(e1,j2) + x(e1,j3) + x(e1,j4) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintE(e2).. x(e2,j1) + x(e2,j2) + x(e2,j3) + x(e2,j4) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintE(e3).. x(e3,j1) + x(e3,j2) + x(e3,j3) + x(e3,j4) =E= 1 ; (LHS = 0, INFES = 1 ****)
REMAINING ENTRY SKIPPED
---- uniqueConstraintJ =E= Every job can be done by only one employee
uniqueConstraintJ(j1).. x(e1,j1) + x(e2,j1) + x(e3,j1) + x(e4,j1) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintJ(j2).. x(e1,j2) + x(e2,j2) + x(e3,j2) + x(e4,j2) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintJ(j3).. x(e1,j3) + x(e2,j3) + x(e3,j3) + x(e4,j3) =E= 1 ; (LHS = 0, INFES = 1 ****)
REMAINING ENTRY SKIPPED
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 3
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Column Listing SOLVE Exercise2 Using MIP From line 36
---- x Employee/Job pair selected
x(e1,j1)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-14 targetFunc
1 uniqueConstraintE(e1)
1 uniqueConstraintJ(j1)
x(e1,j2)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-5 targetFunc
1 uniqueConstraintE(e1)
1 uniqueConstraintJ(j2)
x(e1,j3)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-8 targetFunc
1 uniqueConstraintE(e1)
1 uniqueConstraintJ(j3)
REMAINING 13 ENTRIES SKIPPED
---- z Target function
z
(.LO, .L, .UP, .M = -INF, 0, +INF, 0)
1 targetFunc
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 4
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Range Statistics SOLVE Exercise2 Using MIP From line 36
RANGE STATISTICS (ABSOLUTE NON-ZERO FINITE VALUES)
RHS [min, max] : [ 1.000E+00, 1.000E+00] - Zero values observed as well
Bound [min, max] : [ 1.000E+00, 1.000E+00] - Zero values observed as well
Matrix [min, max] : [ 1.000E+00, 1.400E+01]
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 5
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Model Statistics SOLVE Exercise2 Using MIP From line 36
MODEL STATISTICS
BLOCKS OF EQUATIONS 3 SINGLE EQUATIONS 9
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 17
NON ZERO ELEMENTS 49 DISCRETE VARIABLES 16
GENERATION TIME = 0.006 SECONDS 4 MB 40.1.0 93c2a77b DEX-DEG
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 6
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Solution Report SOLVE Exercise2 Using MIP From line 36
S O L V E S U M M A R Y
MODEL Exercise2 OBJECTIVE z
TYPE MIP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 36
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
**** OBJECTIVE VALUE 15.0000
RESOURCE USAGE, LIMIT 0.035 10000000000.000
ITERATION COUNT, LIMIT 3 2147483647
--- *** This solver runs with a community license. No commercial use.
--- GMO setup time: 0.00s
--- GMO memory 0.50 Mb (peak 0.50 Mb)
--- Dictionary memory 0.00 Mb
--- Cplex 22.1.0.0 link memory 0.00 Mb (peak 0.00 Mb)
--- Starting Cplex
--- MIP status (101): integer optimal solution.
--- Cplex Time: 0.02sec (det. 0.10 ticks)
--- Fixing integer variables and solving final LP...
--- Fixed MIP status (1): optimal.
--- Cplex Time: 0.00sec (det. 0.01 ticks)
Proven optimal solution
MIP Solution: 15.000000 (3 iterations, 0 nodes)
Final Solve: 15.000000 (0 iterations)
Best possible: 15.000000
Absolute gap: 0.000000
Relative gap: 0.000000
LOWER LEVEL UPPER MARGINAL
---- EQU targetFunc . . . 1.0000
targetFunc Target Function
---- EQU uniqueConstraintE Every employee can only do one job
LOWER LEVEL UPPER MARGINAL
e1 1.0000 1.0000 1.0000 .
e2 1.0000 1.0000 1.0000 .
e3 1.0000 1.0000 1.0000 .
e4 1.0000 1.0000 1.0000 .
---- EQU uniqueConstraintJ Every job can be done by only one employee
LOWER LEVEL UPPER MARGINAL
j1 1.0000 1.0000 1.0000 .
j2 1.0000 1.0000 1.0000 .
j3 1.0000 1.0000 1.0000 .
j4 1.0000 1.0000 1.0000 .
---- VAR x Employee/Job pair selected
LOWER LEVEL UPPER MARGINAL
e1.j1 . . 1.0000 14.0000
e1.j2 . 1.0000 1.0000 5.0000
e1.j3 . . 1.0000 8.0000
e1.j4 . . 1.0000 7.0000
e2.j1 . . 1.0000 2.0000
e2.j2 . . 1.0000 12.0000
e2.j3 . . 1.0000 6.0000
e2.j4 . 1.0000 1.0000 5.0000
e3.j1 . . 1.0000 7.0000
e3.j2 . . 1.0000 8.0000
e3.j3 . 1.0000 1.0000 3.0000
e3.j4 . . 1.0000 9.0000
e4.j1 . 1.0000 1.0000 2.0000
e4.j2 . . 1.0000 4.0000
e4.j3 . . 1.0000 6.0000
e4.j4 . . 1.0000 10.0000
LOWER LEVEL UPPER MARGINAL
---- VAR z -INF 15.0000 +INF .
z Target function
**** REPORT SUMMARY : 0 NONOPT
0 INFEASIBLE
0 UNBOUNDED
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:25 Page 7
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
E x e c u t i o n
---- 37 VARIABLE x.L Employee/Job pair selected
j1 j2 j3 j4
e1 1.000
e2 1.000
e3 1.000
e4 1.000
---- 38 VARIABLE z.L = 15.000 Target function
EXECUTION TIME = 0.065 SECONDS 4 MB 40.1.0 93c2a77b DEX-DEG
USER: GAMS Community License for Juan Alegria G220811|0002AO-GEN
Universidad de los Andes, CL3634
License for teaching and research at degree granting institutions
**** FILE SUMMARY
Input /Users/zejiran/hack/uniandes/MSO/laboratory-01/exercise2.gms
Output /Users/zejiran/hack/uniandes/MSO/laboratory-01/exercise2.lst