Global Optimization
Find global optima in nonconvex problems
In This Path
- Convex vs. Nonconvex Optimization 25 min
- Introduction to MINLP 30 min
- Spatial Branch-and-Bound 45 min
- Convexification and Relaxations 40 min
- Outer Approximation 35 min
- Bonmin and Couenne in Practice 40 min
This path brings together MIP and NLP to tackle the hardest class of optimization problems: finding global optima when the problem is nonconvex. You'll learn why local methods can get stuck, how spatial branch-and-bound guarantees global optimality, and how solvers like Bonmin and Couenne make this practical.
Prerequisites
You should have completed:
- MIP Journey โ Branch-and-bound, cutting planes, LP relaxations
- Nonlinear Optimization โ Newton's method, interior point, KKT conditions
Or be comfortable with:
- Branch-and-bound trees and bounding
- Nonlinear optimization and KKT conditions
- Why convexity matters for optimization
1. Convex vs. Nonconvex Optimization
The distinction between convex and nonconvex problems is the fundamental divide in optimization.
What is Convexity?
A function $f: \mathbb{R}^n \to \mathbb{R}$ is convex if: $$f(\lambda x + (1-\lambda) y) \leq \lambda f(x) + (1-\lambda) f(y) \quad \forall x, y, ; \lambda \in [0,1]$$
Visually: the line segment between any two points on the graph lies above the graph.
The Golden Property of Convexity
For convex problems, every local minimum is a global minimum.
This means any descent algorithm that finds a local optimum has solved the problem completely. Newton's method, gradient descent, interior point โ they all work reliably on convex problems.
Examples
| Convex | Nonconvex |
|---|---|
| $x^2$ | $\sin(x)$ |
| $e^x$ | $x^2 - x^4$ |
| $|x|$ | $x_1 x_2$ (bilinear) |
| LP, QP (with PSD $Q$) | General polynomials |
The Nonconvex Challenge
For nonconvex problems:
- Multiple local minima exist
- Local methods find a local minimum, not the global minimum
- No polynomial-time algorithm is known (NP-hard in general)
In COIN-OR:
- Ipopt finds local optima (assumes convexity or accepts local solutions)
- Bonmin handles convex MINLP (integer + convex nonlinear)
- Couenne handles nonconvex MINLP (global optimization)
2. Introduction to MINLP
Mixed-Integer Nonlinear Programming (MINLP) combines the challenges of MIP and NLP:
$$\min_{x,y} \quad f(x, y)$$ $$\text{s.t.} \quad g(x, y) \leq 0$$ $$\quad\quad h(x, y) = 0$$ $$\quad\quad x \in \mathbb{R}^n, ; y \in \mathbb{Z}^p$$
Where $f$, $g$, and $h$ may be nonlinear.
Why MINLP?
Real problems often have both:
- Discrete decisions: Build a reactor or not, choose among designs
- Nonlinear physics: Chemical equilibria, pressure-flow relations, economies of scale
The MINLP Landscape
| Problem Class | Difficulty | Solvers |
|---|---|---|
| LP | Polynomial | Clp, simplex |
| Convex NLP | Polynomial | Ipopt, interior point |
| MIP (linear) | NP-hard | Cbc, branch-and-cut |
| Convex MINLP | NP-hard | Bonmin |
| Nonconvex MINLP | Very hard | Couenne, SCIP, BARON |
Nonconvex MINLP is the hardest class โ it combines combinatorial explosion (integers) with nonconvexity (local optima).
Applications
- Process design: Chemical plant configuration with physics constraints
- Network design: Routing with nonlinear costs
- Pooling problems: Blending with quality constraints
- Unit commitment: Power generation scheduling
3. Spatial Branch-and-Bound
Standard branch-and-bound branches on integer variables. Spatial branch-and-bound extends this to branch on continuous variables too โ enabling global optimization of nonconvex problems.
The Key Idea
For nonconvex problems, LP relaxation isn't enough. Even with integer variables fixed, the nonlinear relaxation may have multiple local optima.
Solution: Branch on continuous variables to partition the domain until the problem becomes "easy enough" to solve globally.
The Algorithm
Initialize:
- Root node = original problem
- Global upper bound = +โ (best solution found)
- Global lower bound = -โ (best possible)
While nodes remain:
1. SELECT a node
2. SOLVE a convex relaxation (underestimator of the original)
3. If relaxation infeasible: PRUNE
4. If relaxation bound โฅ upper bound: PRUNE
5. If solution is feasible for original problem:
UPDATE upper bound
PRUNE
6. Else:
Choose variable to BRANCH (integer or continuous)
Create children with tighter bounds
Continuous Branching
For a continuous variable $x_j$ with bounds $[l_j, u_j]$, branch at some point $\hat{x}_j$:
- Left child: $x_j \in [l_j, \hat{x}_j]$
- Right child: $x_j \in [\hat{x}_j, u_j]$
Why this helps: Tighter bounds โ tighter convex relaxations โ better lower bounds โ more pruning.
Spatial B&B converges to global optimum because:
- Each branch tightens variable bounds
- Convex relaxations become tighter as bounds shrink
- In the limit (infinitely small boxes), relaxation equals original problem
Branching Strategies
| Strategy | Description |
|---|---|
| Widest range | Branch on variable with largest $u_j - l_j$ |
| Most violated | Branch on variable with largest relaxation gap |
| Reliability | Use history of bound improvement |
| Violation transfer | Branch to reduce maximum constraint violation |
In Couenne (CouenneProblem.cpp):
// Spatial branching considers both integer and continuous variables
// The branching object encodes bounds for the new subproblems
4. Convexification and Relaxations
The quality of spatial B&B depends entirely on the quality of the convex relaxations. Convexification creates convex underestimators of nonconvex functions.
McCormick Envelopes
For a bilinear term $w = x_1 x_2$ with $x_1 \in [l_1, u_1]$ and $x_2 \in [l_2, u_2]$:
The McCormick envelope provides the tightest convex relaxation using four linear inequalities:
$$w \geq l_1 x_2 + l_2 x_1 - l_1 l_2$$ $$w \geq u_1 x_2 + u_2 x_1 - u_1 u_2$$ $$w \leq u_1 x_2 + l_2 x_1 - u_1 l_2$$ $$w \leq l_1 x_2 + u_2 x_1 - l_1 u_2$$
Why McCormick Works
At the corner points $(l_1, l_2)$, $(l_1, u_2)$, $(u_1, l_2)$, $(u_1, u_2)$, the envelope is exact ($w = x_1 x_2$).
Between corners, the envelope provides a convex underestimator. As bounds tighten, the envelope becomes tighter โ eventually exact when the box shrinks to a point.
Other Convexifications
| Function Type | Relaxation |
|---|---|
| $x^2$ | Already convex (no relaxation needed) |
| $x^k$ (odd $k$) | Secant relaxation |
| $\sin(x)$, $\cos(x)$ | Linear underestimators over bounded domain |
| $e^x$ | Secant (concave over-approximation) |
| $\log(x)$ | Secant (convex under-approximation) |
| $x_1 / x_2$ | Reformulate as $x_1 = w \cdot x_2$, then McCormick |
Factorable Functions
A key insight: Most nonlinear functions can be factored into elementary operations: $$f(x) = x_1^2 + \sin(x_2) + x_1 x_3$$
Introduce auxiliary variables:
- $w_1 = x_1^2$ (convex, no relaxation)
- $w_2 = \sin(x_2)$ (bounded relaxation)
- $w_3 = x_1 x_3$ (McCormick)
- $f = w_1 + w_2 + w_3$ (linear)
This systematic approach enables automatic convexification.
Couenne builds an expression tree for each constraint, then generates relaxations for each node:
// CouenneExprMul.cpp handles multiplication
// exprMul::generateCuts() creates McCormick cuts
5. Outer Approximation
For convex MINLP, there's a more efficient approach than spatial B&B: Outer Approximation (OA) alternates between an MILP master problem and NLP subproblems.
The Idea
Instead of branching on continuous variables, use linear cuts to approximate the nonlinear feasible region from outside.
The Algorithm
Initialize: Set of linearizations L = {}
Repeat:
1. MILP MASTER: Solve
min c^T x + d^T y
s.t. linearizations in L
y โ Z^p
Get solution (x*, y*)
2. NLP SUBPROBLEM: Fix integers y = y*, solve
min c^T x + d^T y*
s.t. g(x, y*) โค 0, h(x, y*) = 0
Get solution xฬ (or infeasibility certificate)
3. ADD LINEARIZATIONS:
- At xฬ: g(xฬ) + โg(xฬ)^T (x - xฬ) โค 0
- If infeasible: feasibility cuts
Until: MILP and NLP solutions match
Why It Works (for Convex Problems)
For convex $g$, the linearization $g(xฬ) + \nabla g(xฬ)^T(x - xฬ) \leq 0$ is a valid inequality โ it never cuts off any feasible point.
After finitely many iterations, enough linearizations accumulate to identify the optimal integer assignment.
Bonmin's Modes
Bonmin implements several OA variants:
| Mode | Description |
|---|---|
| B-OA | Pure outer approximation |
| B-BB | NLP-based branch-and-bound |
| B-QG | Quesada-Grossmann single-tree |
| B-Hyb | Hybrid (combines above) |
The hybrid mode is often fastest โ it uses OA for quick bounds and B&B for difficult nodes.
// BonOaDecBase.cpp implements the OA decomposition
// Each NLP solve generates cuts added to the MILP
6. Bonmin and Couenne in Practice
COIN-OR provides two MINLP solvers that build on the foundation libraries:
Bonmin (Basic Open-source Nonlinear Mixed INteger programming)
For: Convex MINLP
Architecture:
- Uses Cbc for MILP (master problem, branch-and-bound)
- Uses Ipopt for NLP (subproblems)
- Uses Cgl for cutting planes
Strengths:
- Efficient for convex problems
- Multiple algorithm modes
- Warm-starting between solves
Limitations:
- May find local (not global) optima for nonconvex problems
- Assumes constraint qualification holds
Couenne (Convex Over and Under ENvelopes for Nonlinear Estimation)
For: Nonconvex MINLP (global optimization)
Architecture:
- Uses Cbc for the branch-and-bound tree
- Uses Ipopt for local NLP solves (upper bounds)
- Implements spatial branching and automatic convexification
Key Features:
- Expression decomposition: Breaks complex functions into simple operations
- Bound tightening: FBBT and OBBT to tighten variable domains
- Cut generation: McCormick, disjunctive cuts, and more
- Branching strategies: On both integer and continuous variables
Global Optimality Guarantee: Couenne proves a solution is globally optimal when the gap between upper and lower bounds closes.
When to Use Which
| Scenario | Solver |
|---|---|
| Convex MINLP | Bonmin (faster) |
| Nonconvex, need proof of optimality | Couenne |
| Nonconvex, good solution is enough | Ipopt + heuristics |
| Very large problems | Decomposition methods |
Practical Tips
- Provide good bounds: Tighter variable bounds = faster convergence
- Good starting point: Help local solvers find good upper bounds
- Reformulate if possible: Convex formulations are much faster
- Monitor gap: The optimality gap shows progress
- Use presolve: Can dramatically reduce problem size
Example Couenne call:
// Set up OsiSolverInterface with the MINLP
CouenneProblem problem;
problem.readNl("myProblem.nl");
// Solve globally
CouenneSolver solver(&problem);
solver.solve();
// Get gap
double gap = solver.getOptimumBound() - solver.getBestFeasible();
Summary
| Concept | Key Point |
|---|---|
| Convexity | Local = global for convex problems |
| MINLP | Combines integer and nonlinear challenges |
| Spatial B&B | Branch on continuous variables for global optimization |
| Convexification | Create convex relaxations (McCormick, etc.) |
| Outer Approximation | Efficient for convex MINLP |
| Bonmin | Convex MINLP solver |
| Couenne | Global (nonconvex) MINLP solver |
Global optimization is computationally expensive but sometimes necessary โ when local optima aren't good enough and you need a guarantee of global optimality.
Next Steps
- Explore Couenne source in the browser
- Try the derivation of branch-and-bound correctness
- Read about McCormick envelopes in detail