How powerful is MILP?

Published: 2025-08-07 3 min read

Mathematical optimization often relies on continuous models, where algorithms glide smoothly across planes and gradients to find an optimal solution. However, the real world often does not operate on continuous spectrums. We can build a factory, or not build it, there is no such thing as opening 0.3 of a warehouse.

This is where Mixed Integer Linear Programming (MILP) steps in. In the field of operations research the aim is finding the best outcome (maximum profit, minimum cost) from a vast space of potential solutions.

To understand MILP, we must look at its mathematical anatomy. The foundation is Linear Programming (LP), meaning the objectives and constraints strictly follow straight lines or flat planes. But the defining feature is the possible Integer restriction. By introducing integers variables, MILP can implement complex rule-based logics.

                                        
⎧ 
⎪ min C·X                   ______________________
⎪                           \                     \
⎪     A X ≥ B                \  FORMAL DEFINITION  \
⎨       X ≥ 0                 \_____________________\
⎪ 
⎪ X : vector of x ∊ ℝ | ℤ₊
⎪     
⎩

C·X is the Objective function, linear in X, in this case the objective is the minimization. A X ≥ B are the Constraints (in canonical form, X ≥ 0 are implicitly added to every instance of MILP), these define the Feasible space for the problem.

The Power of Discrete Choice

Standard continuous mathematics cannot handle logical statements. You cannot easilly use continuous math to say, "If we open Warehouse A, we cannot open Warehouse B." Because MILP allows for discrete choices, it excels at modeling surprisigly complex scenarios.

                                        
LINEAR PROGRAMMING (LP) FEASIBLE SPACE
Continuous convex polyhedron (solid region)
y ^
  |      __________
7 |     /          \  
6 |    /  feasible  \ 
5 |   |    region   / 
4 |    \           / 
3 |     \_________/
2 |
1 |
0 +--------------------------------->
  1   2   3   4   5   6   7   8

INTEGER LINEAR PROGRAMMING (ILP) FEASIBLE SPACE
Discrete integer points only
y ^
  |
7-|       .   .   .
6-|   .   .   .   .
5-|   .   .   .   .      only integer coordinates
4-|   .   .   .   .  Only specific points are feasible.
3-|       .   .   .
2-|
1-|
0 +---|---|---|---|---|---|---|--->
  1   2   3   4   5   6   7   8

MIXED INTEGER LINEAR PROGRAMMING (MILP) FEASIBLE SPACE
Continuous lines within the polyhedral boundaries
y ^
  |
7 |       |   |   |
6 |   |   |   |   |
5 |   |   |   |   |           Integer values of x
4 |   |   |   |   |   Continuous variation in y allowed.
3 |       |   |   |
2 |
1 |
0 +---|---|---|---|---|---|---|--->
  1   2   3   4   5   6   7   8

Binary Logic and Routing: The most powerful use of MILP is making definitive "Yes/No" choices. It is the driving force behind modern logistics. Solving the Vehicle Routing Problem, assigning a fleet of delivery trucks to specific routes while minimizing total fuel consumption, is a combinatorics problem made possible by discrete variables. Similarly, determining exactly which candidate hospitals or factories to open to serve a population is a classic MILP application.

Fixed-Charge Problems: In reality, costs are rarely perfectly linear from zero. Often, you incur a massive upfront cost just to start an activity. If you produce even one unit of a product, you instantly incur a 6000€ machine setup cost. MILP uses binary variables to encode this step-logic: If production > 0, then add 6000€.

Complex "If-Then" Rules: MILP can encode strict business constraints directly into its mathematics. Whether ensuring mutually exclusive choices ("We can run Ad Campaign A or B, but not both") or enforcing contingent decisions ("We can only build the new product line if we upgrade the power grid"), integer variables translate human logic into mathematical bounds.

The Boundaries: What MILP Cannot Do

Despite its immense utility, MILP is not a silver bullet. The very thing that makes it useful, the integer constraint, is also its Achilles'heel. If a real-world problem hits one of these computational walls, pure MILP will either fail to solve it or produce inaccurate results.

The first hard boundary is The Rule of Linearity. In an MILP model, every objective and constraint must be a straight line or a flat plane. You cannot multiply two decision variables together, nor can we use exponents or trigonometric functions. Real-world phenomena like aerodynamic drag or economies of scale natively break MILP architectures, requiring messy piecewise approximations to function.

The second, and perhaps most famous limitation, is The Curse of Dimensionality.

"As we add more binary variables, the search space doesn't just grow, it explodes. A model that solves in milliseconds with 10 variables might outlive the universe with 100."

While a computer can solve a continuous LP with millions of variables in seconds, MILP is generally classified as NP-hard. Because the solver must explore discrete, indivisible choices, the number of possible combinations grows exponentially. If you have n binary variables, the solver theoretically faces a space of 2n combinations.

           
 Variables (n)  Combinations (2n)    Compute Time
----------------------------------------------------
     10              1,024            Milliseconds
     30          ~1.07 Billion        Minutes
    100          1.26 x 10^30         Billions of Years

Modern solvers use brilliant algorithms (like Branch and Bound) to smartly skip over millions of bad combinations without explicitly checking them. However, the fundamental mathematical limit remains. In large-scale, real-world problems, we rarely find the absolute perfect optimal solution. Instead, planners set a time limit and accept a solution that is simply "good enough."

← Back to writings ↑ Return to top