# Production Optimization in a Grain Facility through Mixed-Integer Linear Programming +
## 6 Experimental Evaluation
### Heuristic Algorithm Currently Used by the Firm  
In this subsection, the heuristic algorithm carried on by the planning engineers to craft the production plan is presented. The resulting plan for 2020 is then compared with the output yielded by the optimization algorithm here proposed.  
The engineers work on an Excel workbook where they input the number of shifts per week and production line and the amount of each product to be produced in every combination of week, line, and product. Several cells are computed that show the capacity usage, overflows and eventual stock breaks, so that they can play until an acceptable plan is devised. The ad hoc steps so far followed by the engineers are as follows:  
1. All cells that account for the number of shifts are set equal to 3.
2. All cells that account for the amount of tons of every product and line are zeroed, and this is done for every week.
3. Next, the demand of every combination of product and week \(p\) and \(w\) are copied into the cells that account for the amounts to produce. They are not split between lines, they are put in the line with the highest productivity.
4. As a result of the above, the computed cells of the worksheet will show that the plan exceeds both production capacity and space in several weeks and lines. This is solved by the next iterations.
5. Go to any week with production capacity overflow. Choose any product that is programmed that week and take it to another line, completely or partially trying to not lead to overflow the latter. Perform this step with other weeks until no further such movements solve any remaining overflow problem.
6. Look at any week \(w\) and a \"treated\" product \(p\) with exceeded capacity (regarding space or productivity). Take the amount produced to previous weeks, in order to lower down the excess. Perform this step for other combinations of \(p\) and \(w\) trying to eliminate as many overflows as possible.
7. Perform the previous step, now considering the \"inoculated\" instead of treated products. Be careful not to move the production more than the allowed shelf life of the product, since this step deals with the inoculated products.
8. Take every cell that accounts for shift numbers to its minimum possible integer value (3, 2, 1 or 0), taking care not to introduce new production capacity overflows.  
Once the previous steps are performed, the engineers go through the worksheet, looking for further swaps or splittings that might help to improve the production plan while respecting all problem constraints. The planning engineer spent 20 h performing the ad hoc procedure here described (4 to create the worksheet and the remaining to iterate through all steps). The solution finally found had 319 shifts and implied 34 cleaning procedures.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c c c c c c} \hline \hline  & & & & & & & & & & & & & & & & & & \\ \hline _Week_ & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** & **11** & **12** & **13** & **14** & **15** & **16** & **17** \\ \hline
8 & & & & & & & & & & & & & & & & & & & \\
9 & & & & 80 & 140 & 100 & & & & & & & & & & & & & \\
10 & & & 40 & 120 & 400 & 100 & & & 80 & 120 & 600 & 140 & 60 & 24 & 200 & \\
11 & & & 160 & 200 & 120 & 600 & & & & 80 & 120 & 400 & 40 & 140 & 24 & 60 & & 40 \\
12 & & & 240 & 400 & 120 & 360 & & 120 & 200 & 120 & 40 & & & & 200 & 60 & 80 & 120 \\
13 & & 36 & 240 & 440 & & & 300 & & 120 & 200 & 40 & & & & & 140 & 60 & 60 & 80 \\
14 & & 60 & 160 & 440 & & & & & & & & & & & & & & & \\
15 & & 80 & 160 & 280 & & & & & 400 & & & & & & & & & & & \\
16 & & 40 & 80 & 120 & & & & & & & & & & & & & & & \\
17 & & 100 & 40 & 80 & & & & & & & & & & & & & & & \\
18 & & 40 & & & & & & & & & & & & & & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 2: Description of the real-world problem instance solved: demand (\(d_{v}^{\rm s}\), in tons) for 17 products (\(v\)) in each week (\(s\)).