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 be the expected optimal revenue obtained when allocating units of inventory to product or market .
Mathematical Foundation
The function is concave in : it increases with inventory but with diminishing slope.
Formally:
Why This Matters
Concavity ensures that:
- Local optima are global optima — no risk of getting stuck in suboptimal solutions
- Gradient-based methods converge — standard optimization algorithms work reliably
- 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:
Subject to:
- (fulfillment center capacity)
- (inventory balance)
- (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
- Demand nodes: Customer groups with revenue functions
- Arcs: Shipping routes with costs per unit
- Flow: Inventory allocation
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, profitKey implementation considerations
- Revenue Function Estimation: Use historical sales data to fit concave demand curves
- Constraint Handling: Ensure allocations respect physical inventory limits
- Numerical Stability: Use log-sum-exp tricks for large-scale problems
- 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:
| Metric | Before (Rule-Based) | After (Convex Optimization) | Improvement |
|---|---|---|---|
| Sell-through rate | 78% | 89% | +14% |
| Computation time | 6 hours | 12 minutes | 30x faster |
| Manual interventions | 200/week | 15/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
Lead Data Scientist
Freelance data scientist. I design and ship decision systems — forecasting, pricing, marketing measurement, optimization.