machine_capacity [*,*] (tr) : Borer Grinder Horizontal_drill Planer Vertical_drill := 1 0 8.57143 0 0 0 2 0 0 0.625 0 0 3 200 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 6 0 0 0 800 0with slacks
machine_capacity.slack [*,*] (tr) : Borer Grinder Horizontal_drill Planer Vertical_drill := 1 231.343 -1.13687e-13 746 340.175 330.286 2 261 431 5.68434e-14 345.325 398 3 0 1456 1152 384 528 4 302 1116 1020 368.6 154 5 256 642 612 318 154 6 315.5 766 658 0 168Thus, if the grinder is not available in January, the cost is $8.57; there is no cost in any other month.
The planer is only used to capacity in June, when it is being serviced. Thus, there is no cost to the planer being unavailable.
Now consider the case when the borer can be rented for $60 per hour. Since the shadow price is larger than the rental price, there is a benefit to renting the borer for at least part of the month. If we rent the borer for the whole month, it is only used for 91 hours (out of 384). The total benefit is then $100476.4286, but the cost of the rental is $23040, so the net profit is $77436.43, which is less than if the borer is not rented. The shadow price changes down to $110 when the borer is used for about 5% of the month, and it drops from there. It is worthwhile renting the borer for 91 hours: The objective improves by $9641.25 to $100476.43, while the rental cost is $5460. The shadow price of the borer drops as we rent it for more hours. We want to find the number of hours where the shadow price drops to below $60 per hour: we should rent the borer for this number of hours. The easiest way to find this number is to add the term
-60*machine_use["Borer",3];to the objective function, add a constraint
subject to use_machine {j in MACHINES, t in 1..T}:in order to define the variable machine_use to be the number of hours a machine is used in a month, and alter factory.dat so as to not schedule the machine for repair. This will use the borer if the shadow price is larger than $60, but not if it is smaller. The optimal solution ismachine_use[j,t] = sum{i in PRODUCTS} time_used[i,j] * produce[i,t];
ampl data: solve; MINOS 5.4: optimal solution found. 74 iterations, objective 96335.17857 ampl: display machine_use; machine_use [*,*] (tr) : Borer Grinder Horizontal_drill Planer Vertical_drill := 1 152.657 1152 406 43.825 437.714 2 123 1105 384 38.675 370 3 65 650 40 20 360 4 82 420 132 15.4 230 5 128 510 540 66 230 6 68.5 770 110 0 600 ;Thus, the optimal solution is to rent a borer for 65 hours in March. The shadow price of the borer drops from $110 to $16.67 when it is rented for 65 hours.
sell.rc [*,*] : 1 2 3 4 5 6 := A 5.71429 9.875 0 10 10.5 10 B 0 6 8.88178e-16 6 6 6 C 8 7.5 8.5 8 8 0 D 4 4 3.5 4 4 4 E 8.42857 11 0 11 11 0 F 7.28571 9 9 9 9 9 G 0 2.625 -4.44089e-16 3 3 4.44089e-16We sell as much of C as the market will take in January, February, April, and May. So the values of sell.rc for these entries show how much the price can decrease without changing the optimal solution. Thus, we can decrease the price of C by up to $7.50 without the optimal solution changing.
produce.rc [*,*] : 1 2 3 4 5 6 := A 0 2.77556e-17 0 0 0 0 B -8.88178e-16 0 0 0 0 0 C 0 0 0 0 0 0 D 0 -1 -14.5 0 0 0 E -4.44089e-16 0 -9 0 0 -29 F -2.22045e-16 0 0 0 0 0 G -1.28571 0 -15.125 0 0 -37Thus, we need to increase the price of G by at least $1.28571 before we'll even produce this product. This variable is basic with value zero in the optimal solution. This is the answer, as can be verified by modifying the data.
If you use CPLEX to solve the LP instead of MINOS, you may well obtain a reduced cost of $1.28571 for SELL.RC for product G in January, which immediately gives the required solution.