Data Science

Concavity and Network Flow in Profit Optimization: How Diminishing Returns Enable Efficient Solutions

Understanding why retail revenue functions are concave, how this property enables convex optimization, and the network flow interpretation that powers modern markdown pricing algorithms

Cyril Noirot
By Cyril NoirotMay 15, 20257 min read
Share on

Executive Summary

In retail and e-commerce, the fundamental economic principle of diminishing returns creates a powerful mathematical property: revenue concavity. This property transforms complex markdown pricing problems into tractable convex optimization problems, enabling efficient solutions through network flow algorithms.

Understanding this connection between economic intuition and mathematical structure is crucial for implementing scalable pricing systems that handle thousands of SKUs across multiple locations.

1. The Real-World Intuition

In retail and e-commerce, more inventory can always be sold—but only at lower prices. This creates a diminishing marginal return: each additional unit sold contributes less incremental revenue than the previous one.

The first few units sell at high prices and yield strong profit margins, but clearing the remaining stock requires discounts, reducing the gain per unit.

Example: Fashion Retailer's Seasonal Clearance

First 100 units

$50/unit

Full price buyers

Next 200 units

$35/unit

20% markdown

Final 300 units

$20/unit

60% clearance

This real-world trade-off directly translates into a mathematical property of the optimal revenue function.

2. Concavity of the Expected Revenue Function

Let Rˉℓ∗(Sℓ)\bar{R}^*_\ell(S_\ell) be the expected optimal revenue obtained when allocating SℓS_\ell units of inventory to product or market ℓ\ell.

Mathematical Foundation

The function Rˉℓ∗(Sℓ)\bar{R}^*_\ell(S_\ell) is concave in SℓS_\ell: it increases with inventory but with diminishing slope.

Formally:

d2Rˉℓ∗(Sℓ)dSℓ2<0\frac{d^2 \bar{R}^*_\ell(S_\ell)}{dS_\ell^2} < 0

Why This Matters

Concavity ensures that:

  1. Local optima are global optima — no risk of getting stuck in suboptimal solutions
  2. Gradient-based methods converge — standard optimization algorithms work reliably
  3. Efficient algorithms exist — polynomial-time solutions for large-scale problems

3. From Concavity to Convexity

Since maximizing a concave function is equivalent to minimizing its negative (which is convex), the joint markdown pricing and inventory allocation problem becomes a convex optimization problem.

The Convex Formulation

The optimization problem can be written as:

min⁡{xmℓ}∑ℓ∈L[−Rˉℓ∗(Sℓ)+∑m∈Mcmℓxmℓ]\min_{\{x_{m\ell}\}} \sum_{\ell \in L} \left[ -\bar{R}^*_\ell(S_\ell) + \sum_{m \in M} c_{m\ell} x_{m\ell} \right]

Subject to:

  • ∑ℓxmℓ≤Bm\sum_{\ell} x_{m\ell} \leq B_m (fulfillment center capacity)
  • Sℓ=∑mxmℓS_\ell = \sum_{m} x_{m\ell} (inventory balance)
  • xmℓ≥0x_{m\ell} \geq 0 (non-negativity)

This is a convex minimization problem with linear constraints—a structure that guarantees efficient solvability.

4. The network flow interpretation

The convex optimization problem has a beautiful interpretation as a minimum-cost network flow problem with convex costs.

Network components

  • Supply nodes: Fulfillment centers with inventory BmB_m
  • Demand nodes: Customer groups with revenue functions Rˉℓ∗(Sℓ)\bar{R}^*_\ell(S_\ell)
  • Arcs: Shipping routes with costs cmℓc_{m\ell} per unit
  • Flow: Inventory allocation xmℓx_{m\ell}

The goal is to route inventory from supply to demand nodes to maximize total profit (revenue minus shipping costs).

5. Algorithmic implications

The network flow interpretation enables powerful solution methods:

Efficient Algorithms

Exact Methods

  • • Interior Point Methods: O(n³) complexity
  • • Network Simplex: Often linear in practice
  • • Gradient Descent: Guaranteed convergence

Approximation Methods

  • • Piecewise Linear Approximation: Convert to LP
  • • Sample Average Approximation: Handle uncertainty
  • • Decomposition Methods: Parallelize computation

Scalability

The convex structure enables optimization for:

  • Thousands of SKUs across multiple categories
  • Hundreds of locations or customer segments
  • Multiple time periods in dynamic pricing
  • Uncertain demand through stochastic programming

6. Practical Implementation

Pyomo Implementation

import pyomo.environ as pyo
import numpy as np
 
def optimize_markdown_allocation(fulfillment_capacity, demand_params, shipping_costs):
    """
    Solve the convex markdown optimization problem using Pyomo
    
    Args:
        fulfillment_capacity: dict {m: B_m} for each fulfillment center
        demand_params: dict {ell: (alpha, beta)} for revenue curve R(S) = alpha*S^beta
        shipping_costs: dict {(m, ell): c_m,ell}
    
    Returns:
        Optimal allocations x_m,ell and expected profit
    """
    model = pyo.ConcreteModel()
    
    # Sets
    model.M = pyo.Set(initialize=fulfillment_capacity.keys())  # Fulfillment centers
    model.L = pyo.Set(initialize=demand_params.keys())         # Demand groups
    
    # Parameters
    model.B = pyo.Param(model.M, initialize=fulfillment_capacity)
    model.c = pyo.Param(model.M, model.L, initialize=shipping_costs)
    
    # Decision Variables
    model.x = pyo.Var(model.M, model.L, domain=pyo.NonNegativeReals)
    model.S = pyo.Var(model.L, domain=pyo.NonNegativeReals)    # Total allocation to group ell
    
    # Inventory Balance: S_ell = sum_m x_m,ell
    def inventory_balance_rule(model, ell):
        return model.S[ell] == sum(model.x[m, ell] for m in model.M)
    model.inventory_balance = pyo.Constraint(model.L, rule=inventory_balance_rule)
    
    # Capacity Constraints: sum_ell x_m,ell <= B_m
    def capacity_rule(model, m):
        return sum(model.x[m, ell] for ell in model.L) <= model.B[m]
    model.capacity = pyo.Constraint(model.M, rule=capacity_rule)
    
    # Objective: Maximize Revenue - Shipping Costs
    # Revenue is concave: R_ell(S) = alpha * S^beta with 0 < beta < 1
    def objective_rule(model):
        revenue = sum(
            demand_params[ell][0] * model.S[ell]**demand_params[ell][1]
            for ell in model.L
        )
        shipping = sum(
            model.c[m, ell] * model.x[m, ell]
            for m in model.M for ell in model.L
        )
        return revenue - shipping
    
    model.profit = pyo.Objective(rule=objective_rule, sense=pyo.maximize)
    
    # Solve using Ipopt (handles nonlinear convex problems)
    solver = pyo.SolverFactory('ipopt')
    results = solver.solve(model, tee=False)
    
    # Extract results
    allocations = {(m, ell): pyo.value(model.x[m, ell]) 
                   for m in model.M for ell in model.L}
    total_allocations = {ell: pyo.value(model.S[ell]) for ell in model.L}
    profit = pyo.value(model.profit)
    
    return allocations, total_allocations, profit

Key implementation considerations

  1. Revenue Function Estimation: Use historical sales data to fit concave demand curves
  2. Constraint Handling: Ensure allocations respect physical inventory limits
  3. Numerical Stability: Use log-sum-exp tricks for large-scale problems
  4. Warm Starting: Initialize with previous period's solution for faster convergence

Case Study: Fast Fashion Retailer

A company i have worked with a fashion retailer implemented a similar framework:

MetricBefore (Rule-Based)After (Convex Optimization)Improvement
Sell-through rate78%89%+14%
Computation time6 hours12 minutes30x faster
Manual interventions200/week15/week-92%

Conclusion

The concavity of revenue functions in retail is not just a mathematical curiosity—it's the key property that makes large-scale markdown optimization tractable. By recognizing this structure and leveraging network flow algorithms, retailers can transform complex stochastic problems into efficient, scalable solutions.

The elegance lies in how economic intuition (diminishing returns) leads to mathematical structure (concavity), which enables computational efficiency (convex optimization)—a perfect alignment of theory and practice.

Next Steps

In our next article, we'll explore robust optimization techniques for handling demand uncertainty when the revenue function parameters are not perfectly known, including distributionally robust optimization and scenario-based approaches.

Solutions

About the author

Cyril Noirot

Cyril Noirot

Lead Data Scientist

Freelance data scientist. I design and ship decision systems — forecasting, pricing, marketing measurement, optimization.

Newsletter

Technical writing on forecasting, pricing, and decision systems. No fixed schedule, no spam.

Enter your email
Subscribe