xternal_ringpacking.c
Go to the documentation of this file.
30/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 * This application contains a branch-and-price approach for the Ringpacking problem, also known as recursive circle
36 * packing problem, which is realized with the framework \SCIP. Therefore, the following plugins are implemented:
38 * - a \ref reader_rpa.c "problem reader" which parses the problem out of a file and creates the corresponding problem within \SCIP
39 * - a \ref probdata_rpa.c "(global) problem data structure" which contains all necessary information
41 * - a \ref cons_rpa.c "constraint handler" which stores information about which patterns have been verified
42 * - a \ref pattern.c "variable data structure" which provides fundamental functions for handling patterns
44 * In the following we introduce the problem, explain the use of the reader plugin and pricer plugin.
60 * The objective of the Ringpacking Problem is to select a minimum number of rectangles of the same size such that a
61 * given set of rings can be packed into these rectangles in a non-overlapping way. A ring is characterized by an
62 * internal and an external radius. Rings can be put recursively into larger ones or directly into a rectangle. The
71 * Instead of using a compact noncovex MINLP formulation, we utilize the results from A. Gleixner, S. Maher, B. Mueller,
72 * and J. Pedroso that have been presented in <a href="https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/6449">ZIB-Report 17-07</a>.
73 * Their approach is based on a Dantzig-Wolfe decomposition that can be solved via column generation. The first step
74 * is a reformulation which is similar to the classical reformulation for the Cutting Stock Problem, however, featuring
75 * nonlinear and nonconvex sub-problems. The purpose of this formulation is to break the symmetry between equivalent rectangles.
76 * As a second step, we combine this reformulation with an enumeration scheme for patterns that are characterized by rings
77 * packed inside other rings. Such patterns only allow for a one-level recursion and break the symmetry between rings with the
80 * More precisely, we introduce an integral variable \f$z_{P}\f$ for each rectangular pattern \f$P\f$ and an integral
81 * variable \f$z_{C}\f$ for each circular pattern \f$C\f$. A vector \f$P \in \mathbb{Z}_{+}^T\f$, where \f$T\f$ is
82 * the total number of ringtypes, is a <b>rectangular pattern</b> if and only if \f$P_t\f$ many circles with external radius
83 * \f$R_t\f$ for each \f$t \in \mathcal{T}\f$ (the set of types) can be packed together into a rectangle. Similarly, a tuple
84 * \f$(t,P)\in \mathcal{T} \times \mathbb{Z}_{+}^T\f$ is a <b>circular pattern</b> if it is possible to pack \f$P_1\f$ many
85 * circles of type \f$1\f$, \f$P_2\f$ many circles of type \f$2\f$, \f$\ldots\f$, \f$P_T\f$ many circles of type \f$T\f$
86 * into a larger ring of type \f$t\f$. Let \f$\mathcal{RP}\f$ and \f$\mathcal{CP}\f$ be the set of all rectangular or
94 * && \text{s.t.} \sum_{C = (t,P) \in \mathcal{CP}} z_C &\ge D_t && \text{ for all } t \in \mathcal{T} \\
95 * && \sum_{C = (t,P) \in \mathcal{CP}} z_C &\le \sum_{P \in \mathcal{RP}} P_t \cdot z_P + \sum_{C = (t',P) \in \mathcal{CP}} P_t \cdot z_C && \text{ for all } t \in \mathcal{T} \\
101 * The objective minimizes the total number of used rectangles. The first constraint ensures that the demand for each
102 * ring type is satisfied. The recursive decisions how to place rings into each other are implicitly modeled by the
103 * second type of constraints. Each selection of a pattern allows us to choose \f$P_t\f$ circular patterns of the type
104 * \f$(t,P)\f$. Note that at least one rectangular pattern needs to be selected before circular patterns can be packed.
107 * Since \f$\mathcal{RP}\f$ can be of exponential size, we are using a column generation approach to solve this
108 * problem. We initialize the (master) problem with a set of variables representing a selection of rectangular patterns
109 * that are easy to verify. Now, we have to iteratively search for variables representing "better" patterns, i.e.,
110 * a pattern which reduces the overall cost. Let \f$\lambda\f$ be the non-negative vector of dual multipliers for
111 * the recursive constraints after solving the LP relaxation of the restricted master problem for the
112 * current set of rectangular patterns. To compute a rectangular pattern with negative reduced cost we solve
120 * This problem is NP-hard and can be very difficult to solve. However, even if it cannot be solved to optimality within the
121 * given time limit, any solution with negative reduced cost can be used to continue the solving process. In that case, a
122 * dual bound of the LP relaxation can also be turned into a valid dual bound of the complete master problem. See
123 * @ref RINGPACKING_PRICER for more details. Also note that the dual bound is invalidated after the first branching step.
124 * This means that it is not a typical branch-and-price, but rather a <b>price-and-branch</b> framework.
126 * Another issue with the above formulation is the fact that \f$\mathcal{CP}\f$ can be of exponential size, as well. We try
127 * to overcome this by using a column enumeration algorithm to compute all relevant circular patterns.
134 * Here we describe a column enumeration algorithm that is used to deal with the exponential number of circular patterns.
136 * The main step of the algorithm is to verify whether a given tuple \f$(t,P)\in \mathcal{T} \times\mathbb{Z}_{+}^T\f$
137 * is in the set \f$\mathcal{CP}\f$ or not. A tuple can be checked by solving the following nonlinear nonconvex
142 * {\left\|{{\begin{pmatrix}x_i\\y_i\end{pmatrix}} - {\begin{pmatrix}x_j\\y_j\end{pmatrix}}}\right\|}_2 \ge R_i + Rj && \text{ for all } i,j \in C: i < j \\
143 * {\left\|{{\begin{pmatrix}x_i\\y_i\end{pmatrix}}}\right\|}_2 \le r_t - R_i && \text{ for all } i \in C \\
148 * Here \f$C\f$ is the index set of individual circles, and \f$R_i\f$ the corresponding external radius of a circle \f$i \in
149 * C\f$. The model checks whether all circles can be placed in a non-overlapping way into a ring of type \f$t\in\mathcal{T}\f$.
150 * The first constraints ensure that no two circles overlap, and the second constraints guarantee that all circles are placed
153 * Two more steps are taken in order to solve this problem more efficiently. Firstly, symmetry handling constraints are added
154 * to break the large amount of symmetry the formulation contains. Secondly, a dominance relation betwen circular patterns is
155 * introduced. In fact, it is easy to see that some patterns are never needed in an optimal solution, e.g. when at least one
156 * more circle fits. Therefore, some patterns don't have to be verified if certain others have already been (dis)proved to be
157 * feasible. The algorithm enumerates the circular patterns in a way that minimizes the number of verifications that have to
158 * be performed. See <a href="https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/6449">ZIB-Report 17-07</a>