Path: blob/main/notebooks/02/09-production-facility-worst-case.ipynb
940 views
Extra material: Multi-product facility production
Preamble: Install Pyomo and a solver
The following cell sets and verifies a global SOLVER for the notebook. If run on Google Colab, the cell installs Pyomo and the HiGHS solver, while, if run elsewhere, it assumes Pyomo and HiGHS have been previously installed. It then sets to use HiGHS as solver via the appsi module and a test is performed to verify that it is available. The solver interface is stored in a global object SOLVER for later use.
Maximizing the profit in the worst case for a multi-product facility
A common formulation for the problem of maximizing profit of a multi-product facility in a resource constrained environment is given by the following linear optimization problem:
where is the production of product , is the net profit from producing and selling one unit of product , is the amount of resource required to product a unit of product , and is amount of resource available. If this data is available, then the linear programming solution can provide a considerable of information regarding an optimal production plan and the marginal value of additional resources.
But what if coefficients of the model are uncertain? What should be the objective then? Does uncertainty change the production plan? Does the uncertainty change the marginal value assigned to resources? These are complex and thorny questions that will be largely reserved for later chapters of this book. However, it is possible to consider a specific situation within the current context.
Consider a situation where there are multiple plausible models for the net profit. These might be a result of marketing studies or from considering plant operation under multiple scenarios, which we collect in a set . The set of profit models could be written
where indexes the set of possible scenarios. The scenarios are all deemed equal, no probabilistic interpretation is given.
One conservative criterion is to find maximize profit for the worst case. Letting denote the profit for the worst case, this criterion requires finding a solution for for that satisfies
where is lowest profit that would be encountered under any condition.
Data
We import the same data as in the previous notebook regarding the BIM production with different possible profit scenarios.
Pyomo Model
An implementation of the maximum worst-case profit model.
Optimizing for the mean scenario
Is maximizing the worst case a good idea? Maximizing the worst case among all cases is a conservative planning outlook. It may be worth investigating alternative planning outlooks.
The first step is to create a model to optimize a single scenario. Without repeating the mathematical description, the following Pyomo model is simply the maxmin model adapted to a single scenario.
The next cell computes the optimal plan for the mean scenario.
The expected profit under the mean scenario if 17833 which is 333 greater than for the worst case. Also note the production plan is different.
Which plan should be preferred? The one that produces a guaranteed profit of 17500 under all scenarios, or one that produces expected profit of 17833?
Summary
Planning for the worst case reduces the penalty of a bad outcome. But it comes at the cost of reducing the expected payout, the also the maximum payout should the most favorable scenario occur.
Which plan would you choose. Why?
Make a case for the other choice.