Inferensys

Glossary

Mixed-Integer Linear Programming (MILP)

Mixed-Integer Linear Programming (MILP) is a mathematical optimization technique where some decision variables are constrained to be integers, used to model complex routing and scheduling problems with discrete choices.
MLOps engineer reviewing model serving infrastructure on laptop, container orchestration visible, technical workspace.
OPTIMIZATION ALGORITHM

What is Mixed-Integer Linear Programming (MILP)?

Mixed-Integer Linear Programming (MILP) is a foundational mathematical optimization technique for solving complex decision-making problems involving both discrete choices and continuous resources.

Mixed-Integer Linear Programming (MILP) is a mathematical optimization method where an objective function is minimized or maximized subject to a set of linear constraints, with the defining characteristic that some decision variables are required to be integers. This integer constraint allows MILP to model discrete, yes/no decisions—such as whether to assign a task to a specific agent or select a particular route—alongside continuous quantities like time or resource allocation. It is a core technique in operations research and combinatorial optimization for solving NP-hard problems like the Vehicle Routing Problem (VRP) and scheduling.

The power of MILP lies in its ability to provide provably optimal solutions for problems with discrete combinatorial structures, such as facility location, crew scheduling, and network design. Solvers use algorithms like branch-and-bound and cutting-plane methods to systematically explore the solution space. In priority-based routing for heterogeneous fleets, MILP formulations can encode time-window constraints, vehicle capacities, and dynamic task priorities into a single, solvable model, enabling centralized optimization of the entire fleet's movements and assignments against a clear objective like minimizing makespan or total cost.

MATHEMATICAL OPTIMIZATION

Key Characteristics of MILP

Mixed-Integer Linear Programming (MILP) is a foundational technique for modeling complex, real-world optimization problems where decisions involve discrete choices. Its defining characteristics make it uniquely powerful for priority-based routing and scheduling.

01

Discrete-Continuous Hybrid

A MILP problem is defined by an objective function and a set of linear constraints, where some decision variables are required to be integers (e.g., 0, 1, 2), while others can be continuous. This hybrid nature is crucial for modeling:

  • Binary variables (0 or 1) for yes/no decisions like "assign this task to that vehicle."
  • Integer variables for countable quantities like "number of robots deployed."
  • Continuous variables for measurable quantities like "distance traveled" or "time spent." This allows a single model to encapsulate both logical choices and physical quantities.
02

NP-Hard Complexity

MILP problems are generally NP-hard. This means that as the number of integer variables grows, the computational time required to find a provably optimal solution can grow exponentially. This characteristic directly impacts real-world application:

  • Exact solvers (like CPLEX, Gurobi) use sophisticated algorithms (Branch and Bound, Cutting Planes) to manage this complexity.
  • Solution time is not perfectly predictable; a small change in the problem can lead to a large change in solve time.
  • For large-scale problems like fleet routing, practitioners often use heuristics or accept near-optimal solutions within a defined optimality gap to get answers in practical timeframes.
03

Formulation Power for Logic

The integer variables in MILP enable the modeling of complex logical relationships and business rules through linear constraints. This is a key strength for fleet orchestration. For example:

  • If-Then Conditions: "If robot A is assigned to zone 1, then it cannot go to zone 2."
  • Fixed Costs: Incurring a base cost only if a vehicle is used (modeled with a binary variable).
  • Disjunctive Constraints: "Task X must start after Task Y OR Task Y must start after Task X."
  • Capacity Limits: "The sum of loads on a route cannot exceed the vehicle's capacity." This allows the model to capture the intricate dependencies of real-world operations.
04

Optimality Certificates

A major advantage of using MILP with a commercial solver is the ability to obtain optimality certificates. The solver doesn't just provide a good answer; it provides mathematical proof about its quality.

  • Optimal Solution: The solver proves no better solution exists.
  • Optimality Gap: For difficult problems, the solver can provide a best-found solution and a best-possible bound, quantifying how close it is to optimal (e.g., within 2%).
  • This deterministic proof of solution quality is critical for enterprise applications where reliability and justification of decisions are required.
05

Core Solution Algorithm: Branch and Bound

The primary algorithm for solving MILPs is Branch and Bound. It works by:

  1. Relaxation: First, the integer constraints are relaxed, turning the MILP into a standard Linear Program (LP), which is easy to solve.
  2. Branching: If the LP solution has fractional values for integer variables, the algorithm creates two new sub-problems (branches), forcing the variable to be 0 in one and 1 in the other.
  3. Bounding: Each sub-problem's LP relaxation provides a bound on the best possible solution in that branch. Branches with bounds worse than a known integer solution are pruned (discarded).
  4. Search: This process creates a tree of sub-problems, systematically searching for and verifying the optimal integer solution.
06

Common Applications in Routing

In priority-based routing and heterogeneous fleet orchestration, MILP is used to formulate and solve core optimization problems:

  • Vehicle Routing Problem (VRP): Finding optimal delivery routes.
  • VRP with Time Windows (VRPTW): Adding customer service time constraints.
  • Task Assignment & Scheduling: Assigning jobs to robots/vehicles with different capabilities and priorities.
  • Facility Location: Deciding where to place depots or charging stations.
  • Pickup and Delivery Problems: Coordinating the movement of goods between locations. These models directly incorporate priority levels, deadlines, and heterogeneous agent capabilities into their constraint and objective functions.
METHOD COMPARISON

MILP vs. Other Optimization Methods

A feature comparison of Mixed-Integer Linear Programming against other common optimization techniques used in routing, scheduling, and fleet orchestration.

Feature / CharacteristicMixed-Integer Linear Programming (MILP)Linear Programming (LP)Constraint Programming (CP)Metaheuristics (e.g., Genetic Algorithm, Simulated Annealing)

Core Problem Type

Linear optimization with discrete/integer variables

Linear optimization with continuous variables

Satisfaction of logical & arithmetic constraints

General combinatorial & black-box optimization

Solution Guarantee

Global optimum (for exact solvers)

Global optimum

Feasibility (completeness); may prove optimality

Approximate; no optimality guarantee

Modeling Paradigm

Mathematical (linear equations & inequalities)

Mathematical (linear equations & inequalities)

Declarative (constraints & relations)

Procedural (solution representation & operators)

Handles Discrete Decisions (e.g., yes/no, vehicle assignment)

Handles Continuous Variables (e.g., speed, resource allocation)

Native Support for Complex Logical Rules (e.g., if-then, all-different)

Typical Solution Time for Industrial Problems

Minutes to hours (can be exponential)

< 1 sec to minutes (polynomial)

Seconds to minutes (depends on propagation)

Seconds to hours (configurable)

Primary Use Case in Fleet Orchestration

Optimal scheduling & routing with fixed costs

Resource allocation, continuous flow optimization

Complex scheduling with intricate rules & precedence

Large-scale VRP/VRPTW where 'good enough' suffices

Scalability to Very Large Problems (>1000 agents/tasks)

Varies

Ease of Integrating New Constraints Post-Modeling

Difficult (requires reformulation)

Moderate

Easy (declarative nature)

Moderate (requires operator design)

MIXED-INTEGER LINEAR PROGRAMMING

Frequently Asked Questions

Mixed-integer linear programming is a foundational mathematical technique for solving complex optimization problems involving discrete choices, such as routing vehicles or scheduling tasks. These questions address its core mechanics, applications, and role in modern logistics.

Mixed-Integer Linear Programming (MILP) is a mathematical optimization technique where the goal is to maximize or minimize a linear objective function, subject to a set of linear equality or inequality constraints, with the key requirement that some of the decision variables must take on integer values (e.g., 0, 1, 2). It works by modeling real-world decisions—like whether to assign a robot to a task (a binary 0/1 variable) or how many units to ship (an integer variable)—within a framework of linear relationships. A solver algorithm then searches the solution space, using techniques like branch-and-bound, to find the optimal combination of integer and continuous variables that satisfies all constraints.

For example, in fleet orchestration, a MILP model might have variables for each robot-task pairing (1 if assigned, 0 if not), continuous variables for route start times, an objective to minimize total travel time, and constraints ensuring no robot is double-booked and all tasks are completed within their time windows.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.