Portfolio Optimization Under Real Constraints (MILP explained)

Beyond textbook mean-variance optimization: Real-world capital allocation involves constraints that traditional portfolio theory ignores. Grid connection capacity, construction crew availability, ESG quotas, and regulatory timing all matter. Here's how Mixed Integer Linear Programming (MILP) handles the constraints that actually bind your investment committee.

The Problem with Mean-Variance Optimization

Academic portfolio theory assumes you can invest any fraction of your budget in any asset. Want to allocate 23.7% to wind and 31.2% to solar? No problem in theory.

In practice, investment committees face discrete yes/no decisions with complex constraints:

Standard mean-variance optimization breaks down because it can't handle these integer constraints and resource limitations.

Real Constraints in Energy Portfolio Allocation

Let's examine the actual constraints that bind capital allocation decisions in energy and infrastructure:

🔌 Grid & Infrastructure

  • Transmission capacity limits
  • Substation connection slots
  • Network reinforcement schedules
  • Interconnector availability

👷 Construction Resources

  • EPC contractor capacity
  • Specialized equipment availability
  • Installation vessel schedules
  • Skilled labor constraints

🌱 ESG & Regulatory

  • Emission reduction targets
  • Technology diversification mandates
  • Regional development requirements
  • Permitting timelines

💰 Financial Constraints

  • Annual CAPEX budgets
  • Debt capacity limitations
  • Credit rating requirements
  • Cash flow timing

MILP Formulation: The Mathematics

Mixed Integer Linear Programming elegantly handles both continuous variables (budget allocation) and binary decisions (build/don't build). Here's the core formulation:

Objective: Maximize Σᵢ (NPVᵢ × xᵢ)

Subject to constraints...

Decision Variables

Key Constraint Types

# Budget constraints (annual CAPEX limits) Σᵢ (CAPEXᵢⱼ × xᵢ) ≤ Budgetⱼ ∀j ∈ years # Grid capacity constraints Σᵢ (Capacityᵢ × xᵢ) ≤ Grid_Limitₛ ∀s ∈ substations # Resource constraints (e.g., construction crews) Σᵢ (Resourceᵢⱼ × xᵢ) ≤ Resource_Limitⱼ ∀j ∈ years # ESG constraints (minimum renewables) Σᵢ∈renewables (Capacityᵢ × xᵢ) ≥ ESG_Target # Risk constraints (portfolio VaR limit) Σᵢⱼ (VaRᵢⱼ × xᵢ) ≤ Max_Portfolio_VaR # Project dependencies x₂ ≤ x₁ (project 2 requires project 1) x₃ + x₄ ≤ 1 (projects 3 and 4 are mutually exclusive)

Efficient Frontier Under Constraints

The traditional efficient frontier shows risk-return combinations for unconstrained portfolios. With MILP, we generate a constrained efficient frontier that respects real-world limitations.

🎯 Constrained Efficient Frontier Process

  1. Maximize return: Subject to all constraints, find highest NPV portfolio
  2. Minimize risk: Subject to all constraints, find lowest VaR portfolio
  3. Parametric optimization: Vary risk tolerance between these bounds
  4. Plot feasible combinations: Each point represents an optimal constrained portfolio

The resulting frontier shows achievable risk-return combinations, not theoretical ones. This gives investment committees realistic options for portfolio construction.

Shadow Prices: Understanding Binding Constraints

MILP solvers provide shadow prices (dual values) that reveal the marginal value of relaxing each constraint. This intelligence transforms capital allocation from guesswork to strategic decision-making.

💡 Shadow Price Interpretation

  • Budget constraint shadow price = €147/€: Each additional euro of budget would increase portfolio NPV by €147
  • Grid capacity shadow price = €2,340/MW: Each MW of additional grid capacity adds €2,340 in portfolio value
  • Construction crew shadow price = €180k/crew-month: Each additional crew-month is worth €180k in foregone value

Shadow prices guide strategic decisions: Should we invest in grid upgrades? Contract additional construction capacity? Which constraints should we negotiate with regulators?

Case Study: German Renewable Portfolio (500MW Budget)

🇩🇪 Portfolio Challenge

Situation: German utility with €500M budget, must achieve 60% renewables by 2026 while maintaining 12% target IRR and maximum 20% portfolio VaR.

Candidate Projects (12 projects):

  • 4x Onshore wind (50-120MW each)
  • 2x Offshore wind (300-400MW each)
  • 3x Solar PV (30-80MW each)
  • 2x Battery storage (50-100MW/200-400MWh)
  • 1x Green hydrogen electrolyzer (20MW)

Key Constraints:

Budget Phasing

€150M (2024), €200M (2025), €150M (2026)

Grid Capacity

Northern grid: 400MW
Southern grid: 300MW

ESG Mandate

Minimum 60% renewables by capacity

Risk Limit

Maximum 20% portfolio VaR (95% confidence)

MILP Solution Results:

  • Selected projects: 2x onshore wind, 1x offshore wind, 2x solar PV, 1x battery
  • Total capacity: 580MW (67% renewables → exceeds ESG target)
  • Portfolio IRR: 13.4% (exceeds 12% target)
  • Portfolio VaR: 18.2% (within 20% limit)
  • Budget utilization: 98.4% (€492M used)

Shadow Price Insights:

  • Northern grid capacity: €1,890/MW (binding constraint)
  • 2025 budget: €134/€ (most valuable budget year)
  • ESG constraint: €0 (non-binding, already exceeded)

Strategic Recommendation: Negotiate additional northern grid capacity (worth €1,890/MW) and front-load 2025 investments (highest shadow price).

Implementation Best Practices

Data Requirements

Solver Selection

Model Validation

Beyond Basic MILP: Advanced Extensions

Scenario-Robust Optimization

Optimize portfolio under base case assumptions, but ensure feasibility under downside scenarios. This prevents solutions that work on paper but fail in adverse conditions.

Multi-Objective Optimization

Simultaneously optimize multiple objectives (NPV, IRR, ESG score, strategic fit) using weighted objectives or Pareto frontier generation.

Dynamic Programming Integration

Combine MILP portfolio selection with real options valuation to capture both optimal timing and project selection in a unified framework.

Common Pitfalls and How to Avoid Them

⚠️ Watch Out For...

  • Over-constraining: Too many tight constraints may result in infeasible problems
  • Linear approximations: Some relationships (e.g., economies of scale) are inherently nonlinear
  • Ignoring uncertainty: Deterministic optimization on uncertain inputs can be misleading
  • Shadow price misinterpretation: Valid only for small constraint changes within feasible range

The Bottom Line

MILP-based portfolio optimization transforms capital allocation from art to science. By explicitly modeling real-world constraints, investment committees can:

The math is complex, but the value is clear: portfolios optimized under real constraints consistently outperform traditional mean-variance approaches by 100-300 basis points in IRR uplift.

Ready to optimize your portfolio under real constraints?

PortfolioEdge implements production-grade MILP optimization with your actual constraints.

Learn about PortfolioEdge Back to Blog