As one industry engineer put it, producing oil is easy. However, producing it optimally across a constrained, interconnected network of wells and facilities is the real engineering problem. In this article, we explore mixed integer linear programming (MILP) as a paradigm for optimizing production and distribution in oil and gas production systems.
The Infrastructure Challenge: Complexity at Scale
Every complex infrastructure system, regardless of industry, faces a common challenge: how to efficiently allocate limited resources across increasingly interconnected networks. Whether distributing electricity, routing goods, allocating bandwidth, or planning service capacity, the core problem lies in navigating a vast space of possible decisions to identify solutions that maximize efficiency while minimizing cost.
Oil and gas production systems are no different. From complex subsurface reservoirs to wellheads, production platforms, and processing facilities, engineers face the herculean task of keeping production running safely, sustainably, and efficiently every single day.
These systems are typically governed by physical and operational constraints that limit how resources can be deployed. Constraints such as separator and compression capacity, water-handling limits, and lift-gas availability determine the operating conditions of facilities and platforms.
These limits are not theoretical. According to the North Sea Transition Authority, on the UK Continental Shelf in 2025, 114 million BOE of production potential was lost, and 73% of those losses were plant-related against just 16 million BOE attributable to well issues, leaving production efficiency at 76% against an 80% target. The reservoir could deliver; the facilities could not take it.
As these systems scale and age, intuition-based decision-making becomes insufficient, and even a single suboptimal decision can cascade into underutilization of assets, reduced system efficiency, safety concerns, and, of course, increased operational cost. To ensure operations are kept running smoothly, necessary techniques are adopted that not only improve efficiency but also operate at scale and speed, with minimal human intervention, enabling decisions that are both optimal and consistently compliant with system constraints for the sake of safety and sustainability.
The Case for MILP: Why Not Just Use Machine Learning?
Modern organizations often default to machine learning (ML) for optimization, and rightly so. ML has proven itself across a wide range of industries. Being able to train a model on representative data and let it guide decisions is genuinely powerful, and it's why ML has become a serious area of study almost everywhere. The ML paradigm can be seen in Fig. 2.
But there's a catch buried in that same sentence. Data is what makes ML formidable, and data is exactly where its power ends. A model is only ever as sharp as the record it was trained on. Give it thin, skewed, or unrepresentative behavioral data and it will fail quietly and confidently. Even at full strength, it is doing one thing: reading the past and betting the future looks like it.
In addition to its data dependency problem, standard ML models are not inherently "constraint-aware." What does this mean? Even with post-hoc filtering, the average ML model optimizes for statistical likelihood, not physical possibility. Underneath the branding, an ML model is a set of algebraic and statistical expressions, and its boundaries are whatever falls out of those expressions when solved against the available data. Nothing in that model knows what a separator can hold or where a pipeline's pressure ceiling sits. Those limits simply aren't part of the conversation.
In practice, this means your model can produce results that are mathematically sound but unrepresentative of your system, and therefore not actionable. Some of this traces back to data quality again, and it's worth confronting early in development rather than discovering it downstream.
MILP takes a different route.
MILP solves two of the most pressing problems posed by ML. First, data availability. Because you don't need to gather historical behavioral data over time to build a MILP model, the hassle of collection and cleaning, historically around 60% of practitioners’ time in any ML project, is eliminated. That means you can focus on what actually matters: the system, its engineering parameters, and how you model it.
Secondly, MILP lets you encode physical laws directly into the logic used to solve the problem. Metrics like maximum separator pressure, compressor discharge limits, water-handling capacity, and flare capacity act as constraints in the system and genuinely determine your outputs. Including them from the start ensures every solution is operationally valid.
That's where MILP earns its place: when you need the best possible answer inside a tightly defined set of limits. It searches the full solution space and finds the true optimum without ever stepping outside the boundaries.
MILP: A Strong Optimization Framework
MILP is one of the most widely used frameworks for infrastructure optimization today, and the name describes the method precisely. Linear programming means the relationships between variables are written as linear equations and inequalities. Mixed integer means some variables are continuous, like a flow rate or a pressure, while others are restricted to whole numbers, most often binaries that answer yes-or-no questions. Is this well open? Is this compressor running? Is this route in use?
That second half is what makes the framework useful for real infrastructure. Continuous variables can tell you how much to produce. Binaries let you model the decisions that come with a switch: startup and shutdown, minimum stable flow, routing choices, whether a facility is online at all. Most operational decisions have that discrete character, and a purely continuous model cannot express them. The MILP paradigm can be seen in Fig. 3.
By representing physical assets as mathematical relationships, MILP replaces judgment calls with a formulation anyone can inspect and challenge. The resulting systems of equations are far too large to solve by hand, but modern solvers routinely handle models with hundreds of thousands of variables. Solve time depends heavily on how the problem is structured: many practical models return an answer in seconds, while a poorly formulated one can run for hours.
Every MILP model rests on four pillars.
● Parameters: known inputs and fixed values that describe the system (capacities, costs, demand)
● Decision Variables: the unknowns the model is solving for (how much to produce, where to route flow)
● Objective Function: the goal of the optimization (maximize throughput, minimize cost)
● Constraints: the rules and limits that define which solutions are valid
The strength of MILP lies in its transparency. Unlike a black-box model, every variable and every constraint is written down explicitly, which means every answer can be traced back to the logic that produced it. That transparency comes at a price. It demands deep domain knowledge, because a constraint you forget to write is a constraint the solver will happily violate. The model will return a solution that is perfectly valid on paper and unusable in the field. But that same explicitness is what makes MILP an authoritative tool for safety-critical infrastructure—nothing is inferred, so nothing is left to chance.
Conclusion
Optimization practices will continue to be integral to ensuring oil and gas production systems meet their potential. The challenge is not predicting what a field will do. It is deciding what to do with it today, within the limits the facilities allow. By describing the system in plain terms, its operating conditions and the constraints it works under, MILP provides an avenue to ensure the best decisions are made, not just a good guess. Because an MILP is constraint-aware by design, every answer it generates fits within the limits of the system.
MILP models are also quick to re-solve. Operating conditions rarely hold steady: a compressor trips, water cut climbs, lift gas is curtailed. Since the model is a description of the system rather than a pattern learned from its history, adjusting to any of these means updating the affected limits and running it again. A well-built model returns a revised operating point within seconds, which means decisions can be made while they still matter rather than deferred to the next planning cycle. And because every rule in the model is written down plainly, anyone can look at the answer and see exactly why it was reached.
The next article in this series puts this into practice by presenting a step-by-step walkthrough of a production problem on a hypothetical system, from describing the system to solving it.