Mixed-Integer Linear Programming (MILP) is an optimization framework where the objective function and all constraints are linear, but a subset of decision variables is restricted to integer values. This formulation is essential for modeling discrete decisions—such as the open/closed status of a switch—within a continuous physical system like power flow. The integer variables allow the solver to represent logical conditions, on/off states, and sequencing decisions that cannot be captured by continuous linear programming alone.
Glossary
Mixed-Integer Linear Programming (MILP)

What is Mixed-Integer Linear Programming (MILP)?
Mixed-Integer Linear Programming (MILP) is a mathematical optimization technique that models decision variables as a combination of continuous values and discrete integers, enabling the precise formulation of complex operational constraints.
In grid topology optimization, MILP models binary integer variables to represent the status of sectionalizing and tie switches, while continuous variables capture voltage magnitudes and branch power flows. The solver, typically using branch-and-bound or cutting-plane algorithms, searches for the globally optimal combination of switch states that minimizes losses or restores service while strictly enforcing the radiality constraint and thermal limits. This guarantees a mathematically proven optimal reconfiguration rather than an approximate heuristic solution.
Key Characteristics of MILP in Grid Optimization
Mixed-Integer Linear Programming (MILP) provides the rigorous mathematical framework for finding globally optimal solutions to distribution network reconfiguration problems by modeling switch states as binary variables and power flow physics as linear constraints.
Binary Decision Variables
The defining characteristic of MILP is the use of binary integer variables (0 or 1) to represent discrete switch states in the distribution network.
- Open switch: Represented as 0, indicating no current flow through that branch
- Closed switch: Represented as 1, allowing power to flow along that path
- Tie switches: Modeled as binary variables that can change state during optimization
- Sectionalizing switches: Similarly represented to enable feeder reconfiguration
This binary formulation directly maps the physical reality of switchgear—a switch is either open or closed, with no intermediate state. The solver explores combinations of these binary variables to find the optimal topology.
Linear Power Flow Constraints
MILP formulations enforce linearized power flow physics to ensure all solutions respect electrical engineering principles while maintaining computational tractability.
- DistFlow equations: Linear approximations of branch flow equations specifically derived for radial distribution networks
- Voltage drop constraints: Linear relationships between power flow and voltage magnitude differences along feeders
- Current limits: Thermal capacity constraints expressed as linear inequalities on branch flows
- Kirchhoff's laws: Node balance equations ensuring power injected equals power consumed plus losses
The linearization is essential—true AC power flow is non-convex and nonlinear, making global optimization computationally prohibitive for real-time grid operations.
Radiality Enforcement
A critical constraint in MILP-based reconfiguration is the radiality requirement—the solution must produce a network topology without any closed loops.
- Spanning tree constraints: Mathematical conditions ensuring the resulting graph connects all nodes without cycles
- Single-parent rules: Each load bus must receive power from exactly one upstream source
- Connectivity guarantees: Constraints preventing unintentional islanding of customers
- Substation separation: Rules ensuring feeders remain electrically distinct under normal operation
Radiality is enforced for protection coordination—radial networks allow simple overcurrent protection schemes with predictable fault current paths, eliminating the complexity of directional relaying required in meshed systems.
Global Optimality Guarantee
Unlike heuristic methods such as the Branch Exchange Method, MILP solvers provide a mathematical guarantee of finding the globally optimal solution within the defined search space.
- Branch-and-bound: The core algorithm systematically partitions the solution space and prunes suboptimal regions
- Optimality gap: Solvers report the percentage difference between the best found solution and the theoretical lower bound
- Proven convergence: Commercial solvers like Gurobi and CPLEX can close the gap to 0.0%, certifying optimality
- Benchmarking value: MILP solutions serve as ground truth for evaluating faster heuristic algorithms
This guarantee is crucial for regulatory compliance and investment planning, where utilities must demonstrate they are operating the grid at maximum efficiency.
Multi-Objective Formulation
MILP frameworks naturally extend to multi-objective optimization, allowing grid operators to balance competing goals through weighted objective functions or constraint-based approaches.
- Loss minimization: Reducing I²R losses by shortening current paths and balancing feeder loading
- Switching cost minimization: Penalizing unnecessary switch operations to preserve equipment lifespan
- Voltage profile improvement: Minimizing deviations from nominal voltage across all buses
- Load balancing: Equalizing utilization percentages across parallel transformers and feeders
The solver generates a Pareto optimal front—a set of solutions where improving one objective necessarily degrades another, enabling operators to make informed trade-off decisions based on current operational priorities.
Computational Complexity Management
MILP problems are NP-hard in general, meaning solution time can grow exponentially with the number of binary variables. Practical grid applications require careful formulation strategies.
- Tight big-M values: Using the smallest possible constants in disjunctive constraints to improve solver performance
- Symmetry breaking: Adding constraints to eliminate mathematically equivalent but permuted solutions
- Warm starting: Providing the solver with a known feasible topology to accelerate convergence
- Time limit settings: Configuring solvers to return the best solution found within operational time windows (typically 30-300 seconds)
- Decomposition techniques: Breaking large networks into smaller subproblems solved sequentially
Modern commercial solvers leverage cutting planes and presolve reductions to dramatically reduce solve times, making MILP viable for networks with hundreds of switches.
MILP vs. Heuristic Methods for Grid Reconfiguration
Comparison of Mixed-Integer Linear Programming against common heuristic methods for solving the distribution feeder reconfiguration problem under radiality constraints.
| Feature | MILP | Branch Exchange | Genetic Algorithm |
|---|---|---|---|
Optimality guarantee | Global optimum proven | ||
Solution quality | Optimal | Near-optimal (local minimum) | Near-optimal (stochastic) |
Handles radiality constraints | |||
Handles voltage constraints | |||
Handles thermal limits | |||
Multi-objective capability | Weighted sum or epsilon-constraint | Pareto front via NSGA-II | |
Computation time (1000-bus system) | 2-30 seconds | < 1 second | 30-300 seconds |
Solver dependency | CPLEX, Gurobi, or SCIP required | None | None |
Deterministic output | |||
Scalability to 10,000+ buses | Limited by solver memory | ||
Integration with MPC framework | |||
Handles integer switching costs | |||
Cold load pickup modeling | |||
Implementation complexity | High (formulation expertise) | Low | Medium |
Frequently Asked Questions
Clarifying the mathematical foundations and practical applications of Mixed-Integer Linear Programming for solving complex distribution network reconfiguration challenges.
Mixed-Integer Linear Programming (MILP) is an optimization formulation where some decision variables are constrained to integer values while others remain continuous, and all relationships are expressed as linear constraints. In grid topology optimization, binary integer variables (0 or 1) represent the open/closed status of switches, while continuous variables model physical quantities like voltage magnitudes and power flows. The solver systematically explores the solution space using algorithms like branch-and-bound, which partitions the problem into subproblems by fixing integer variables, and cutting-plane methods, which tighten the linear relaxation. This guarantees finding the globally optimal reconfiguration that minimizes losses or restores service, unlike heuristic methods that may settle for local optima.
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
Master the mathematical and operational building blocks that underpin Mixed-Integer Linear Programming in grid topology optimization.
Radiality Constraint
A fundamental operational rule requiring the distribution network to maintain a tree structure without closed loops. In MILP formulations, this is enforced through constraints ensuring exactly N-1 closed branches for a system with N nodes. This guarantees simple protection coordination and unidirectional fault current paths, preventing circulating currents that complicate relay settings.
Binary Decision Variables
Integer variables restricted to values of 0 or 1 that represent the open/closed status of switches in the MILP model. A value of 1 indicates a closed switch conducting power, while 0 represents an open switch. These discrete variables are what make the problem mixed-integer rather than purely linear, dramatically increasing computational complexity but enabling precise topological decisions.
DistFlow Equations
A simplified set of recursive power flow equations specifically derived for radial distribution networks. They calculate voltage magnitudes and branch flows using linearized approximations of the nonlinear AC power flow. MILP solvers leverage DistFlow to express voltage drops and line losses as linear constraints, avoiding the non-convexity of full AC optimal power flow.
Branch Exchange Method
A heuristic optimization technique that iteratively closes a tie switch and opens a sectionalizing switch to find a lower-loss radial topology. While MILP provides globally optimal solutions, branch exchange serves as a faster alternative or warm-start mechanism. Each iteration evaluates the loss reduction from a single switching operation, making it computationally lightweight for real-time applications.
Spanning Tree
A subgraph of a meshed network that connects all nodes without any loops, representing a valid radial operating configuration. Every feasible solution to the MILP corresponds to a spanning tree of the distribution graph. Graph theory algorithms like Kruskal's or Prim's can generate candidate spanning trees that seed the MILP solver with high-quality initial solutions.
Multi-Objective Optimization
A mathematical framework for balancing competing goals within a single MILP formulation. Common objectives include:
- Minimizing active power losses
- Minimizing switching operations to reduce equipment wear
- Balancing feeder loading percentages Solutions form a Pareto optimal front, where improving one objective degrades another, giving operators a menu of trade-off configurations.

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