# Production Optimization in a Grain Facility through Mixed-Integer Linear Programming +
## 3 The Grain Facility Optimization Problem  
The problem concerns a real-life grain processing facility, which must treat seeds using different types of resources, including workers, machinery, storage silos with a given capacity, etc. The main goal for the company that operates the facility is to meet pre-planned delivery demands for each harvest. In the grain facility, several varieties of seeds are processed and delivered. A specific feature of the problem is that some products, i.e., _inoculated products_, have a limited shelf life: they expire a certain number of days after being processed. This issue imposes a restriction concerning the production dates and the withdrawal dates. Once the products are processed, they are stored in silos, waiting for clients to withdraw their orders. Orders are based on a planned list of withdrawals that were previously communicated to the company in the planning phase. The sales department establishes a calendar of product withdrawals and the planned production must respect several constraints. One the one hand, there must be enough stock of each product available at the time of each withdrawal. On the other hand, the processes required by the seeds are performed by employing a limited number of production lines. The total throughput (tons/h) is also limited, which imposes a limit on the restocking rate. In addition, the total storage capacity is limited, which makes it mandatory to alternate batch production and withdrawals. Some products have a limited shelf life, which imposes a limit on the time window between their production and withdrawal. The production lines must be supervised by operators while they are operational. Machines generally produce at full capacity and operator shifts are established and assigned to each line. The number of shifts is set for each week and it does not change within the same week. Every time a line finishes the production of a certain product, it must be stopped and cleaned before continuing with the processing of a different product. If the line stops after a certain demand has been satisfied and then returns to producing the same product, cleaning is not necessary. The production process covers several weeks per year. A set of demanded products must be produced and withdrawn each week, according to the specific constraints determined by the throughput, stocking/restocking availability, storage capacity, production lines, shelf life and worker shifts. Taking into account the presented realistic production situation, the model is defined to minimize production costs. Among other relevant factors, the cost function must consider the number of production hours, the number of operator shifts, and the number of cleanings performed on each machine. Furthermore, in order to be applicable in a real commercial environment, the problem model must guarantee that the production is sufficient for the withdrawals to be fulfilled, that the expiration periods of those products that expire are respected, and that the production that is not delivered immediately does not exceed the available storage capacities. Since inoculated products must be delivered in a limited period of time, it is important to keep track of their processing dates. The proposed problem model defines specific variables to distinguish batches of such products belonging to different dates, as described in the next subsection. The mathematical formulation of the studied grain facility optimization problem considers the following elements:  
* Sets: 1. Set \(V_{I}\) denotes products that expire. 2. Set \(V_{T}\) denotes products that do not expire. 3. Set \(V\) denotes all products, i.e., \(V=V_{I}\cup V_{T}\). 4. Set \(L\) denotes the available production lines. * Parameters: 1. Parameter \(S_{f}\) denotes the number of weeks considered for production scheduling (the _scheduling horizon_). 2. Parameter \(M\) denotes the maximum number of withdrawals for each product. 3. Parameter \(C\) denotes the total storage capacity of the company (measured in tons). 4.