Mixed-Integer Linear Programming (MILP) is an optimization technique that minimizes or maximizes a linear objective function subject to linear constraints, where a subset of decision variables is constrained to take only integer values. This discrete requirement allows MILP to model binary on/off decisions—such as whether a charging station is active—alongside continuous variables like power flow rates, making it essential for smart charging and unit commitment problems.
Glossary
Mixed-Integer Linear Programming (MILP)

What is Mixed-Integer Linear Programming (MILP)?
A mathematical optimization framework for solving problems where some variables are restricted to integer values while others remain continuous, all within linear constraints and a linear objective function.
MILP solvers employ branch-and-bound and cutting-plane algorithms to efficiently explore the solution space, guaranteeing global optimality for convex formulations. In electric vehicle fleet management, MILP is used to solve the NP-hard scheduling problem of assigning discrete charging time slots while respecting transformer load management constraints and minimizing demand charges, bridging the gap between continuous power physics and discrete operational logic.
Key Characteristics of MILP
Mixed-Integer Linear Programming (MILP) is a powerful optimization framework that combines continuous variables with discrete decision variables, making it essential for solving complex EV charging scheduling problems where physical constraints meet binary on/off logic.
Discrete Decision Variables
MILP introduces integer variables that represent yes/no or on/off decisions—such as whether a charging station is active at a specific time slot. Unlike pure linear programming, these discrete variables allow the model to capture real-world constraints like binary charging states, vehicle-to-charger assignment, and minimum power thresholds below which chargers cannot operate efficiently.
Objective Function Formulation
The objective function defines what the optimization seeks to minimize or maximize, expressed as a linear combination of decision variables. Common EV charging objectives include:
- Minimizing total electricity cost under time-of-use tariffs
- Minimizing peak load to avoid demand charges
- Maximizing renewable energy utilization by aligning charging with solar generation
- Minimizing battery degradation by penalizing high C-rates
Constraint Modeling
Constraints enforce the physical and operational limits of the charging system. MILP handles multiple constraint types simultaneously:
- Power balance constraints ensuring total load does not exceed transformer capacity
- State of Charge (SoC) constraints guaranteeing vehicles reach target charge levels by departure time
- Sequential constraints linking SoC across consecutive time intervals
- Mutual exclusion constraints preventing conflicting charger assignments
Branch-and-Bound Algorithm
The dominant solution method for MILP problems, branch-and-bound systematically explores the solution space by:
- Solving linear programming relaxations where integer variables are temporarily treated as continuous
- Branching on fractional variables to create subproblems with tighter bounds
- Bounding by pruning subproblems that cannot improve upon the current best solution
- Modern solvers like Gurobi and CPLEX use advanced presolve, cutting planes, and heuristics to accelerate convergence
Time-Indexed Formulations
EV charging optimization typically uses time-indexed MILP formulations where the planning horizon is discretized into uniform intervals (e.g., 15-minute slots). Each interval has its own set of decision variables, creating a temporal coupling where the charging decision at time t directly affects the state at time t+1. This structure enables precise modeling of time-of-use pricing windows and dynamic grid signals.
Computational Complexity Considerations
MILP is NP-hard, meaning solution time can grow exponentially with problem size. For large-scale EV fleet optimization, practitioners employ:
- Rolling horizon approaches that solve shorter time windows sequentially
- Aggregation techniques grouping similar vehicles to reduce variable count
- Heuristic warm starts providing good initial solutions to accelerate solver convergence
- Decomposition methods like Lagrangian relaxation for geographically distributed charging networks
Frequently Asked Questions
Clear, technical answers to the most common questions about applying Mixed-Integer Linear Programming to electric vehicle charging and grid optimization problems.
Mixed-Integer Linear Programming (MILP) is a mathematical optimization technique where an objective function is minimized or maximized subject to linear constraints, with the critical distinction that some decision variables are restricted to integer values while others remain continuous. The integer variables typically represent discrete decisions—such as whether a charging station is on/off (binary 0-1) or how many vehicles are assigned to a specific charger—while continuous variables model physical quantities like power flow in kilowatts. The solver systematically explores the feasible solution space using algorithms like Branch-and-Bound, which partitions the problem into subproblems by fixing integer variables, and Cutting Planes, which tighten the linear relaxation. In electric vehicle charging, MILP enables the precise scheduling of charge start times and power allocations across a fleet while respecting hard constraints like transformer capacity limits and vehicle departure deadlines.
MILP vs. Other Optimization Techniques
Comparative analysis of Mixed-Integer Linear Programming against alternative optimization approaches for EV charging scheduling problems
| Feature | MILP | Heuristic Methods | Reinforcement Learning |
|---|---|---|---|
Handles discrete decisions (on/off) | |||
Global optimality guarantee | |||
Solution time for large instances | Minutes to hours | < 1 sec | < 1 sec |
Requires explicit mathematical model | |||
Handles non-linear constraints | |||
Interpretability of solution | High | Medium | Low |
Adapts to real-time data | |||
Computational cost per decision | High | Low | Medium |
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
Key mathematical and algorithmic concepts that complement Mixed-Integer Linear Programming in solving complex EV charging and grid optimization problems.
Model Predictive Control (MPC)
An advanced process control algorithm that solves a finite-horizon optimization problem at each time step to determine optimal charging schedules. Unlike static MILP formulations, MPC continuously re-optimizes as new data arrives, making it ideal for real-time EV fleet management where energy prices and grid conditions fluctuate.
- Uses a receding horizon approach: optimize over a future window, implement only the first step, then repeat
- Incorporates forecasted inputs like solar generation and electricity prices
- Handles multi-variable constraints including transformer capacity and battery degradation
- Often uses MILP as the internal solver for each time-step optimization
Dynamic Load Balancing
A real-time power allocation algorithm that distributes available electrical capacity across multiple charging points to prevent circuit breaker trips and minimize infrastructure upgrade costs. While MILP solves the scheduling problem, dynamic load balancing executes the millisecond-level power adjustments.
- Prevents phase imbalance in three-phase installations
- Operates within the constraints calculated by higher-level MILP optimization
- Essential for sites with limited grid connection capacity
- Reduces peak demand charges by up to 40% in commercial fleet depots
Demand Charge Management
An optimization technique that limits the peak power draw from the grid during a billing interval to reduce substantial demand charges levied on commercial EV fleet operators. MILP is the primary mathematical tool for solving this problem because it requires discrete decisions about which vehicles charge and when.
- Demand charges can constitute 30-70% of a commercial electric bill
- MILP models incorporate non-linear battery charging curves as piecewise linear approximations
- Integrates with time-of-use energy pricing for combined cost minimization
- Typical optimization window spans a full billing demand interval (15 or 30 minutes)
Battery Degradation Model
An empirical or physics-based mathematical representation of capacity fade and internal resistance growth in lithium-ion cells as a function of cycling and calendar aging. MILP formulations incorporate these models as cost functions to balance charging speed against battery longevity.
- Cycle aging: degradation proportional to energy throughput and depth of discharge
- Calendar aging: time-dependent degradation accelerated by high state of charge and temperature
- Linearized degradation costs enable integration into MILP objective functions
- Critical for V2G applications where bidirectional cycling accelerates wear
Peak Shaving
A load management strategy that reduces grid power consumption during periods of highest electricity demand by utilizing stored energy from batteries or curtailing flexible loads. MILP determines the optimal discharge schedule by solving a mixed-integer problem where battery discharge decisions are discrete and power levels are continuous.
- Reduces or eliminates costly demand charges
- Can incorporate vehicle-to-grid (V2G) discharge as a peak shaving resource
- Often combined with behind-the-meter solar generation forecasting
- Typical commercial implementations target a fixed peak threshold (e.g., 500 kW)
Charging Load Forecasting
The application of time-series machine learning models to predict the aggregate power demand of EV fleets hours or days in advance. These forecasts serve as input parameters to MILP scheduling models, and forecast accuracy directly impacts optimization quality.
- Uses historical charging data, weather, and fleet telematics as features
- Common approaches: LSTM networks, gradient boosting, and transformer-based architectures
- Probabilistic forecasts provide confidence intervals for robust optimization
- Forecast errors propagate through MILP, potentially causing constraint violations

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