AI Glossary / Mathematics and optimization / Intermediate

Optimization

Definition

Optimization is the process of choosing allowed values for decision variables to make a stated objective as good as possible. The objective may be minimized, such as cost or prediction error, or maximized, such as useful output. In AI, optimization often adjusts model parameters to improve a training objective while respecting any specified constraints.

What it means

“Better” must have a precise meaning before a computer can optimize it. A delivery business might minimize travel time; a learning system might minimize average prediction loss plus a regularization penalty. Those objectives represent selected priorities, not every aspect of success.

Optimization separates three questions: what may be chosen, what choices are permitted, and how choices are scored. An optimization method then searches for a solution. Changing the objective or permitted choices changes the problem itself, even if the same software is used to solve it.

How it works

Begin by identifying decision variables and their units. Specify the objective, constraints, and data that determine their values. Check whether choices are continuous, discrete, or mixed; whether derivatives exist; and whether useful convex structure is present.

Select a compatible method and obtain a candidate solution. Then check feasibility, the objective value, and the method's stopping information. Some settings permit a certificate or bound showing how close the candidate is to optimal. Others provide only a locally satisfactory point or a heuristic answer.

Finally, examine whether the mathematical result remains useful under uncertain inputs and practical implementation. A perfectly solved model can still recommend a poor real-world decision if important constraints or consequences were omitted. Optimizing training loss likewise does not, by itself, establish performance on new data.

Three practical examples

1. Forecasting: choose regression coefficients that minimize training error, possibly with a penalty that discourages excessively large coefficients.

2. Staffing: assign available workers to permitted shifts while meeting coverage requirements and minimizing a stated combination of costs.

3. Energy management: allocate flexible consumption across time periods to reduce a modeled cost while respecting operational limits.

Think of it this way

Think of planning the lightest possible suitcase that still contains everything required for a trip. Weight is the objective, and required contents are constraints. The analogy has limits: preferences may be difficult to express numerically, and mathematical optimization can involve millions of continuously adjustable values rather than a few discrete items.

Worked example

A workshop needs 12 hours of processing split between two adjustable machines. Let x and y be their respective workloads. Assume x + y = 12, x and y are nonnegative, and modeled operating cost is x² + 2y² in consistent cost units.

Substitute x = 12 − y. The cost becomes (12 − y)² + 2y² = 144 − 24y + 3y². Completing the square gives 3(y − 4)² + 96.

Without further limits, the best allocation is y = 4 and x = 8, with cost 96. Equal allocation, x = y = 6, costs 36 + 72 = 108. Thus “balanced” workload is not necessarily cheapest under the stated cost model.

Now suppose machine X may process at most 7 hours. Since x + y = 12, this requires y ≥ 5. The minimum permitted value of 3(y − 4)² + 96 occurs at y = 5, giving x = 7 and cost 99.

The constraint increases the optimal modeled cost by 3. The unconstrained allocation remains cheaper but is no longer implementable. This hand-checked example uses invented costs and continuous workloads; it does not represent a measured machine-energy curve or a scheduling system with indivisible jobs.

Illustrative case study

Fictional case: Maple Print optimizes daily production using a cost model for two machines. The first formulation omits setup time, so its attractive plan switches products far more often than operators can manage.

The team adds the relevant setup restrictions and compares the revised result with its existing schedule. It records the extra modeled cost and checks whether the plan can actually be executed. Operators also review sensitivity to uncertain demand. The lesson is that better formulation can produce a higher objective value and still be a more useful business decision. No actual savings are claimed.

Common misconceptions and mistakes

Optimization does not necessarily mean reaching a global optimum. A local optimum is best only relative to nearby permitted choices; a global optimum is best across the entire feasible set. The method and problem structure determine what can be claimed.

An objective value is also different from the values of the decision variables that achieve it. Several different decisions may have the same best score. Conversely, some problems have no feasible solution, or their objective can improve indefinitely without a finite optimum.

Do not assume faster hardware fixes a poorly defined objective. It can merely produce an unsuitable answer sooner.

Business use

For business use, agree on what is mandatory and what is negotiable before choosing an optimizer. A mandatory requirement usually belongs in a constraint; a negotiable preference may be represented in the objective. If several priorities conflict, show the tradeoffs rather than hiding them inside unexplained weights.

Keep the input assumptions alongside the recommendation. Review how the chosen plan changes when demand, capacities, or costs change. This makes optimization a decision aid whose limits can be inspected.

People also ask

Is optimization the same as machine learning?

No. Machine learning often uses optimization, while optimization also solves many nonlearning problems.

Does a lower training loss always mean a better model?

No. Generalization and other requirements need separate evaluation.

Can there be several optimal answers?

Yes. Different feasible choices can attain the same best objective value.

Check your understanding

A plan has the lowest cost found but violates a mandatory capacity limit. Is it a feasible solution?

Answer: No. Its favorable objective value does not compensate for violating a hard constraint. It may be useful as a relaxed comparison, but it cannot be presented as the permitted plan.

Related terms

  • Objective function
  • Optimization problem
  • Optimization method
  • Regularization
  • decision variable
  • feasible set
  • local optimum
  • global optimum

Learn next

formulate one familiar allocation decision with explicit units and constraints, then study convex optimization and the distinction between model quality and solver accuracy.

  • Convex optimization

More in Mathematics and optimization

  • Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
  • Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
  • Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
  • Σ-algebra
  • Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
  • Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.

Sources

Primary sources: Boyd and Vandenberghe, Convex Optimization slides, introductory formulation and modeling sections: https://web.stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf ; Aalto Dictionary of Machine Learning, optimization-related entries: https://aaltodictionaryofml.github.io/ADictML_Main.pdf . These passages were read. The allocation example and fictional business case are original illustrations.

Previous: Optimistic knowledge gradient Next: Optimization method

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer