Optimization is an integral part of everyday life, often working seamlessly in the background of various familiar scenarios. It guides route planning in navigation apps like Google Maps to find the quickest path, shapes our online shopping experiences by comparing prices across platforms, and manages energy efficiency in homes through smart thermostats. Airlines optimize complex schedules for flights and crews, while personal fitness trackers tailor workout and diet plans to individual goals. Streaming services like Netflix adjust video quality based on internet speed for a smoother experience, social media platforms like Facebook curate personalized feeds, and manufacturing companies streamline production and inventory to match demand efficiently.
An optimization problem is typically expressed in the form of a function that needs to be maximized or minimized. This function is known as the objective function. The formal structure of an optimization problem can be outlined as:
Objective Function: This is the function we want to optimize. It is denoted as $f(x)$, where $x$ represents the decision variables of the function which can be adjusted to reach the goal i.e., to find the optimal value of $x$ that either maximizes or minimizes $f(x)$: $\max_x \quad f(x)$ or $\min_x \quad f(x)$.
For instance, consider $f(x) = (x-3)^2$.
Constraints: These are the limitations or conditions that the solution must satisfy. They are often represented as equations or inequalities involving the variables of the function. Constraints define the feasible region within which the optimal solution must subject to: $\text{s.t.} \quad g_i(x)≤0,h_j(x)=0$. Here, $g_i(x)$ and $h_j(x)$ represent the inequality and equality constraints, respectively.
For instance, consider $f(x) = (x-3)^2$ and $x \leq 2$:
A small bakery wants to determine the optimal number of loaves of bread to produce each day in order to maximize its daily profit. The bakery produces two types of bread: white bread and whole wheat bread.
However, the bakery has limited resources, including flour and oven space.
The objective is to maximize the profit $G$. We can model such objective and the limited resources using the notations below:
Decision Variables: Decision variables represent the aspects of the problem we can control or adjust in order to influence the outcome – in this case, the bakery's profit $G$. In our example, the key decision variables are:
Constraints: In our bakery example, the constraints are related to resource limitations, specifically flour availability and oven capacity: