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.
Glossary
Mixed-Integer Linear Programming (MILP)

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.
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.
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.
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.
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.
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.
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.
Core Solution Algorithm: Branch and Bound
The primary algorithm for solving MILPs is Branch and Bound. It works by:
- Relaxation: First, the integer constraints are relaxed, turning the MILP into a standard Linear Program (LP), which is easy to solve.
- 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.
- 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).
- Search: This process creates a tree of sub-problems, systematically searching for and verifying the optimal integer solution.
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.
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 / Characteristic | Mixed-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) |
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Mixed-Integer Linear Programming (MILP) is a core technique in combinatorial optimization. These related concepts define the mathematical and algorithmic landscape in which MILP operates for solving complex routing and scheduling problems.
Linear Programming (LP)
Linear Programming is the foundational optimization technique upon which MILP is built. It involves maximizing or minimizing a linear objective function subject to a set of linear equality and inequality constraints, where all decision variables are continuous (can take any real-number value).
- Core Mechanism: Uses the Simplex Algorithm or Interior-Point Methods to find the optimal solution at a vertex of the feasible region (a convex polytope).
- Key Difference from MILP: LP variables are continuous. MILP introduces integer variables, transforming the problem from convex to combinatorial, which is NP-Hard in general.
Constraint Programming (CP)
Constraint Programming is a declarative programming paradigm for solving combinatorial satisfaction and optimization problems. Instead of an objective function, it focuses on defining a set of constraints (logical, arithmetic, global) that any feasible solution must satisfy.
- Search Mechanism: Uses propagation and backtracking to prune the search space of discrete variables.
- Comparison to MILP: CP excels at problems with complex logical constraints (e.g., 'if-then', 'all-different'). MILP is generally stronger for problems with a clear linear structure and a numeric objective to optimize. They are often used in hybrid CP-MILP solvers.
Branch and Bound
Branch and Bound is the fundamental algorithmic framework used by all modern MILP solvers (like Gurobi, CPLEX) to find provably optimal solutions. It systematically explores the space of integer solutions.
- Branching: Creates subproblems by fixing integer variables to specific values (e.g., x=0 or x=1), forming a search tree.
- Bounding: Solves the linear programming relaxation of each subproblem. If the LP solution value is worse than the best-known integer solution, the entire branch is pruned.
- Critical Role: This method avoids enumerating all possible integer combinations, making large-scale MILP problems tractable.
Vehicle Routing Problem (VRP)
The Vehicle Routing Problem is a canonical combinatorial optimization problem that is frequently modeled and solved using MILP. The objective is to find optimal routes for a fleet of vehicles to serve a set of customers, minimizing total cost or distance.
- MILP Formulation: Decision variables are often binary, indicating if a specific vehicle travels between two customer locations. Constraints ensure each customer is visited once, routes are connected, and vehicle capacities are respected.
- Variants: VRP with Time Windows (VRPTW), Capacitated VRP (CVRP), and Heterogeneous Fleet VRP are all classic applications of MILP in logistics.
NP-Hardness
NP-Hardness is a computational complexity classification that indicates a problem is at least as hard as the hardest problems in NP. Most interesting MILP problems are NP-Hard.
- Implication: There is no known algorithm that can solve all NP-Hard problems to optimality in polynomial time (scaling efficiently with input size).
- Practical Impact: This is why MILP relies on heuristics and exact algorithms like Branch and Bound that have exponential worst-case time but perform well on many practical instances. Understanding NP-Hardness justifies the use of approximation algorithms and sophisticated solvers.
Cutting-Plane Method
The Cutting-Plane Method is a technique used to strengthen the Linear Programming relaxation of a MILP problem, accelerating the Branch and Bound process. It iteratively adds new linear constraints (cuts) that are valid for all integer solutions but violated by the current fractional LP solution.
- Purpose: Tighter relaxations provide better bounds, leading to more pruning and a smaller search tree.
- Common Cuts: Gomory cuts (general purpose), cover inequalities (for knapsack constraints), and flow covers. Modern solvers automatically generate many classes of cuts.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us