Pattern library
Optimization patterns
Each pattern is a recurring decision structure with a known way to model and solve it. Full guides follow a ten-part template, from the problem and the formulation through Python and common mistakes. Notes are short, correct references that will grow into guides.
4 full guides · 16 notes · 23 planned
Mathematical programming
Linear and integer models: formulations, linearizations, and the structures solvers exploit.
Linear programming
Optimize a linear objective over linear constraints; the foundation everything else builds on.
Mixed-integer linear programming
Add integrality to model yes/no decisions, setups, and discrete quantities.
Linearization techniques
Rewrite products, logic, absolute values, maxima, and piecewise costs as linear constraints with auxiliary variables, so a mixed-integer linear solver can handle them exactly.
Network flows
Route flow through a network of nodes and capacity-limited arcs at minimum cost — the general pattern underlying transportation, assignment, and many logistics problems.
Knapsack problems
Choose the most valuable subset that fits a capacity; the prototype of combinatorial selection.
Facility location
Decide which facilities to open, and which customers each open facility should serve, to minimize fixed and transportation cost together.
Scheduling
Sequence a set of jobs across shared machines, respecting each job's required operation order, to minimize total completion time.
Decomposition methods
Benders, column generation, and Lagrangian relaxation for models too large to solve whole.
Absolute Value Linearization
Rewrite |x| in an objective or constraint as a pair of linear terms — no binaries required.
Assignment Problem
Match a set of agents to a set of tasks one-to-one at minimum total cost — the simplest combinatorial optimization pattern, and a building block for much bigger ones.
Big-M Method
Turn an "if this binary is on, then this constraint applies" rule into a linear constraint MILP solvers can handle directly.
Chance Constraints
Require a constraint to hold with at least a target probability, rather than always — a way to bake in a service-level target directly.
Indicator Constraints
Express "if binary y = 1, then constraint C holds" natively, without hand-tuning a Big-M constant.
Logical Constraints (AND / OR / XOR)
Encode boolean logic between binary decisions — "at least one of", "exactly one of", "not both" — as linear constraints.
Min/Max Linearization
Represent max(a, b) or min(a, b) as auxiliary variables and linear constraints so they can appear in a MILP.
Piecewise Linear Approximation
Approximate a nonlinear cost or production curve with connected line segments so a linear/MILP solver can still optimize over it.
Transportation Problem
Ship goods from a set of supply points to a set of demand points at minimum cost, respecting supply and demand limits.
Traveling Salesman Problem (TSP)
Find the shortest route that visits every location exactly once and returns to the start — the base case every routing problem builds on.
Two-Stage Stochastic Programming
Make a decision now, observe uncertainty, then make a follow-up decision — optimizing the first-stage choice against the expected cost of every possible second-stage outcome.
Vehicle Routing Problem (VRP)
Route a fleet of capacity-constrained vehicles to serve a set of customers at minimum cost — the workhorse formulation behind most delivery networks.
Sequential decision-making
Decisions that repeat under uncertainty: dynamic programming, MDPs, and policies.
Dynamic programming
Solve a problem by solving each of its overlapping subproblems once and building the answer from them. The same idea, written as the Bellman equation, is the foundation of sequential decision-making.
Markov decision processes
States, actions, transition probabilities, and rewards: the language of sequential decisions.
Approximate dynamic programming
When the state space is too large to enumerate, approximate the value function.
Reinforcement learning
Learn a policy from interaction rather than from a known model.
Policy search
Tune the parameters of a simple decision rule directly against simulated performance.
Simulation-based optimization
Optimize a decision whose consequences can only be evaluated by simulation.
Inventory and supply chain
How much to order, when, and where: the economics of stock under uncertain demand.
Newsvendor model
Choose one order quantity before uncertain demand is known, when every unit short and every unit left over has a cost. The answer is a quantile of demand, set by the ratio of the two costs.
Critical ratio
The ratio of what a shortage costs to the total cost of both mistakes. It tells you which percentile of demand to stock to, and it is why the right service level differs from SKU to SKU.
Economic order quantity
Find the order quantity that minimizes the trade-off between ordering cost and holding cost under steady, known demand.
Safety stock
Buffer stock against demand and lead-time uncertainty, sized by economics rather than habit.
Reorder-point policies
Order when inventory position falls to a threshold: the (s, Q) family.
Order-up-to policies
Review periodically and order back up to a target level: the (R, S) family.
Multi-echelon inventory
Where to hold stock in a network, and why the right answer is rarely everywhere.
Minimum order quantities
What a vendor minimum does to the optimal order, and when to accept it.
Quantity discounts
When a price break is worth the extra stock it forces you to carry.
Stochastic inventory optimization
Multi-period inventory decisions under uncertain demand and lead time.
Algorithms and computational methods
Search, heuristics, and simulation: how answers actually get computed.
Greedy algorithms
Take the locally best step; know exactly when that is globally optimal.
Local search
Improve a solution by small moves; the atomic move defines the algorithm.
Hill climbing
Accept only improving moves, and understand why it stalls.
Simulated annealing
Accept some worsening moves on a cooling schedule to escape local optima.
Bayesian optimization
Optimize an expensive black-box function with a surrogate model and an acquisition rule.
Branch and bound
How MILP solvers prove optimality: relax, branch, and prune with bounds.
Monte Carlo simulation
Estimate expectations and risks by sampling, and know how many samples you need.
No patterns match that filter. Try the site-wide search.