2.4 BIM production for worst case
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.
Minmax objective function
Another class of seemingly complicated objective functions that can be easily rewritten as an LO problem are those stated as maxima over several linear functions. Given a finite set of indices and a collection of vectors , the minimax problem given by
General expressions like the latter can be linearized by introducing an auxiliary variable and setting
This technique works because if all the quantities corresponding to different indices are below the auxiliary variable , then we are guaranteed that also their maximum is also below and vice versa. Note that the absolute value function can be rewritten , hence the linearization of the optimization problem involving absolute values in the objective functions is a special case of this.
BIM problem variant: Maximizing the lowest possible profit
In the same way we can minimize a maximum like above, we can also maximize the minimum. Let us consider the BIM microchip production problem, but suppose that there is uncertainty regarding the selling prices of the microchips. Instead of just the nominal prices 12$ and 9$, BIM estimates that prices may more generally take values . The optimization problem for a production plan that achieves the maximum among the lowest possible profits can be formulated using the trick mentioned above and can be implemented in Pyomo as follows.