Abstract
This paper describes the implementation of Nutmeg, a solver that hybridizes mixed integer linear programming and constraint programming using the branchandcut style of logicbased Benders decomposition known as branchandcheck. Given a highlevel constraint programming model, Nutmeg automatically derives a mixed integer programming master problem that omits global constraints with weak linear relaxations, and a constraint programming subproblem identical to the original model. At every node in the branchandbound search tree, the linear relaxation computes dual bounds and proposes solutions, which are checked for feasibility of the omitted constraints in the constraint programming subproblem. In the case of infeasibility, conflict analysis generates Benders cuts, which are appended to the linear relaxation to cut off the candidate solution. Experimental results show that Nutmeg’s automatic decomposition outperforms pure constraint programming and pure mixed integer programming on problems known to have successful implementations of logicbased Benders decomposition, but performs poorly on general problems, which lack specific decomposable structure. Nonetheless, Nutmeg outperforms the standalone approaches on one problem with no known decomposable structure, providing preliminary indications that a handtailored decomposition for this problem could be worthwhile. On the whole, Nutmeg serves as a valuable tool for novice modelers to try hybrid solving and for expert modelers to quickly compare different logicbased Benders decompositions of their problems.
Introduction
Combinatorial optimization problems are abstract mathematical problems with immense practicality. Therefore, solving them quickly is of interest to both academics and practitioners. Combinatorial optimization problems can be solved using any one of a variety of methods, including dynamic programming, Boolean satisfiability (SAT), mixed integer programming (MIP), and constraint programming (CP), to name just a few. Even though these methods have exponential worstcase time complexity, each has its own strengths and weaknesses, making some methods faster than others at particular problems. Usually, the speed difference arises from a method’s ability or inability to exploit certain substructures within a problem. This paper studies a hybridization of MIP and CP that decomposes substructures to either MIP or CP in order to exploit their unique strengths and alleviate their weaknesses.
To solve a problem using either MIP or CP, the problem must be formally stated as a model. A model consists of unknowns, called variables, and relationships between the variables, called constraints. In an optimization problem, as opposed to a satisfaction problem, the model also contains an objective function, which computes a number to be minimized or maximized, called the objective value. The problem can then be solved by calling a solver, an implementation of an algorithm, on the model.
CP solvers typically run a tree search algorithm. At every node of the search tree, the solver maintains a set of values that each variable can take, called its domain, and calls a sequence of subroutines, called propagators, to remove inconsistent values from the domains. A solution is found whenever the domain of every variable is reduced to a singleton. Effective CP models typically use global constraints for declaring highlevel substructures, such as network flow, bin packing, or disjunctive scheduling. A major strength of CP is that solvers often implement specialized propagators for reasoning over the entire substructure of a global constraint, allowing domains to be reduced very quickly. The canonical example is cumulative scheduling, for which CP is stateoftheart and has closed many difficult benchmarks [31].
MIP solvers also search a tree but take a different approach. At every node of the search tree, MIP solvers solve a relaxation; usually, but not always, a linear programming (LP) relaxation. A relaxation of a problem is identical to the originating problem but omits some of its constraints. Consequently, the optimal objective value of a relaxation provides a dual bound to the originating problem. This value also bounds the optimal objective value of all nodes in the subtree below the node. Highperformance MIP models have a tight relaxation, i.e., one whose convex hull is close to its integer hull. Some models (e.g., those with a totally unimodular matrix and integer righthand side) can be theoretically proven that their LP relaxation is as tight as possible, i.e., its convex hull and integer hull coincide [10]. A consequence is that the MIP model is solved in one call to an LP solver, and hence, the problem can be solved in polynomial time.
Despite CP’s impressive ability to reason within individual substructures using global constraints, reasoning across multiple substructures/constraints remains a challenge because each constraint has no knowledge about every other constraint. CP has considerable difficulty at reasoning across different constraints to optimize a linear objective function because it has no global view of the problem and because propagation of linear constraints is weak. In particular, CP performs especially poorly if many constraints are linear, i.e., the problem is or nearly is a pure MIP problem. Contrastingly, MIP problems are stated on a matrix, and solving its LP relaxation is equivalent to performing elementary row operations, essentially allowing for communication across constraints. Notably, reasoning over a polytope to optimize a linear objective function is trivial for LP.
Propagation and relaxation are complementary, and fully exploiting this complementarity should lead to speed improvements. Logicbased Benders decomposition (LBBD) formalizes this approach to hybridization [21]. Successful implementations of LBBD typically use CP to reason about individual substructures and MIP to aggregate this information across various substructures using linear constraints, also gaining the dual bound in the process.
A major disadvantage of LBBD in the past is that it is always problemspecific. Recently, two teams independently invented a generic form of LBBD, enabling LBBD of arbitrary problems with little effort [11, 25]. The present paper, written by the two teams together, further develops these ideas into a publicly available solver named Nutmeg. Given a highlevel model of a problem, Nutmeg automatically builds a MIP master problem and a CP checking subproblem using the LBBD framework. Nutmeg then proceeds to solve the two problems sidebyside in a single branchandbound search tree. The MIP master problem optimizes a linear objective function while the CP checking subproblem propagates global constraints to reduce the variable domains. In addition, dual bounds in the MIP master problem are communicated to the CP subproblem for propagation, and infeasibilities in the CP subproblem are transferred to the MIP master problem as Benders cuts. The remainder of this paper details the method and empirically compares it against pure CP and pure MIP approaches on a large range of problems.
Related Work
Hybridization of MIP and CP is a highly active area of research. SCIP is a MIP solver that supports many features foundational to CP, such as global constraints, propagation, and conflict analysis [1, 2]. Even though SCIP natively supports global constraints, the key difference is that Nutmeg implements a decomposition; it does not simply extend a MIP solver with propagation and conflict analysis (as in SCIP). Rather, Nutmeg moves complicating variables and constraints out of a monolithic model into a subproblem, in the hope that the master problem is smaller and can be solved faster.
The use of MIP methods in CP also has a long history. LP propagators have long been used within CP solvers [32] in order to better reason about conjunctions of linear constraints. Similarly, network flow algorithms [30] and general network flow propagators [33] have been used extensively in CP. However, the generic use of MIP techniques to find dual bounds is limited. Problemspecific CP solvers have implemented dual bounds using a variety of methods, including global optimization constraints [13], Lagrangian relaxation [6, 14], DantzigWolfe reformulation [22], and LBBD [21]. A summary of these techniques can be found in the short survey in [23].
The two main goals of Nutmeg are to provide better reasoning about a conjunction of linear constraints (i.e., a polytope) in a CP solver and to find tighter dual bounds via a linear relaxation. This is accomplished using LBBD. Classical Benders decomposition splits a monolithic MIP model into a MIP master problem and an LP subproblem, both of which contain different variables and constraints [7]. The method then iteratively solves the two problems. The master problem proposes a candidate solution. The subproblem checks the solution and communicates infeasibility or superoptimality to the master problem by adding rows, now known as Benders feasibility cuts and Benders optimality cuts respectively [34]. Benders cuts are found using LP duality theory, which has no equivalent for MIP subproblems. LBBD expands upon LP duality by defining an inference dual to any general optimization problem [21], enabling MIP subproblems or even general discrete subproblems. Unlike classical Benders decomposition, there is no exact form that applies to every problem due to its generality. Every implementation of LBBD requires the user to analyze the problem and precisely define the Benders cuts added to the master problem.
An automatic mechanism to generate Benders cuts applicable to all CP problems was independently invented by [11] and [25]. The method relies on conflict analysis of lazy clause generation CP solvers, which themselves are hybrids of SAT and traditional finitedomain CP solvers [12, 28]. Conflict analysis generates a clause (i.e., a disjunction of Boolean variables) explaining an infeasibility. The clause is then translated into a Benders cut in the MIP master problem.
In [11], the method is implemented by adapting the MiniZinc modeling system [27]. The MiniZinc controller iterates between a MIP solver and a CP solver. It finds an optimal MIP solution, which is passed to the CP solver to check. Their results showed that the hybrid method outperformed pure MIP and pure CP models on a variety of problems with known successful LBBD implementations.
In [25], a specialized branchandcut solver is built for the Vehicle Routing Problem with Time Windows. It passes every LP solution in the branchandbound tree to the CP solver. Borrowing terminology from earlier works [4, 35], the algorithm was named branchandcheck with explanations. The solver found cuts identical to problemspecific cuts previously proposed in the literature. Consequently, these cuts are lifted using existing techniques by recognizing the form of the cuts. The solver also found problemspecific cuts that have never before appeared in the literature.
Even though the results of [11, 25] are peerreviewed, their codes are not intended for general use. The solver of [25] is problemspecific, and the system from [11] requires handtuning for each problem. The present paper, authored by both teams, develops these concepts into a fully working solver available for public use. This paper does not present significant advances in the theory of hybridization, but rather, describes a new implementation in the definitive journal version of the earlier conference works.
Preliminaries
This section presents several concepts necessary for the discourse in the remainder of the paper.
LogicBased Benders Decomposition
LBBD is a method for solving combinatorial problems with substructures suited to MIP and substructures suited to CP. It is defined using an inference dual in the general case, but this paper only introduces a special case relevant to hybridizing MIP and CP.
An assumption of many CP approaches is that every variable takes integer values and has a finite domain. Hence, CP models are bounded. Consider a general bounded problem \(\mathcal {P}\) that has variables partitioned into two groups x = (x_{1},…,x_{n}) and y = (y_{1},…,y_{m}), each with finite domains \(D_{\mathbf {x}} \subseteq \mathbb {Z}^{n}\) and \(D_{\mathbf {y}} \subseteq \mathbb {Z}^{m}\). Without loss of generality, the problem minimizes x_{1} over the intersection of some linear constraints A_{1}x ≤b_{1} on the x variables and some general constraints \(S \subseteq D_{\mathbf {x}} \times D_{\mathbf {y}}\) on both the x and y variables. For example, S can contain global constraints or channeling constraints between multiple modelings. The problem \(\mathcal {P}\) can be stated as follows:
Define the MIP master problem \({\mathscr{M}}\) of \(\mathcal {P}\) as:
where \(\{ \mathbf {x} \in D_{\mathbf {x}}  \mathbf {y} \in D_{\mathbf {y}}, (\mathbf {x},\mathbf {y}) \in S \} \subseteq \{ \mathbf {x} \in D_{\mathbf {x}}  A_{2} \mathbf {x} \leq \mathbf {b}_{2} \}\). Then, the constraints A_{2}x ≤b_{2} are said to be a relaxation of S. Since D_{x} is finite, \({\mathscr{M}}\) is bounded. Clearly, \({\mathscr{M}}\) is a MIP relaxation of \(\mathcal {P}\). Next, define the CP checking subproblem \(\mathcal {C}\) of \(\mathcal {P}\) as the satisfiability version of \(\mathcal {P}\):
Notice that A_{1}x ≤b_{1} also appears in \(\mathcal {C}\), even though it already exists in \({\mathscr{M}}\). As explained later in Section 4.3, including it in \(\mathcal {C}\) can lead to more propagation when dealing with fractional solutions from the LP relaxation of \({\mathscr{M}}\).
In some sense, this decomposition delegates the optimization parts to the MIP problem and the satisfiability parts to the CP problem. Such a decomposition—one that includes all the original constraints in the CP subproblem—is rare in the literature.
The LBBD methodology iterates between the master problem \({\mathscr{M}}\) and the subproblem \(\mathcal {C}\), but exactly when to solve them is a choice in the implementation. The basic LBBD algorithm is summarized in Fig. 1. (Nutmeg implements the branchandcut form of LBBD, called branchandcheck, as described later.) Step 1 solves the MIP master problem optimally. If it is infeasible, the algorithm immediately exits. Otherwise, an \({\mathscr{M}}\)feasible solution \(\hat {\mathbf {x}}\) exists since the problem is bounded. In Step 2, \(\hat {\mathbf {x}}\) is fed into the CP checking subproblem to check for feasibility of the omitted constraints S. If the subproblem finds that \(\hat {\mathbf {x}}\) is infeasible with respect to S, one or more linear constraints
are added to the master problem to remove \(\hat {\mathbf {x}}\). The LBBD algorithm then solves the master problem again, iterating between the two problems until the subproblem declares that \(\hat {\mathbf {x}}\) is feasible. The first feasible solution \((\hat {\mathbf {x}}, \hat {\mathbf {y}})\) in the checking subproblem is optimal for the original problem \(\mathcal {P}\).
As in standard CP models, the objective function is equated to a variable. Hence, there is no need to distinguish between feasibility cuts and optimality cuts. Constraint (1) is simply referred to as a Benders cut. Unlike classical Benders decomposition, a general template of Constraint (1) does not exist in LBBD; its exact form is problemspecific. The remainder of this section presents an example.
Example 1 (Cumulative Scheduling with Optional Tasks)
The global constraint CumulativeOptional optionally schedules tasks on machines. Machines can be thought of as replenishing resources. Given a set \(\mathcal {I} = \{ 1,\ldots ,I \}\) of \(I \in \mathbb {Z}_{+}\) tasks, the constraint CumulativeOptional(x,s,d,r,C) takes a vector \(\mathbf {x} = (x_{1},\ldots ,x_{I}) \in \{ 0,1 \}^{I}\) of binary variables indicating whether a task is scheduled or ignored, a vector \(\mathbf {s} = (s_{1},\ldots ,s_{I}) \in \mathbb {Z}_{+}^{I}\) of integer variables representing the starting time of the active tasks (i.e., every task \(i \in \mathcal {I}\) with x_{i} = 1), a constant vector \(\mathbf {d} = (d_{1},\ldots ,d_{I}) \in \mathbb {Z}_{+}^{I}\) of the duration of each task, a constant vector \(\mathbf {r} = (r_{1},\ldots ,r_{I}) \in \mathbb {Z}_{+}^{I}\) for the number of machines simultaneously required for each task, and a scalar \(C \in \mathbb {Z}_{+}\) representing the total number of machines available. The constraint attempts to schedule the tasks \(\{ i \in \mathcal {I}  x_{i} = 1 \}\) on C machines, where each task i uses r_{i} machines from time s_{i} to time s_{i} + d_{i} − 1 (inclusive).
Consider this constraint as S in the definition of \(\mathcal {P}\) and \(\mathcal {C}\). A possible linear relaxation of S is the constraint
where \(T = \max \limits _{i \in \mathcal {I} } (\max \limits (D_{s_{i}}) + d_{i}  1 )\) is the time before which all tasks must be completed and \(D_{s_{i}}\) is the domain of s_{i}. This constraint is known as the energy relaxation because it reasons about the “area under the curve.” Figure 2 illustrates this relaxation for a CumulativeOptional constraint with three machines and two tasks. Each task i ∈{1,2} requires r_{i} = 2 machines, has a duration of d_{i} = 3, and must start between time 1 and 2, i.e., s_{i} ∈{1,2}. Then, the time horizon is T = 4. The full constraint, shown on the left, permits at most one task to be scheduled. The energy relaxation, shown on the right, only bounds the total number of squares in use.
Example 2 (Planning and Scheduling)
The Planning and Scheduling problem assigns jobs to facilities and then schedules the jobs at each facility on a number of machines [19, 20]. Let \(T \in \mathbb {Z}_{+}\) be the time horizon before which all jobs must be completed. Define \(\mathcal {J} = \{ 1,\ldots ,J \}\) as the set of jobs and \(\mathcal {F} = \{ 1,\ldots ,F \}\) as the set of facilities. Let x_{j,f} ∈{0,1} be a binary decision variable indicating whether job \(j \in \mathcal {J}\) is assigned to facility \(f \in \mathcal {F}\), and let \(s_{j,f} \in \mathbb {Z}_{+}\) be an integer decision variable for the start time of job j when j is assigned to facility f, i.e., when x_{j,f} = 1. If j is assigned to f, it incurs a cost \(c_{j,f} \in \mathbb {Z}_{+}\), has a duration of \(d_{j,f} \in \mathbb {Z}_{+}\) units of time, uses \(r_{j,f} \in \mathbb {Z}_{+}\) machines at f simultaneously, and must start within some time window \(\{ a_{j,f},\ldots ,b_{j,f} \} \subseteq \{ 1,\ldots ,T  d_{j,f} + 1 \}\). Each facility f has a total of \(C_{f} \in \mathbb {Z}_{+}\) machines. The problem minimizes the total cost of assigning jobs to facilities.
The problem \(\mathcal {P}\) is stated in Fig. 3. Each facility \(f \in \mathcal {F}\) is associated with one CumulativeOptional constraint that schedules all jobs assigned to f, i.e., the jobs \(\{ j \in \mathcal {J}  x_{j,f} = 1 \}\). The MIP master problem \({\mathscr{M}}\) is shown in Fig. 4. Constraint (3d) is the energy relaxation of Constraint (2d). The CP checking subproblem is exactly the original problem without the objective function, and hence, is not shown here.
For any candidate solution \(\hat {\mathbf {x}}\) in the MIP master problem, define \(1_{\hat {\mathbf {x}}} = \{ (j,f)  \hat {x}_{j,f} = 1 \}\) as the set of jobfacility pairs taking value 1. Whenever the CP subproblem detects that \(\hat {\mathbf {x}}\) is infeasible, Constraint (1) is realized as the inequality
This Benders cut forces the MIP solver to choose another set of assignments by prohibiting at least one of the selected assignments.
Bound Disjunction Constraints
Benders cuts over binary variables are simple to add to a MIP model (e.g., Constraint (4)). Nutmeg supports Benders cuts over integer variables, which are nontrivial to capture in MIP. Benders cuts over integer variables can be implemented using bound disjunction constraints, which generalize a disjunction of binary variables (i.e., a clause) to a disjunction of bound tightenings of integer variables.
For any integer variable \(x \in \mathbb {Z}\), define a binary variable named x = k that takes value 1 if and only if x takes value \(k \in \mathbb {Z}\) in the same solution and takes value 0 otherwise. Similarly, define binary variables x≠k, x ≥ k and x ≤ k that respectively indicate whether x≠k, x ≥ k and x ≤ k. These binary indicator variables are called literals. Notice that x≠k = 1 −x = k and x ≤ k = 1 −x ≥ k + 1. Therefore, only some of these literals need to be considered explicitly.
For a problem with \(I \in \mathbb {Z}_{+}\) integer variables x_{1},…,x_{I}, a bound disjunction constraint is a disjunction of literals of the form:
where \(L_{\geq },L_{\leq } \subseteq \{ 1,\ldots ,I \} \times \mathbb {Z}\) are sets of pairs of variable indices and values that specify the literals of the constraint. If all the x_{i} variables in Constraint (5) are binary, the constraint can be trivially linearized. Otherwise, there are three common ways of implementing a bound disjunction constraint in MIP.
Propagation
Constraint (5) can simply be propagated exactly like in CP. Upon selecting the next node to solve in the branchandbound tree, the node is preprocessed to remove inconsistent values in the variable domains. Even though the propagator is domain consistent, it does not filter the domains much since it is an extremely weak constraint. The only propagation that occurs is that whenever all but one of the literals are assigned 0, the remaining literal is fixed to 1, satisfying the constraint; and whenever all literals are assigned 0, infeasibility of the constraint is detected. Since the constraint does not appear in the LP relaxation, this approach suffers from many of the same weaknesses as CP. For example, the constraint could be infeasible in the LP relaxation (called rationally infeasible), but this fact cannot be detected because propagation only reasons about one constraint at a time.
Indicator Constraints
Constraint (5) can be explicitly added to the model as:
The literals x_{i} ≥ k and x_{i} ≤ k must also appear in the model. They are added as binary variables, together with the indicator constraints:
Indicator constraints themselves can be implemented using either a bigM constraint or an inequality and an SOS1 constraint. Indicator constraints are wellestablished in modern MIP solvers, so we do not discuss them in detail.
Linking Constraints
Under this approach, the entire unary encoding of the domain \(D_{x_{i}}\) of every integer variable x_{i} in Constraint (6) is added as equality literals, along with constraints that link the literals to the originating integer variable:
Constraint (6) is added to the model after substituting:
This approach makes the matrix much denser and explodes the size of the matrix with many more auxiliary variables. However, for integer variables with small domains, linking constraints are faster than indicator constraints in practice [5, 29].
Conflict Analysis
In all modern SAT solvers, every change to a domain is recorded in a graph called the implication graph. Whenever a propagation is infeasible, the search algorithm calls a subroutine, called conflict analysis, that inspects the chain of propagations that led to the infeasibility and then creates a constraint, called a nogood, that prevents the infeasibility from occurring again in the remainder of the search tree [26]. This is because any subtree that contains the same propagations will always violate the nogood, and hence, the entire subtree can be discarded. Conflict analysis dramatically improves the solving speed and is the defining feature of contemporary SAT solvers.
Lazy clause generation CP solvers make use of SAT conflict analysis [28]. Every change to the domain of an integer variable is implicitly or explicitly associated with a literal. In CP problems with only integer variables (e.g., no set variables or graph variables), conflict analysis generates nogoods in the form of bound disjunction constraints. Nutmeg uses conflict analysis to find nogoods, which are translated into bound disjunction Benders cuts.
Assumptions Interface
Many decompositionbased solving techniques solve a sequence of closely related subproblems as a subroutine. In SAT and lazy clause generation CP solvers, this can be facilitated by an assumptions interface. Rather than solving a base problem \(\mathcal {C}\), \(\mathcal {C}\) can be solved subject to assumptions A = a_{1} ∧… ∧ a_{n}, where a_{1},…,a_{n} are additional constraints. The solver then produces a solution satisfying both \(\mathcal {C}\) and A, or returns an assumptions nogood N defined by a subset \(A^{\prime }\) of A such that \(\mathcal {C} \wedge A^{\prime }\) is infeasible. The nogood N takes the form
or equivalently,
The advantage of the assumptions approach is that the problem \(\mathcal {C}\) can be resolved under different assumptions, while preserving the rest of the solver state. In an arbitrary solver, this could be achieved by solving each instance from scratch and then returning A if \(\mathcal {C} \wedge A\) is infeasible. SAT and lazy clause generation CP solvers can do better. By preserving the database of learnt clauses, the solver can avoid reexploring the same infeasible subtrees in multiple calls to the solver. By using conflict analysis, the solver can also trim A down to a smaller (though not necessarily minimal) set of assumptions that caused the failure. Nutmeg makes use of the assumptions interface in an underlying CP solver when repeatedly solving \(\mathcal {C}\). Doing so enables Nutmeg to benefit from efficiencies in the implementation.
BranchandCheck in Nutmeg
This section presents the implementation of Nutmeg.
Underlying Solvers
Nutmeg is a metasolver that implements a generalization of the branchandcheck ideas of [11, 25]. It is simply a thin layer that calls an underlying MIP solver and CP solver, and communicates information from one solver to the other. At present, the MIP solver is SCIP 6.0.2 [18]. The CP solver is a forthcoming lazy clause generation solver named Geas [17], which is the successor of the experimental but stateoftheart solver Chuffed [9].
Modeling and Automatic Decomposition
Nutmeg provides a C++ programming interface and a MiniZinc modeling interface. Using either interface, users can declare variables and add constraints to build a model in the form of either \(\mathcal {P}\), or \({\mathscr{M}}\) and \(\mathcal {C}\).
Users can declare a model in the form of \(\mathcal {P}\) and defer the decomposition of \(\mathcal {P}\) into \({\mathscr{M}}\) and \(\mathcal {C}\) to Nutmeg’s automatic decomposition mechanism. To do this, users simply create variables and add constraints as usual. Nutmeg uses a predefined library of rewritings to add linear constraints A_{2}x ≤b_{2} to \({\mathscr{M}}\) and general constraints (x,y) ∈ S to \(\mathcal {C}\). The library of rewritings defines a linearization or linear relaxation in \({\mathscr{M}}\) and global constraints augmented with redundant constraints to assist propagation in \(\mathcal {C}\). The following example shows how the rewriting proceeds.
Example 3 (Planning and Scheduling)
Consider the Planning and Scheduling problem in Example 2. Users can input \(\mathcal {P}\) as shown in Fig. 3. Given \(\mathcal {P}\), Nutmeg builds \(\mathcal {C}\) by dropping the objective from \(\mathcal {P}\). Nutmeg builds \({\mathscr{M}}\) by substituting global constraints for linear constraints obtained from its library of rewritings. The library currently contains the energy relaxation of CumulativeOptional from Example 1. Therefore, Nutmeg builds \({\mathscr{M}}\) exactly as presented in Fig. 4.
The library of rewritings is made transparent; fully exposing how an input constraint is rewritten into linear constraints in \({\mathscr{M}}\) and general constraints in \(\mathcal {C}\). Instead of adding a highlevel \(\mathcal {P}\)constraint, users can directly add (a subset of) the \({\mathscr{M}}\) and \(\mathcal {C}\)rewritings. Users can also completely ignore the library of rewritings and add any constraint they desire directly to \({\mathscr{M}}\) and \(\mathcal {C}\). In effect, users can precisely specify \({\mathscr{M}}\) and \(\mathcal {C}\), bypassing Nutmeg’s automatic decomposition of \(\mathcal {P}\).
The linearization or linear relaxation of some global constraints, such as CumulativeOptional, is easy to implement. Other global constraints are much more difficult to implement, even if they have simple linearizations. Example 4 describes one such constraint.
Example 4 (Assignment Problem)
The AllDifferent global constraint captures the Assignment Problem substructure. Given a vector x = (x_{1},…,x_{I}) of \(I \in \mathbb {Z}_{+}\) integer variables, AllDifferent(x) permits each value to be assigned to at most one of x_{1},…,x_{I}. Let \(\mathcal {I} = \{ 1,\ldots ,I \}\). The linearization of AllDifferent(x) is
where \(D_{x_{i}}\) is the domain of x_{i}. Since this linearization is very tight, it is likely worthwhile to include the entire linearization in \({\mathscr{M}}\). Nutmeg creates every literal x_{i} = k as a binary variable in \({\mathscr{M}}\). These literals are then connected to the originating variable x_{i} in \(\mathcal {C}\). If the integer variable x_{i} exists in \({\mathscr{M}}\) (e.g., because another linearization or linear relaxation requires the integer value), Nutmeg also adds a linking constraint. The implementation of all these concepts is highly nontrivial.
The BranchandCheck Algorithm
Nutmeg solves \({\mathscr{M}}\) and \(\mathcal {C}\) using the branchandcut form of LBBD known as branchandcheck [4, 35]. The key difference to branchandcut is that cut separation is performed automatically by conflict analysis within a CP solver, rather than implemented specifically for one family of cuts, and that the cuts can span all variables, rather than one class of variables (e.g., subtour elimination cuts in the Traveling Salesman Problem only concern arc variables).
The branchandcheck algorithm is sketched in Fig. 5. The main difference to the basic LBBD algorithm in Fig. 1 is that it calls the CP subproblem on every LP solution, instead of only on \({\mathscr{M}}\)optimal solutions, i.e., \(\mathcal {P}\)superoptimal solutions.
A subtlety here is that primal and dual bounds are applied to the objective variable (i.e., x_{1} from Section 3.1) in the Feasibility Check and Candidate Solution Check. Therefore, \((\hat {\mathbf {x}},\hat {\mathbf {y}})\) in the Candidate Solution Check is always an improving solution.
Recall from Section 3.1 that A_{1}x ≤b_{1} is included in the CP subproblem even though it already exists in the MIP master problem. Consider the constraint 2x_{1} + x_{2} ≤ 1 with a fractional solution \(\hat {x}_{1} = \hat {x}_{2} = 1/3\). The Candidate Solution Check transfers this fractional solution to the CP subproblem as the bounds 0 ≤ x_{1} ≤ 1 and 0 ≤ x_{2} ≤ 1. Explicitly including the constraint in the CP subproblem will propagate x_{1} ≤ 0, and hence, fix x_{1} = 0.
As defined, the branchandcheck algorithm eagerly runs the Candidate Solution Check after every LP solve. This provides for the most interaction between the two problems and prunes nodes at the earliest opportunity. However, in highly fractional LP solutions, this scheme requires more computation time since the CP subproblems could be very difficult to solve.
Calling the Candidate Solution Check only at MIP integral solutions leads to less interaction and less time spent in the CP subproblem but at the expense of a larger search tree. However, this CP subproblem is much easier to solve since the x variables have integer values, and hence, are fixed by assumptions. Alternatively, the Candidate Solution Check can be run on fractional solutions with a limited computation budget. If running the check on a fractional solution takes too long, aborting the check and continuing with processing the node has no adverse effects. Of course, checking an integer solution cannot be terminated early since it could be a leaf node. The decision about when to call the Candidate Solution Check and with what budget are parameters in the implementation.
Nogoods
By making assumptions consisting of only bound changes, all resultant nogoods are guaranteed to be bound disjunction constraints that only contain literals concerning variables that appear in the master problem. The procedure for upgrading a nogood and then adding it to the master problem is shown in Fig. 6.
The nogoods are not necessarily minimal; i.e., they may contain excess literals not necessary for explaining a failure. Nutmeg begins with a preprocessing step that temporarily removes one literal from the nogood and makes new assumptions on those literals. If the CP subproblem reports the new assumptions are infeasible, then the literal did not contribute to the failure and is permanently removed. Otherwise, the literal is reinstated and the process continues to the next literal. This occurs until every literal is examined. A time limit and conflict limit, given as parameters, are placed on this optional strengthening phase.
If the improved nogood is empty, then the problem is globally infeasible, so the solver exits. If the nogood contains exactly one literal, the bound change is enacted globally. If the nogood only contains literals over binary variables, it can be easily added as a cut. Otherwise, the nogood contains integer variables and cannot be simplified. Nutmeg uses SCIP as the MIP solver, which natively supports bound disjunction by propagation. It runs a SATstyle propagator but also branches on one of the disjuncts in certain cases. If a different MIP solver is used, any one of the three approaches mentioned in Section 3.2 for implementing bound disjunction constraints can be used.
Example 5 (Planning and Scheduling)
Consider an instance of the Planning and Scheduling problem from Example 2 with time horizon T = 4, a single facility 1 with capacity 3 and two jobs 1 and 2. Each job must start between time 1 and 2, has a duration of 3, and uses 2 resources. Activating both jobs satisfies the relaxation (Constraint (3d)) but does not satisfy the original constraint (Constraint (2d)), as illustrated in Fig. 2. Given this candidate solution, the CP subproblem will detect an infeasibility and create the nogood
which is added to the MIP master problem as the row
or equivalently, as the clique constraint
This constraint is incompatible with Constraint (3c), enabling the MIP solver to declare that the problem is infeasible.
BlockDiagonal Structure
In mathematical programming decompositions (e.g., DantzigWolfe or Benders), blockdiagonal structure can be decomposed into one independent subproblem per block. Nutmeg takes a different approach: all “blocks” are contained within the singular subproblem \(\mathcal {C}\). The reason for this is that conflict analysis will never generate a nogood spanning multiple blocks because they are independent by definition.
Experimental Results
The experiments compare branchandcheck against pure CP and pure MIP. Two variants of branchandcheck are tested: (1) B&CLP runs the CP checking subproblem at every fractional and integer solution with a limit of 0.3 s and 300 conflicts for fractional solutions, and (2) B&CMIP runs the CP checking subproblem only at integer solutions. The standalone approaches use the same solvers, specifically, Geas and SCIP. All solvers are singlethreaded and are run for ten minutes on an Intel Xeon E52660 V3 CPU at 2.6 GHz. The four methods are evaluated on four experiments that explore Nutmeg’s performance on different problem classes. The findings are presented below.
Known Successful Problems
The first experiment runs the four methods on three problems recognized to have successful implementations of LBBD. The purpose of this experiment is to verify that the decomposition, and especially the automatic decomposition, is indeed faster than the standalone approaches. This experiment evaluates the solvers on the following three problems:

Planning and Scheduling (P&S): This problem is introduced in Example 2. There are a total of 335 instances.

Capacity and Distanceconstrained Plant Location Problem (CDCPLP): This problem, formalized in the Appendix, is a variation on the classical Facility Location problem [3]. The problem allocates customers to facilities at some cost. All facilities are initially closed and can be opened at some cost if assigned customers. The problem also contains a fleet of distancelimited vehicles stationed at the facilities to serve the customers. The number of vehicles in use also contributes to the total cost. At each facility, customers are assigned to a particular vehicle using a BinPacking constraint, which is a special case of the CumulativeOptional constraint. There are 300 instances.

Vehicle Routing Problem with Location Congestion (VRPLC): This problem, formalized in the Appendix, routes vehicles to various sites to deliver goods subject to travel time, time windows, and vehicle capacity constraints [24]. Each site features a Cumulative constraint that schedules the deliveries around the availability of equipment for unloading the vehicles. The MIP master problem contains the base Vehicle Routing Problem and the empty relaxation of the Cumulative constraints. The objective minimizes the total travel distance. There are 450 instances.
All these problems have similar structure: they contain the Assignment Problem plus some side constraints and either Cumulative or CumulativeOptional global constraints. This problem structure is ideally suited to LBBD because MIP easily solves the base Assignment Problem since it possesses the integrality property (i.e., it can be solved in one call to an LP solver [10]), and CP excels at cumulative scheduling but has difficulty at reasoning over linear constraints. Given this problem structure, LBBD follows naturally.
Figure 7 plots the number of instances solved to proven optimality or infeasibility. On CDCPLP, B&CMIP solves the most instances, followed by MIP. B&CLP solves onethird the number of instances solved by B&CMIP. On the instances with feasible but not provably optimal solutions, B&CMIP, B&CLP, and MIP achieve an average optimality gap of 8.9%, 15.5%, and 19.1% respectively. (Since CP does not solve a relaxation, dual bounds and gaps are not available.)
On P&S, the two branchandcheck methods are essentially identical, solving many more instances than the standalone methods. B&CMIP, B&CLP, and MIP obtain an average optimality gap of 19.9%, 22.3%, and 1.9% on the instances with feasible but not optimal solutions. There are several instances in which branchandcheck gets stuck within the CP subproblem, resulting in a 100% optimality gap, which skews these statistics in favor of MIP.
On VRPLC, the two branchandcheck methods solve substantially more instances than standalone CP and MIP. The optimality gaps of feasible but not provably optimal instances are 21.5%, 45.7%, and 53.9% for B&CMIP, B&CLP, and MIP.
These results suggest that B&CMIP dominates B&CLP. Presumably, this is due to the large number of calls asking the subproblem to check fractional solutions that are CPfeasible, resulting in no cut being generated but time wasted on checking them. Overall, these results indicate that Nutmeg’s automatic decomposition succeeds on problems with structure suited to LBBD.
Makespan Objective Function
The previous experiment consists of problems with linear constraints, scheduling constraints, and a linear objective function, which is natural for MIP but difficult for CP. The second experiment swaps the cost objective for the makespan objective, which appears frequently in scheduling problems. This objective function minimizes the time at which the last task is completed. This kind of minimax objective is known to perform poorly in MIP because it has a weak linear relaxation, but performs well in CP because optimizing a minimax objective is essentially equivalent to solving a sequence of progressively tighter satisfiability problems. The goal of the second experiment is to determine whether the MIP master problem can optimize a CPpreferred objective solely via the subproblem.
This experiment compares the four methods on P&S and VRPLC from the previous experiment but with the makespan objective. CDCPLP is excluded because it uses the BinPacking constraint, which has no meaning in the context of scheduling, despite being implemented by the same propagator as CumulativeOptional.
Figure 8 clearly shows that the minimax objective sufficiently destroys the nice structure, allowing pure CP to outperform the other approaches. For P&S, the average optimality gaps of feasible but not provably optimal instances are 40.0%, 39.3%, and 18.0% for B&CMIP, B&CLP, and MIP. Again, MIP finds bounds tighter than branchandcheck on average because branchandcheck gets trapped within the CP subproblem on some instances, resulting in a gap of 100%. For VRPLC, the instances are trivial for CP. B&CMIP, B&CLP, and MIP find an average optimality gap of 50.4%, 63.6%, and 67.3% on feasible but not optimal instances. These results demonstrate that the branchandcheck master problem has little information for optimizing the objective after moving the scheduling constraints into the subproblem.
MiniZinc Challenge
The next experiment comprises problems from the 2013 to 2019 MiniZinc Challenges. This experiment, the first of its kind, evaluates the main contribution of Nutmeg, that is, the automatic LBBD of arbitrary problems, including those for which decomposable structure is either not known or not explicitly programmed. Six problems (35 instances) are excluded because they contain global constraints whose propagator is not yet implemented in Geas. In total, this experiment consists of 667 instances across 94 problems. These problems are highly varied: while several problems contain simple structure that could be suitable for LBBD after some manual manipulation, many problems are clearly unstructured.
Figure 9 shows that branchandcheck performs poorly without appropriate structure. Branchandcheck solves significantly fewer instances than CP and MIP because the master problem has little or no knowledge about the constraints moved into the subproblem, and hence, continually searches for solutions that do not exist. Even though MIP solves many more instances, the average optimality gaps of B&CMIP, B&CLP, and MIP on feasible instances are 68.3%, 70.9%, and 218.8%. These numbers are skewed against MIP because there are outliers with a very high optimality gap (one as high as 10,200%).
Spot5
Analyzing the results to each problem in the MiniZinc Challenges reveals that Nutmeg does perform well on one of these problems, namely, the Spot5 problem. This problem, formalized in the Appendix, only contains Table global constraints, which currently has no linear relaxation. That is, the MIP master problem has no constraints at all.
Contributors to the MiniZinc Challenge submit a model together with a large number of instances to the organizers, who shortlist a few instances based on their difficulty. Ten instances of Spot5 are included in the MiniZinc Challenge but a total of 21 instances are submitted. The final experiment runs all 21 instances in order to confirm results suggesting that Nutmeg performs well on the initial ten instances.
Figure 10 indicates that B&CLP outperforms the other methods on this problem, solving one more instance than B&CMIP. The average optimality gaps of B&CMIP, B&CLP, and MIP on the instances with feasible but not optimal solutions are 58.1%, 43.4%, and 60.4%.
This experiment demonstrates that Nutmeg does indeed have a purpose. In general, decomposable structure is necessary for Nutmeg to perform well. However, even when that structure is not declared, there are problems (albeit few) where the automatic decomposition is useful. These findings suggest that a handtailored implementation of branchandcheck could be worthwhile for the Spot5 problem.
Conclusions and Future Work
LBBD is an important framework for separating a problem into a master problem and one or more subproblems that can be tackled using any technology for which an inference dual is available. The master problem is often MIP and the subproblems CP. Unlike standard Benders decomposition in mathematical programming, LBBD is much more general, and hence, its Benders cuts have no exact form; their form must be invented for every problem, essentially making reuse impossible.
Recently, two teams independently developed CP conflict analysis into a generic procedure for separating Benders cuts in LBBD. The present paper, authored by both teams together, further advances these ideas in a definitive journal version of the earlier conference works. This paper describes the implementation of a new MIP and CP hybrid metasolver named Nutmeg. The solver hybridizes MIP and CP using branchandcheck, a method based on LBBD that tightly connects a MIP master problem and a CP checking subproblem within a single branchandbound search tree. Given an arbitrary highlevel CP problem, Nutmeg automatically derives a MIP relaxation that omits global constraints with weak linear relaxations, and uses the LP relaxation to compute dual bounds, enabling earlier pruning of suboptimal subtrees in comparison with pure CP solvers. Reasoning about individual substructures embedded within global constraints is handled using CP, which generates Benders cuts via conflict analysis. Information about domains and bounds is also passed in both directions.
Nutmeg is evaluated on a variety of problem classes. The results indicate that branchandcheck performs well on problems with decomposable structure that can be nicely separated into MIPpreferred portions and CPpreferred portions (e.g., an Assignment Problem with cumulative scheduling). However, in general, branchandcheck performs poorly on problems lacking this structure. The master problem repeatedly proposes solutions that are simply infeasible because it has no knowledge about the omitted constraints. Nevertheless, Nutmeg solves more instances of the Spot5 problem from the MiniZinc Challenge than pure MIP and pure CP, even though no decomposable structure is available. This result indicates that studying the problem to find a decomposable structure and then developing a handtailored problemspecific solver could be worthwhile.
Calling the checking subproblem on every fractional solution in the branchandbound tree is often slower than calling it only on integer solutions. Presumably, this is because of the large number of fractional solutions feasible in the subproblem and also because every cutting plane internally added by SCIP during the branchandcut search also induces another round of calling the checking subproblem. This leads to an excessive number of calls, which may not generate useful nogoods. Future work should devise better strategies of when to solve the subproblem and for how long.
Nutmeg does not currently divide blockdiagonal structure into multiple independent subproblems, but rather, uses a single monolithic subproblem. Even though there is no benefit in theory due to conflict analysis, solving multiple smaller subproblems is likely to be faster than solving one large subproblem in practice. A lowpriority improvement to the implementation is to add the ability to split the subproblem into several easier subproblems.
Nutmeg’s automatic decomposition relies on its predefined library of rewritings, which is fairly basic at this stage and remains a topic of continuing work. Many of the global constraints currently use an empty linear relaxation, and hence, the MIP master problem receives no information at all, leaving the entire constraint to be considered in the CP subproblem. For the approach to perform well, the number of constraints in the linear relaxation of a difficult global constraint must be few and these constraints must be reasonably tight. One ongoing challenge is to find a good balance between a relaxation that closely resembles the original global constraint and one that does not introduce too many new columns and/or rows into the MIP master problem.
Strengthening cuts is a common technique of branchandcut models of many MIP problems. Usually, the strengthening relies on problemspecific polyhedral analysis absent in general. Problemspecific cuts can be strengthened by recognizing the form of the nogoods and then lifting them as in the existing approaches [25]. A general mechanism to strengthen cuts for arbitrary problems remains an important unanswered question.
Cuts separated by SCIP during the solution process (e.g., knapsack cover cuts) are not transferred to the CP checking subproblem. Since linear constraints do not propagate strongly in CP, these cuts are not expected to have large impact. Future work can consider transferring these cuts and investigating new types of generic (global) constraints that will propagate strongly in CP.
A branchandcheck option can be considered within a parallel portfolio of solvers that includes standalone CP and MIP. Runtime information from the independent runs of the CP and MIP solvers may be able to guide the search towards a better tradeoff, or indeed decide that all effort should be concentrated on a pure CP or pure MIP approach.
It will also be interesting to implement automatic LBBD within other automatic decomposition solvers, such as GCG [15, 16]. GCG can seamlessly reformulate a problem using DantzigWolfe decomposition and solve it using branchandcutandprice. The two main benefits of DantzigWolfe reformulation are that it achieves a tighter linear relaxation and that it completely eliminates symmetries arising from permuting the index of variables. For these two reasons, stateoftheart methods for many Vehicle Routing Problems are based on branchandcutandprice. Conversely, stateoftheart methods for problems with cumulative scheduling are based on CP because their linear relaxations are weak. Connecting Nutmeg with GCG will allow a combination of automatic DantzigWolfe reformulation and automatic LBBD of highlevel models. This should benefit problems like the VRPLC by removing symmetry in the index of the vehicles using DantzigWolfe reformulation and by reasoning across the timing of all routes using propagation.
In conclusion, Nutmeg adds the first hybrid solving option to the many choices of singularapproach solvers available within the MiniZinc modeling system. For inexperienced modelers, Nutmeg enables effortless hybrid solving with one click. For expert modelers, Nutmeg serves as a useful tool for quickly evaluating different structures for LBBD within a userfriendly modeling language.
Data Availability
All problems and instances are either contained within the source code repository of Nutmeg or available at the MiniZinc Challenge website.^{Footnote 2}
References
 1.
Achterberg T (2007) Conflict analysis in mixed integer programming. Discrete Optim 4(1):4–20
 2.
Achterberg T (2009) SCIP: solving constraint integer programs. Math Program Comput 1(1):1–41
 3.
AlbaredaSambola M, Fernández E, Laporte G (2009) The capacity and distance constrained plant location problem. Comput Oper Res 36:597–611
 4.
Beck JC (2010) Checkingup on branchandcheck. In: Cohen D (ed) Principles and practice of constraint programming – CP 2010, lecture notes in computer science, vol 6308. Springer, Berlin, pp 84–98
 5.
Belov G, Stuckey PJ, Tack G, Wallace M (2016) Improved linearization of constraint programming models. In: Rueher M (ed) Principles and practice of constraint programming: 22nd international conference, CP 2016, Toulouse, France, September 59, 2016. proceedings. Springer International Publishing, pp 49–65
 6.
Benchimol P, van Hoeve WJ, Régin JC, Rousseau LM, Rueher M (2012) Improved filtering for weighted circuit constraints. Constraints 17(3):205–233
 7.
Benders JF (1962) Partitioning procedures for solving mixedvariables programming problems. Numerische mathematik 4(1):238–252
 8.
Bensana E, Lemaitre M, Verfaillie G (1999) Earth observation satellite management. Constraints 4(3):293–299
 9.
Chu GG Improving combinatorial optimization. Ph.D. thesis, University of Melbourne (2011). http://hdl.handle.net/11343/36679
 10.
Conforti M, Cornuéjols G, Zambelli G (2014) Integer programming, vol 271. Springer, Berlin
 11.
Davies TO, Gange G, Stuckey PJ (2017) Automatic logicbased Benders decomposition with MiniZinc. In: AAAI, pp 787–793
 12.
Feydy T, Stuckey PJ (2009) Lazy clause generation reengineered. In: Gent IP (ed) Principles and practice of constraint programming – CP 2009: 15th international conference, CP 2009 lisbon, portugal, september 2024, 2009 proceedings. Springer, Berlin, pp 352–366
 13.
Focacci F, Lodi A, Milano M (2002) Optimizationoriented global constraints. Constraints 7(34):351–365
 14.
Fontaine D, Michel L, Van Hentenryck P (2014) Constraintbased Lagrangian relaxation. In: O’sullivan B (ed) Principles and practice of constraint programming: 20th international conference, CP 2014, Lyon, France, September 812, 2014. proceedings. lecture notes in computer science, vol 8656. Springer International Publishing, pp 324–339
 15.
Gamrath G (2010) Generic branchcutandprice. Ph.D. thesis, Technische Universität Berlin
 16.
Gamrath G, Lübbecke ME (2010) Experiments with a generic DantzigWolfe decomposition for integer programs. In: Festa P, Experimental algorithms: 9th international symposium SEA 2010 Ischia Island (eds). Springer, Berlin, pp 239–252
 17.
Gange G, Berg J, Demirović E, Stuckey PJ (2020) Coreguided and coreboosted search for CP. In: Proceedings of the 7th international conference on the integration of constraint programming, artificial intelligence, and operations research. (to appear)
 18.
Gleixner A, Bastubbe M, Eifler L, Gally T, Gamrath G, Gottwald RL, Hendel G, Hojny C, Koch T, Lübbecke ME, Maher SJ, Miltenberger M, Müller B, Pfetsch ME, Puchert C, Rehfeldt D, Schlösser F, Schubert C, Serrano F, Shinano Y, Viernickel JM, Walter M, Wegscheider F, Witt JT, Witzig J (2018) The SCIP Optimization Suite 6.0. ZIBReport 1826, Zuse Institute Berlin. http://nbnresolving.de/urn:nbn:de:0297zib69361
 19.
Hooker JN (2004) A hybrid method for planning and scheduling. In: Wallace M (ed) Principles and practice of constraint programming – CP 2004, lecture notes in computer science, vol 3258. Springer, Berlin, pp 305–316
 20.
Hooker JN (2007) Planning and scheduling by logicbased Benders decomposition. Oper Res 55(3):588–602
 21.
Hooker JN, Ottosson G (2003) Logicbased Benders decomposition. Math Program 96(1):33–60
 22.
Junker U, Karisch SE, Kohl N, Vaaben B, Fahle T, Sellmann M (1999) A framework for constraint programming based column generation. In: Jaffar J (ed) Principles and practice of constraint programming – CP’99: 5th international conference, CP’99, alexandria, VA, USA, October 1114, 1999. Proceedings. Springer, pp 261–274
 23.
Lam E (2017) Hybrid optimization of vehicle routing problems. Ph.D. thesis, University of Melbourne. http://hdl.handle.net/11343/220534
 24.
Lam E, Van Hentenryck P (2016) A branchandpriceandcheck model for the vehicle routing problem with location congestion. Constraints 21 (3):394–412
 25.
Lam E, Van Hentenryck P (2017) Branchandcheck with explanations for the vehicle routing problem with time windows. In: Beck JC (ed) Principles and practice of constraint programming: 23rd international conference, CP 2017, Melbourne, VIC, Australia, August 28 – September 1, 2017, Proceedings. Springer, Cham, pp 579–595
 26.
Marques Silva JaP, Sakallah KA (1996) GRASP–a new search algorithm for satisfiability. In: Proceedings of the 1996 IEEE/ACM international conference on computeraided design, ICCAD ’96. IEEE Computer Society, pp 220–227
 27.
Nethercote N, Stuckey PJ, Becket R, Brand S, Duck GJ, Tack G (2007) Minizinc: towards a standard CP modelling language. In: Bessière C (ed) Principles and practice of constraint programming – CP 2007. Springer, Berlin, pp 529–543
 28.
Ohrimenko O, Stuckey PJ, Codish M (2009) Propagation via lazy clause generation. Constraints 14(3):357–391
 29.
Refalo P (2000) Linear formulation of constraint programming models and hybrid solvers. In: Dechter R (ed) Principles and practice of constraint programming – CP 2000. Springer, Berlin, pp 369–383
 30.
Régin JC (2002) Costbased arc consistency for global cardinality constraints. Constraints 7(3):387–405
 31.
Schutt A, Feydy T, Stuckey PJ, Wallace MG (2010) Explaining the cumulative propagator. Constraints 16(3):250–282
 32.
Shen K, Schimpf J (2005) Eplex: Harnessing mathematical programming solvers for constraint logic programming. In: Principles and practice of constraint programming: 11th international conference, CP2005, proceedings, LNCS, vol 3709. Springer, pp 622–636
 33.
Steiger R, van Hoeve WJ, Szymanek R (2011) An efficient generic network flow constraint. In: Proceedings of the 2011 ACM symposium on applied computing. ACM, pp 893–900
 34.
Taşkin ZC (2010) Benders decomposition. In: Wiley encyclopedia of operations research and management science. Wiley
 35.
Thorsteinsson E (2001) Branchandcheck: a hybrid framework integrating mixed integer programming and constraint logic programming. In: Walsh T (ed) Principles and practice of constraint programming – CP. lecture notes in computer science, vol 2239. Springer, Berlin, pp 16–30
Acknowledgments
We would like to thank the two anonymous reviewers whose comments have substantially improved this paper.
Author information
Affiliations
Corresponding author
Ethics declarations
Conflict of Interest
The authors declare that they have no conflict of interest.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Code Availability
The source code of Nutmeg is made available at the first author’s website.^{Footnote 1}
Appendices
Appendix:
This appendix presents several models used in the experiments.
Capacity and DistanceConstrained Plant Location Problem
The Capacity and Distanceconstrained Plant Location Problem (CDCPLP) is proposed in [3]. This problem considers a set \(\mathcal {F}\) of facilities. Every facility \(f \in \mathcal {F}\) is initially closed but can be opened at a cost \(w^{\text {open}}_{f} \in \mathbb {Z}_{+}\). Let o_{f} ∈{0, 1} be a binary variable indicating whether facility \(f \in \mathcal {F}\) is opened.
Let \(\mathcal {C}\) be the set of customers, each of which must be assigned to an opened facility. Assigning customer \(c \in \mathcal {C}\) to facility \(f \in \mathcal {F}\) incurs a cost \(w^{\text {assign}}_{c,f} \in \mathbb {Z}_{+}\). Let x_{c,f} ∈{0, 1} be a binary variable indicating whether customer \(c \in \mathcal {C}\) is assigned to facility \(f \in \mathcal {F}\). Every customer \(c \in \mathcal {C}\) requires \(d_{c} \in \mathbb {Z}_{+}\) of demand. Each facility \(f \in \mathcal {F}\) can support up to \(D_{f} \in \mathbb {Z}_{+}\) of demand.
Customers assigned to a facility receive deliveries from trucks stationed at the facility. Allow up to \(T \in \mathbb {Z}_{+}\) trucks to be stationed at a facility, and let \(\mathcal {T} = \{ 1,\ldots ,T \}\) be the set of trucks. Let \(t_{c} \in \mathcal {T}\) be an integer variable for the number of the truck assigned to customer \(c \in \mathcal {C}\). Define \(q_{c,f} \in \mathbb {Z}_{+}\) as the distance from facility \(f \in \mathcal {F}\) to customer \(c \in \mathcal {C}\) and back. Each truck can carry the goods of only one customer at a time, and can travel up to \(Q \in \mathbb {Z}_{+}\) in total distance. Let \(n_{f} \in \mathcal {T}\) be an integer variable for the total number of trucks required at facility \(f \in \mathcal {F}\). Every truck kept at facility \(f \in \mathcal {F}\) incurs a cost \(w^{\text {truck}}_{f} \in \mathbb {Z}_{+}\).
The model is shown in Fig. 11. Objective Function (7a) minimizes the total cost of (1) opening facilities, (2) assigning customers to facilities, and (3) keeping trucks at facilities. Constraint (7b) opens a facility if it is assigned customers. This constraint also limits the number of customers assigned to a facility according to its maximum demand. Constraint (7c) assigns customers to trucks stationed at a facility while considering the total travel distance of each truck. Constraint (7d) calculates the number of trucks used at a facility.
Constraints (7e) and (7f) are redundant constraints, which improve the propagation. Constraint (7e) bounds the number of trucks required at a facility. Constraint (7f) limits the number of customers assigned to a facility. Constraints (7g) to (7j) give the variable domains.
Vehicle Routing Problem with Location Congestion
The Vehicle Routing Problem with Location Congestion (VRPLC) is introduced in [24]. The problem tasks a set of vehicles to deliver goods from a central depot to various locations subject to vehicle constraints and location constraints.
Let \(\mathcal {R}\) be the set of requests to be delivered. Let ⊥ denote the depot, and let \(\mathcal {N} = \mathcal {R} \cup \{ \bot \}\). Let \({\mathscr{L}}\) be the set of locations. Every request \(i \in \mathcal {R}\) must be delivered to location \(l_{i} \in {\mathscr{L}}\). Let \(\mathcal {R}_{l} = \{ i \in \mathcal {R}  l_{i} = l \}\) be the requests to be delivered to location \(l \in {\mathscr{L}}\). The key difference to standard Vehicle Routing Problems is the inclusion of location scheduling constraints. Every location l has a limited number \(C_{l} \in \mathbb {Z}_{+}\) of equipment for unloading a vehicle. Therefore, deliveries must be scheduled around the availability of the equipment.
Let \(T \in \mathbb {Z}_{+}\) be the time horizon. All deliveries must be completed and all vehicles must return to the depot before T. The problem also considers the usual vehicle capacity and time window constraints. Every request \(i \in \mathcal {N}\) has weight \(q_{i} \in \mathbb {Z}_{+}\) (q_{⊥} = 0) and every vehicle can carry up to \(Q \in \mathbb {Z}_{+}\) in weight. Delivery \(i \in \mathcal {N}\) must begin after \(a_{i} \in \mathbb {Z}_{+}\) (a_{⊥} = 0) and before \(b_{i} \in \mathbb {Z}_{+}\) (b_{⊥} = T). Performing delivery \(i \in \mathcal {R}\) uses one piece of equipment at l_{i} for \(s_{i} \in \mathbb {Z}_{+}\) time.
Let \(\mathcal {A} = \mathcal {N} \times \mathcal {N} \setminus \{ (i,i)  i \in \mathcal {N} \}\) denote the arcs. Define x_{i,j} as a binary variable indicating whether a vehicle travels along arc \((i,j) \in \mathcal {A}\). Traveling along (i,j) consumes \(c_{i,j} \in \mathbb {Z}_{+}\) time. Define a variable w_{i} for the total weight delivered after \(i \in \mathcal {N}\) along a route, and define a variable t_{i} for the time of starting delivery \(i \in \mathcal {N}\). The model is presented in Fig. 12. Objective Function (8a) minimizes the total travel time. Constraints (8b) and (8c) require every request to be delivered. Constraint (8d) limits the total weight onboard a vehicle. Constraint (8e) enforces the travel time between two deliveries. Constraint (8f) schedules the requests at locations. Constraints (8g) to (8i) give the variable domains.
Spot5
The Spot5 problem is proposed in [8]. The problem concerns one of the SPOT commercial imaging satellites, specifically, the fifth satellite. Given a set of images purchased by clients, the Spot5 problem decides on a subset of images to capture in the next day, subject to operational constraints, such as the availability of imaging instruments and sufficient transition time between two successive images.
The satellite has three imaging instruments labeled 1, 2, and 3 from left to right. Let I be the set of purchased images, and let x_{i} be an integer variable storing the instruments that will capture image i ∈ I. An image i can be postponed (x_{i} = 0) or captured using a predetermined subset of compatible instruments: left only (x_{i} = 1), middle only (x_{i} = 2), right only (x_{i} = 3), or both left and right (x_{i} = 13) for stereoscopic images. Let D = {{0, 2},{0, 13},{0, 1, 2, 3}}, and let D_{i} ∈ D be the set of possible instruments for capturing image i, i.e., the domain of x_{i}. Every image i not captured is penalized by a cost \(c_{i} \in \mathbb {Z}_{+}\).
The problem uses the Table global constraint. Given a vector \(\mathbf {p} \in \mathbb {Z}^{n}\) with length n and a set \(P \subset \mathbb {Z}^{n}\) of vectors with length n, the constraint Table(p,P) states that p ∈ P. Put simply, the constraint requires p to be equal to a row in a table with rows P.
The problem contains Table constraints that define compatibility between two images, called binary constraints, and constraints stating compatibility between three images, called ternary constraints. Let \(\mathcal {A}\) be the set of binary constraints, where each constraint \(a \in \mathcal {A}\) is associated with two images u_{a},v_{a} ∈ I and a compatibility table T_{a} ⊂ D × D. Let \({\mathscr{B}}\) be the set of ternary constraints, where each constraint \(b \in {\mathscr{B}}\) is associated with three images u_{b},v_{b},w_{b} ∈ I and a compatibility table T_{b} ⊂ D × D × D.
The model is now presented in Fig. 13. Objective Function (9a) penalizes postponed images. Constraints (9b) and (9c) define compatible images. Constraint (9d) gives the variable domains.
Rights and permissions
About this article
Cite this article
Lam, E., Gange, G., Stuckey, P.J. et al. Nutmeg: a MIP and CP Hybrid Solver Using BranchandCheck. SN Oper. Res. Forum 1, 22 (2020). https://doi.org/10.1007/s43069020000232
Received:
Accepted:
Published:
Keywords
 Mixed integer programming
 Constraint programming
 Hybridization
 Branchandcheck
 Logicbased Benders decomposition
 Conflict analysis
 Nogood
 Lazy clause generation
 Linear constraints
 Dual bound