Pedro's dev blog

What is Mathematical Optimization?

Published on
Published on
/3 mins read/---

What is Mathematical Optimization?

Mathematical optimization is a broad term describing a way of mathematically representing decision problems and then solving them using dedicated algorithms.

The Three Parts of an Optimization Model

Every optimization model has three core components:

1. Decision Variables

The decision variables correspond to actions or choices we can make:

  • Whether to open a new manufacturing facility
  • Which supply routes to use
  • At what prices to sell our products

2. Objective Function

The objective function evaluates a specific solution — a specific assignment of values to the decision variables. It always has a direction:

  • Minimize: operational costs, waste, delivery time
  • Maximize: profit, number of satisfied customers, throughput

3. Constraints

Constraints restrict the possible values of the decision variables — conditions that must be satisfied:

  • A maximum allowed budget
  • All demand from critical customers must be met
  • Warehouse capacities cannot be exceeded

The constraints define the feasible region: the set of all candidate solutions that satisfy every constraint.


The Goal

The objective is to find the global optimum — the best solution among all feasible candidates.

Formally, for a minimization problem:

\min_{x \in \mathcal{F}} f(x)

where \mathcal{F} is the feasible region. For maximization, we flip the condition. A solution x^* is optimal if it is at least as good as every other feasible solution.


Three Skills Required

Applied mathematical optimization demands three types of skill:

SkillQuestion
ModelingWhat to include in the model?
FormulationHow to express it mathematically?
InterpretationHow to translate the solution back to reality?

These are not sequential steps — they form a continuous loop. If the solution turns out to be impractical, revise the model. If a desired property can't be modeled efficiently, reconsider the scope.

A mathematical model is a tool, not a goal. It is always a simplification — the challenge is making it useful.


Types of Optimization Problems

Different types of objective functions and feasible regions lead to different problem classes:

  • Linear Programming (LP) — objective and constraints are linear
  • Integer Programming (IP / MIP) — some or all variables are integers
  • Nonlinear Programming (NLP) — nonlinear objective or constraints
  • Stochastic Optimization — uncertainty in parameters
  • Combinatorial Optimization — discrete solution spaces (e.g. routing, scheduling)

Example: Production Planning

A classic entry point is production planning: given limited resources (labor, materials, machine time), decide how much of each product to manufacture in order to maximize profit while respecting capacity constraints.

# Example using PuLP (linear programming)
import pulp
 
prob = pulp.LpProblem("production_planning", pulp.LpMaximize)
 
x1 = pulp.LpVariable("product_1", lowBound=0)
x2 = pulp.LpVariable("product_2", lowBound=0)
 
# Objective: maximize profit
prob += 5 * x1 + 4 * x2
 
# Constraints
prob += 6 * x1 + 4 * x2 <= 24   # machine hours
prob += x1 + 2 * x2 <= 6         # labor hours
 
prob.solve()
 
print(f"Product 1: {x1.value()}")
print(f"Product 2: {x2.value()}")
print(f"Max profit: {pulp.value(prob.objective)}")

Further Reading

ConnectionsFull graph →