No history yet

Optimization Fundamentals

What Is Optimization?

At its core, optimization is about making the best possible choice. Think about planning a delivery route. You want to find the shortest path that visits all your stops to save time and fuel. Or imagine a factory that makes two types of products. You want to figure out how many of each to produce to make the most profit, given your limited resources. Both of these are optimization problems.

Optimization

noun

A process of finding the best possible solution from a set of available alternatives, measured against a specific goal or criterion.

It’s a formal way of using math to find the maximum or minimum value of something. That “something” could be profit, cost, distance, or efficiency. We do this by modeling a real-world situation with mathematical equations.

The Building Blocks of a Problem

Every optimization problem has two key ingredients: an objective function and a set of constraints. The objective is what you want to achieve, and the constraints are the rules you have to follow.

Objective Function

noun

A mathematical equation that describes the goal of the optimization problem, representing the quantity to be maximized or minimized.

Let's say a bakery makes cakes (xx) and pies (yy). They make a profit of $20 per cake and $30 per pie. Their goal, or objective, is to maximize total profit. We can write this as a simple function:

Maximize P=20x+30y\text{Maximize } P = 20x + 30y

This equation is our objective function. By itself, it suggests we should make infinite cakes and pies. But in reality, we have limits. These limits are our constraints.

Constraint

noun

A rule or limitation, expressed as a mathematical inequality or equality, that a solution to an optimization problem must satisfy.

Constraints define the boundaries of our problem. Maybe the bakery only has enough flour for 60 total items. And perhaps they have a special oven that can bake at most 40 cakes and 30 pies per day. We can express these as mathematical inequalities:

x+y60x40y30x0y0\begin{aligned} \\ x + y & \le 60 \\ x & \le 40 \\ y & \le 30 \\ x & \ge 0 \\ y & \ge 0 \\ \end{aligned}

Finding the Feasible Region

When we plot all of our constraints on a graph, they fence off an area. This area is called the feasible region. It contains every possible combination of cakes and pies the bakery can produce. Any point outside this region is impossible because it violates at least one constraint. The optimal solution, the one that maximizes profit, will always lie somewhere within this region, typically at one of its corners.

The final step in optimization is to evaluate the objective function (P=20x+30yP = 20x + 30y) at each corner point of this region to see which one gives the highest profit. This is the essence of finding an optimal solution.

Types of Optimization Problems

Not all optimization problems look like our bakery example. They come in several flavors, depending on the nature of the objective function and constraints.

Problem TypeObjective Function & ConstraintsExample Variables
Linear Programming (LP)All are linear equations.Amount of a resource to use, quantity of a product to make.
Nonlinear Programming (NLP)At least one is a nonlinear equation.Engine efficiency as a function of temperature and pressure.
Integer Programming (IP)Variables must be integers (whole numbers).Number of employees to hire, number of airplanes to build.
Mixed-Integer Programming (MIP)A mix of integer and non-integer variables.Deciding which factories to open (integer) and how much each produces (continuous).

The bakery problem is a classic example of Linear Programming because the objective function and all the constraints are straight lines. If, for instance, the profit per cake changed depending on how many you sold (e.g., volume discounts), the problem would become nonlinear. If you could only produce whole cakes and pies, it would be an Integer Programming problem.

Understanding these fundamentals—objective, constraints, and problem type—is the first and most critical step. It allows you to correctly model a real-world problem before you try to solve it.