xternal_scflp.c
Go to the documentation of this file.
30/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36 * This is an example of using the Benders' decomposition framework of SCIP to solve the stochastic capacitated facility
37 * location problem (abbreviated to SCFLP). The instances used for this problem are taken from the OR-Library CAP
38 * instances. These instances describe the deterministic capacitated facility location problem. The customer demands of
39 * the deterministic problem are used as the mean of the normal distribution in the stochastic program.
41 * To use the Benders' decomposition framework to solve the SCFLP instances requires the implementation of two plugins:
43 * - a \ref reader_scflp.c "problem reader" which parses the data from the CAP instance files and provides it to the
45 * - a \ref probdata_scflp.c "problem data structure" which builds the problem and stores the global information. The
46 * storage of global information is not absolutely necessary in this example, but it can be useful in post processing
49 * The SCFLP example formulates the problem as the determinstic equivalent, which can be solved directly by SCIP and by
50 * Benders' decomposition. Initially, we will describe how to build the deterministic equivalent problem. Second, we
51 * will describe how to build the problem so that the Benders' decomposition framework can be used.
67 * In the following we describe the CIP model that we use: both the monolithic mixed integer program and the decomposed
70 * Given: a set of facilities \f$ I \f$ and a set of customers \f$ J \f$. The set of scenarios is given by \f$ S \f$,
73 * Task: Find the minimum cost facilities to open such that the customer demand can be satisfied in all scenarios.
79 * - \f$ y^{s}_{ij} \f$ is the level of demand for customer \f$ j \f$ satisfied by facility \f$ i \f$ in scenario
94 * \min & \displaystyle \sum_{i \in I} f_{i} x_{i} + \frac{1}{|S|}\sum_{s \in S}\sum_{i \in I}\sum_{j \in J}q_{ij}y^{s}_{ij} \\
96 * subject \ to & \displaystyle \sum_{i \in I} y^{s}_{ij} \ge \lambda^{s}_{j} & \quad \forall j \in J, \forall s \in S \\
98 * & \displaystyle \sum_{j \in J} y^{s}_{ij} \le k_{i}x_{i} & \quad \forall i \in I, \forall s \in S \\
100 * & \displaystyle \sum_{i \in I} k_{i}x_{i} \ge \max_{s \in S}\sum_{j \in J}\lambda^{s}_{j} & \\
108 * It can be seen that as the number of scenarios increases, the size of the deterministic equivalent increases
109 * significantly. For large numbers of scenarios, the resulting deterministic equivalent can in intractable. This
110 * limitation can be addressed by applying decomposition techniques. In this example, Benders' decomposition is applied
115 * The application of Benders' decomposition forms a master problem, consisting of only the facility location variables,
116 * and a subproblem for each scenario, consisting of the customer servicing variables for the given secnario.
124 * subject \ to & \displaystyle \sum_{i \in I} k_{i}x_{i} \ge \max_{s \in S}\sum_{j \in J}\lambda^{s}_{j} & \\
126 * & \displaystyle \varphi^{s} \geq \sum_{j \in J}\lambda^{s}_{j}u^{p}_{j} + \sum_{i \in I}k_{i}x_{i}v^{p}_{i} & \quad \forall s \in S, \forall p \in P^{s} \\
128 * & \displaystyle 0 \geq \sum_{j \in J}\lambda^{s}_{j}u^{r}_{j} + \sum_{i \in I}k_{i}x_{i}v^{r}_{i} & \quad \forall s \in S, \forall r \in R^{s} \\
136 * where \f$ \varphi^{s} \f$ is the auxiliary variable for each scenario \f$ s \f$ that is an underestimator of the
137 * optimal subproblem objective function value. The second and third constraint of the master problem are the Benders'
138* optimality and feasibility cuts. Given a solution to the master problem, an optimality cut for scenario \f$s\f$ is
139* generated from the optimal dual solution to the corresponding subproblem. Similarly, if the solution to the master
140* problem induces an infeasibl instance of subproblem \f$s\f$, then the resulting dual ray is used to generate a
143 * The subproblem for scenario \f$ s \f$ that are solved to generate optimality and feasibility cuts are:
149 * subject \ to & \displaystyle \sum_{i \in I} y^{s}_{ij} \ge \lambda^{s}_{j} & \quad \forall j \in J \\
157 * The solution \f$\bar{x}\f$ is the candidate solution that is verified by solving the subproblem. As explained above,
158 * if the subproblem is infeasible, then the corresponding dual ray is used to generate a Benders' feasibility cut. If
159 * the subproblem is optimal and \f$ z^{s}(\bar{x}) > \varphi^{s} \f$, then an optimality cut is generated from the
160 * corresponding dual solution. If \f$ z^{s}(\bar{x}) \le \varphi^{s} \f$, then the subproblem is optimal for the given