Nutmeg: a MIP and CP Hybrid Solver Using Branch-and-Check


This paper describes the implementation of Nutmeg, a solver that hybridizes mixed integer linear programming and constraint programming using the branch-and-cut style of logic-based Benders decomposition known as branch-and-check. Given a high-level 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 branch-and-bound 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 logic-based 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 hand-tailored 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 logic-based Benders decompositions of their problems.


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 worst-case 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 high-level 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 state-of-the-art 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. High-performance 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 right-hand 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. Logic-based 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 problem-specific. 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 high-level 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 side-by-side in a single branch-and-bound 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. Problem-specific CP solvers have implemented dual bounds using a variety of methods, including global optimization constraints [13], Lagrangian relaxation [6, 14], Dantzig-Wolfe 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 finite-domain 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 branch-and-cut solver is built for the Vehicle Routing Problem with Time Windows. It passes every LP solution in the branch-and-bound tree to the CP solver. Borrowing terminology from earlier works [4, 35], the algorithm was named branch-and-check with explanations. The solver found cuts identical to problem-specific 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 problem-specific cuts that have never before appeared in the literature.

Even though the results of [11, 25] are peer-reviewed, their codes are not intended for general use. The solver of [25] is problem-specific, and the system from [11] requires hand-tuning 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.


This section presents several concepts necessary for the discourse in the remainder of the paper.

Logic-Based 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 = (x1,…,xn) and y = (y1,…,ym), 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 x1 over the intersection of some linear constraints A1xb1 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:

$$ \begin{array}{lllll} & \min & & x_{1} \\ & \text{subject to} \enskip\ & & A_{1} \mathbf{x} \leq \mathbf{b}_{1}, \\ & & & (\mathbf{x},\mathbf{y}) \in S, \\ & & & \mathbf{x} \in D_{\mathbf{x}}, \\ & & & \mathbf{y} \in D_{\mathbf{y}}. \end{array} $$

Define the MIP master problem \({\mathscr{M}}\) of \(\mathcal {P}\) as:

$$ \begin{array}{lllll} & \min & & x_{1} \\ & \text{subject to} \enskip\ & & A_{1} \mathbf{x} \leq \mathbf{b}_{1}, \\ & & & A_{2} \mathbf{x} \leq \mathbf{b}_{2}, \\ & & & \mathbf{x} \in D_{\mathbf{x}}, \end{array} $$

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 A2xb2 are said to be a relaxation of S. Since Dx 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}\):

$$ \begin{array}{lllll} & \min & & 0 \\ & \text{subject to} \enskip\ & & A_{1} \mathbf{x} \leq \mathbf{b}_{1}, \\ & & & (\mathbf{x},\mathbf{y}) \in S, \\ & & & \mathbf{x} \in D_{\mathbf{x}}, \\ & & & \mathbf{y} \in D_{\mathbf{y}}. \end{array} $$

Notice that A1xb1 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 branch-and-cut form of LBBD, called branch-and-check, 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

$$ A_{\hat{\mathbf{x}}} \mathbf{x} \leq \mathbf{b}_{\hat{\mathbf{x}}} $$

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}\).

Fig. 1

The basic LBBD algorithm

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 problem-specific. 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 xi = 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 ri machines from time si to time si + di − 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

$$ \underset{i \in \mathcal{I}}{\sum} r_{i} \cdot d_{i} \cdot x_{i} \leq C \cdot T, $$

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 si. 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 ri = 2 machines, has a duration of di = 3, and must start between time 1 and 2, i.e., si ∈{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.

Fig. 2

An example of the energy relaxation of the CumulativeOptional constraint

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 xj,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 xj,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.

Fig. 3

The Planning and Scheduling problem

Fig. 4

The MIP master problem in an LBBD of the Planning and Scheduling problem

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 job-facility pairs taking value 1. Whenever the CP subproblem detects that \(\hat {\mathbf {x}}\) is infeasible, Constraint (1) is realized as the inequality

$$ {\underset{(j,f) \in 1_{\hat{\mathbf{x}}}}{\sum}} x_{j,f} \leq |1_{\hat{\mathbf{x}}}| - 1. $$

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 non-trivial 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 xk, xk and xk that respectively indicate whether xk, xk and xk. These binary indicator variables are called literals. Notice that xk = 1 −x = k and xk = 1 −xk + 1. Therefore, only some of these literals need to be considered explicitly.

For a problem with \(I \in \mathbb {Z}_{+}\) integer variables x1,…,xI, a bound disjunction constraint is a disjunction of literals of the form:

$$ {\underset{(i,k) \in L_{\geq}}{\bigvee}} \llbracket {x_{i} \geq k} \rrbracket \ \vee \ {\underset{(i,k) \in L_{\leq}}{\bigvee}} \llbracket {x_{i} \leq k} \rrbracket, $$

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 xi 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.


Constraint (5) can simply be propagated exactly like in CP. Upon selecting the next node to solve in the branch-and-bound 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:

$$ {\underset{(i,k) \in L_{\geq}}{\sum}} \llbracket {x_{i} \geq k} \rrbracket + {\underset{(i,k) \in L_{\leq}}{\sum}} \llbracket {x_{i} \leq k} \rrbracket \geq 1. $$

The literals xik and xik must also appear in the model. They are added as binary variables, together with the indicator constraints:

$$ \begin{array}{@{}rcl@{}} \llbracket {x_{i} \geq k} \rrbracket& = 1 & \rightarrow x_{i} \geq k, \\ \llbracket {x_{i} \geq k} \rrbracket &= 0 & \rightarrow x_{i} \leq k-1, \\ \llbracket {x_{i} \leq k} \rrbracket &= 1 & \rightarrow x_{i} \leq k, \\ \llbracket {x_{i} \leq k} \rrbracket &= 0 & \rightarrow x_{i} \geq k+1. \end{array} $$

Indicator constraints themselves can be implemented using either a big-M constraint or an inequality and an SOS1 constraint. Indicator constraints are well-established 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 xi in Constraint (6) is added as equality literals, along with constraints that link the literals to the originating integer variable:

$$ \begin{array}{@{}rcl@{}} x_{i} &=& { \underset{k \in D_{x_{i}}}{\sum} } k \cdot \llbracket {x_{i} = k} \rrbracket, \\ && \underset{k \in D_{x_{i}}}{\sum} \llbracket {x_{i} = k} \rrbracket = 1. \end{array} $$

Constraint (6) is added to the model after substituting:

$$ \begin{array}{@{}rcl@{}} \llbracket {x_{i} \leq k} \rrbracket & =& { \underset{j \in D_{x_{i}} \cap \{ -\infty,\ldots,k \}}{\sum} } \llbracket {x_{i} = j} \rrbracket, \\ \llbracket {x_{i} \geq k} \rrbracket & =& { \underset{j \in D_{x_{i}} \cap \{ k,\ldots,\infty \}}{\sum} } \llbracket {x_{i} = j} \rrbracket. \end{array} $$

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 decomposition-based 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 = a1 ∧… ∧ an, where a1,…,an 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

$$ \neg {\underset{a \in A'}{\bigwedge}} a $$

or equivalently,

$$ {\underset{a \in A'}{\bigvee}} \neg a. $$

The advantage of the assumptions approach is that the problem \(\mathcal {C}\) can be re-solved 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 re-exploring 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.

Branch-and-Check in Nutmeg

This section presents the implementation of Nutmeg.

Underlying Solvers

Nutmeg is a meta-solver that implements a generalization of the branch-and-check 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 state-of-the-art 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 pre-defined library of rewritings to add linear constraints A2xb2 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 high-level \(\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 = (x1,…,xI) of \(I \in \mathbb {Z}_{+}\) integer variables, AllDifferent(x) permits each value to be assigned to at most one of x1,…,xI. Let \(\mathcal {I} = \{ 1,\ldots ,I \}\). The linearization of AllDifferent(x) is

$$ \underset{i \in \mathcal{I}}{\sum} \llbracket {x_{i} = k} \rrbracket \leq 1 \quad\quad\quad \forall k \in { \underset{i \in \mathcal{I}}{\bigcup} } D_{x_{i}}, $$

where \(D_{x_{i}}\) is the domain of xi. Since this linearization is very tight, it is likely worthwhile to include the entire linearization in \({\mathscr{M}}\). Nutmeg creates every literal xi = k as a binary variable in \({\mathscr{M}}\). These literals are then connected to the originating variable xi in \(\mathcal {C}\). If the integer variable xi 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 non-trivial.

The Branch-and-Check Algorithm

Nutmeg solves \({\mathscr{M}}\) and \(\mathcal {C}\) using the branch-and-cut form of LBBD known as branch-and-check [4, 35]. The key difference to branch-and-cut 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 branch-and-check 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.

Fig. 5

The branch-and-check algorithm

A subtlety here is that primal and dual bounds are applied to the objective variable (i.e., x1 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 A1xb1 is included in the CP subproblem even though it already exists in the MIP master problem. Consider the constraint 2x1 + x2 ≤ 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 ≤ x1 ≤ 1 and 0 ≤ x2 ≤ 1. Explicitly including the constraint in the CP subproblem will propagate x1 ≤ 0, and hence, fix x1 = 0.

As defined, the branch-and-check 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.


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.

Fig. 6

The procedure for adding a nogood to the MIP master problem

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 SAT-style 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

$$ \llbracket {x_{1,1} = 0} \rrbracket \vee \llbracket {x_{2,1} = 0} \rrbracket, $$

which is added to the MIP master problem as the row

$$ (1 - x_{1,1}) + (1 - x_{2,1}) \geq 1, $$

or equivalently, as the clique constraint

$$ x_{1,1} + x_{2,1} \leq 1. $$

This constraint is incompatible with Constraint (3c), enabling the MIP solver to declare that the problem is infeasible.

Block-Diagonal Structure

In mathematical programming decompositions (e.g., Dantzig-Wolfe or Benders), block-diagonal 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 branch-and-check against pure CP and pure MIP. Two variants of branch-and-check are tested: (1) B&C-LP 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&C-MIP runs the CP checking subproblem only at integer solutions. The standalone approaches use the same solvers, specifically, Geas and SCIP. All solvers are single-threaded and are run for ten minutes on an Intel Xeon E5-2660 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 Distance-constrained 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 distance-limited 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&C-MIP solves the most instances, followed by MIP. B&C-LP solves one-third the number of instances solved by B&C-MIP. On the instances with feasible but not provably optimal solutions, B&C-MIP, B&C-LP, 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.)

Fig. 7

Cumulative number of instances solved over time for each problem in the first experiment. Higher is better

On P&S, the two branch-and-check methods are essentially identical, solving many more instances than the standalone methods. B&C-MIP, B&C-LP, 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 branch-and-check gets stuck within the CP subproblem, resulting in a 100% optimality gap, which skews these statistics in favor of MIP.

On VRPLC, the two branch-and-check 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&C-MIP, B&C-LP, and MIP.

These results suggest that B&C-MIP dominates B&C-LP. Presumably, this is due to the large number of calls asking the subproblem to check fractional solutions that are CP-feasible, 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 CP-preferred 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&C-MIP, B&C-LP, and MIP. Again, MIP finds bounds tighter than branch-and-check on average because branch-and-check gets trapped within the CP subproblem on some instances, resulting in a gap of 100%. For VRPLC, the instances are trivial for CP. B&C-MIP, B&C-LP, 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 branch-and-check master problem has little information for optimizing the objective after moving the scheduling constraints into the subproblem.

Fig. 8

Cumulative number of instances solved over time for each problem in the second experiment. Higher is better

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 branch-and-check performs poorly without appropriate structure. Branch-and-check 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&C-MIP, B&C-LP, 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%).

Fig. 9

Cumulative number of instances solved over time in the third experiment. Higher is better


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&C-LP outperforms the other methods on this problem, solving one more instance than B&C-MIP. The average optimality gaps of B&C-MIP, B&C-LP, and MIP on the instances with feasible but not optimal solutions are 58.1%, 43.4%, and 60.4%.

Fig. 10

Cumulative number of instances solved over time in the fourth experiment. Higher is better

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 hand-tailored implementation of branch-and-check 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 re-use 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 meta-solver named Nutmeg. The solver hybridizes MIP and CP using branch-and-check, a method based on LBBD that tightly connects a MIP master problem and a CP checking subproblem within a single branch-and-bound search tree. Given an arbitrary high-level 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 branch-and-check performs well on problems with decomposable structure that can be nicely separated into MIP-preferred portions and CP-preferred portions (e.g., an Assignment Problem with cumulative scheduling). However, in general, branch-and-check 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 hand-tailored problem-specific solver could be worthwhile.

Calling the checking subproblem on every fractional solution in the branch-and-bound 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 branch-and-cut 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 block-diagonal 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 low-priority improvement to the implementation is to add the ability to split the subproblem into several easier subproblems.

Nutmeg’s automatic decomposition relies on its pre-defined 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 branch-and-cut models of many MIP problems. Usually, the strengthening relies on problem-specific polyhedral analysis absent in general. Problem-specific 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 branch-and-check option can be considered within a parallel portfolio of solvers that includes standalone CP and MIP. Run-time information from the independent runs of the CP and MIP solvers may be able to guide the search towards a better trade-off, 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 Dantzig-Wolfe decomposition and solve it using branch-and-cut-and-price. The two main benefits of Dantzig-Wolfe 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, state-of-the-art methods for many Vehicle Routing Problems are based on branch-and-cut-and-price. Conversely, state-of-the-art 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 Dantzig-Wolfe reformulation and automatic LBBD of high-level models. This should benefit problems like the VRPLC by removing symmetry in the index of the vehicles using Dantzig-Wolfe 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 singular-approach 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 user-friendly 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


  1. 1.

  2. 2.


  1. 1.

    Achterberg T (2007) Conflict analysis in mixed integer programming. Discrete Optim 4(1):4–20

    Article  Google Scholar 

  2. 2.

    Achterberg T (2009) SCIP: solving constraint integer programs. Math Program Comput 1(1):1–41

    Article  Google Scholar 

  3. 3.

    Albareda-Sambola M, Fernández E, Laporte G (2009) The capacity and distance constrained plant location problem. Comput Oper Res 36:597–611

    Article  Google Scholar 

  4. 4.

    Beck JC (2010) Checking-up on branch-and-check. 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. 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 5-9, 2016. proceedings. Springer International Publishing, pp 49–65

  6. 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

    Article  Google Scholar 

  7. 7.

    Benders JF (1962) Partitioning procedures for solving mixed-variables programming problems. Numerische mathematik 4(1):238–252

    Article  Google Scholar 

  8. 8.

    Bensana E, Lemaitre M, Verfaillie G (1999) Earth observation satellite management. Constraints 4(3):293–299

    Article  Google Scholar 

  9. 9.

    Chu GG Improving combinatorial optimization. Ph.D. thesis, University of Melbourne (2011).

  10. 10.

    Conforti M, Cornuéjols G, Zambelli G (2014) Integer programming, vol 271. Springer, Berlin

    Google Scholar 

  11. 11.

    Davies TO, Gange G, Stuckey PJ (2017) Automatic logic-based Benders decomposition with MiniZinc. In: AAAI, pp 787–793

  12. 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 20-24, 2009 proceedings. Springer, Berlin, pp 352–366

  13. 13.

    Focacci F, Lodi A, Milano M (2002) Optimization-oriented global constraints. Constraints 7(3-4):351–365

    Article  Google Scholar 

  14. 14.

    Fontaine D, Michel L, Van Hentenryck P (2014) Constraint-based Lagrangian relaxation. In: O’sullivan B (ed) Principles and practice of constraint programming: 20th international conference, CP 2014, Lyon, France, September 8-12, 2014. proceedings. lecture notes in computer science, vol 8656. Springer International Publishing, pp 324–339

  15. 15.

    Gamrath G (2010) Generic branch-cut-and-price. Ph.D. thesis, Technische Universität Berlin

    Google Scholar 

  16. 16.

    Gamrath G, Lübbecke ME (2010) Experiments with a generic Dantzig-Wolfe decomposition for integer programs. In: Festa P, Experimental algorithms: 9th international symposium SEA 2010 Ischia Island (eds). Springer, Berlin, pp 239–252

  17. 17.

    Gange G, Berg J, Demirović E, Stuckey PJ (2020) Core-guided and core-boosted search for CP. In: Proceedings of the 7th international conference on the integration of constraint programming, artificial intelligence, and operations research. (to appear)

  18. 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. ZIB-Report 18-26, Zuse Institute Berlin.

  19. 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. 20.

    Hooker JN (2007) Planning and scheduling by logic-based Benders decomposition. Oper Res 55(3):588–602

    Article  Google Scholar 

  21. 21.

    Hooker JN, Ottosson G (2003) Logic-based Benders decomposition. Math Program 96(1):33–60

    Article  Google Scholar 

  22. 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 11-14, 1999. Proceedings. Springer, pp 261–274

  23. 23.

    Lam E (2017) Hybrid optimization of vehicle routing problems. Ph.D. thesis, University of Melbourne.

  24. 24.

    Lam E, Van Hentenryck P (2016) A branch-and-price-and-check model for the vehicle routing problem with location congestion. Constraints 21 (3):394–412

    Article  Google Scholar 

  25. 25.

    Lam E, Van Hentenryck P (2017) Branch-and-check 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. 26.

    Marques Silva JaP, Sakallah KA (1996) GRASP–a new search algorithm for satisfiability. In: Proceedings of the 1996 IEEE/ACM international conference on computer-aided design, ICCAD ’96. IEEE Computer Society, pp 220–227

  27. 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. 28.

    Ohrimenko O, Stuckey PJ, Codish M (2009) Propagation via lazy clause generation. Constraints 14(3):357–391

    Article  Google Scholar 

  29. 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. 30.

    Régin JC (2002) Cost-based arc consistency for global cardinality constraints. Constraints 7(3):387–405

    Article  Google Scholar 

  31. 31.

    Schutt A, Feydy T, Stuckey PJ, Wallace MG (2010) Explaining the cumulative propagator. Constraints 16(3):250–282

    Article  Google Scholar 

  32. 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. 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. 34.

    Taşkin ZC (2010) Benders decomposition. In: Wiley encyclopedia of operations research and management science. Wiley

  35. 35.

    Thorsteinsson E (2001) Branch-and-check: 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

Download references


We would like to thank the two anonymous reviewers whose comments have substantially improved this paper.

Author information



Corresponding author

Correspondence to Edward Lam.

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



This appendix presents several models used in the experiments.

Capacity- and Distance-Constrained Plant Location Problem

The Capacity- and Distance-constrained 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 of ∈{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 xc,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.

Fig. 11

The high-level model of the CDCPLP

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 li 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 xi,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 wi for the total weight delivered after \(i \in \mathcal {N}\) along a route, and define a variable ti 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 on-board 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.

Fig. 12

The high-level model of the VRPLC


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 xi be an integer variable storing the instruments that will capture image iI. An image i can be postponed (xi = 0) or captured using a predetermined subset of compatible instruments: left only (xi = 1), middle only (xi = 2), right only (xi = 3), or both left and right (xi = 13) for stereoscopic images. Let D = {{0, 2},{0, 13},{0, 1, 2, 3}}, and let DiD be the set of possible instruments for capturing image i, i.e., the domain of xi. 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 pP. 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 ua,vaI and a compatibility table TaD × D. Let \({\mathscr{B}}\) be the set of ternary constraints, where each constraint \(b \in {\mathscr{B}}\) is associated with three images ub,vb,wbI and a compatibility table TbD × 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.

Fig. 13

The high-level model of the Spot5 problem

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Lam, E., Gange, G., Stuckey, P.J. et al. Nutmeg: a MIP and CP Hybrid Solver Using Branch-and-Check. SN Oper. Res. Forum 1, 22 (2020).

Download citation


  • Mixed integer programming
  • Constraint programming
  • Hybridization
  • Branch-and-check
  • Logic-based Benders decomposition
  • Conflict analysis
  • Nogood
  • Lazy clause generation
  • Linear constraints
  • Dual bound