mathematics//optimization

Optimization is the branch of mathematics that finds the values of some decision variables that minimize a cost while respecting constraints, and it is the common engine under estimating, controlling, planning and learning. A Kalman filter minimizes a squared estimation error, an LQR a quadratic control cost, training a network a loss, system identification a prediction error, graph SLAM the inconsistency between measurements, and a fleet dispatcher the total travel time of its robots. Every such problem has three parts: a cost function, the constraints that say what is allowed, and the time available to solve it.


Optimization is the branch of mathematics that finds the values of some decision variables that minimize a cost while respecting constraints, and it is the common engine under estimating, controlling, planning and learning. A Kalman filter minimizes a squared estimation error, an LQR a quadratic control cost, training a network a loss, system identification a prediction error, graph SLAM the inconsistency between measurements, and a fleet dispatcher the total travel time of its robots. Every such problem has three parts: a cost function, the constraints that say what is allowed, and the time available to solve it.

min⁡x  J(x)subject tog(x)≤0,    h(x)=0\min_{x}\; J(x) \quad \text{subject to}\quad g(x)\le 0,\;\; h(x)=0xmin​J(x)subject tog(x)≤0,h(x)=0

The cost JJJ ranks candidates, ggg and hhh fence them in (an actuator limit, a wall, each task done once). What decides the tool is the shape of the problem. When it is convex, with one valley, solvers find the optimum reliably and prove it: least squares, linear programming and the quadratic program inside a linear MPC belong here. When it is smooth with many parameters and no closed form, one walks downhill with gradient descent, or uses curvature with Newton's method, and a sum of squared residuals calls for nonlinear least squares. When each evaluation costs a bench test, Bayesian optimization spends trials sparingly; when evaluations are cheap but the landscape is rough or discrete, an evolutionary algorithm searches with a population and a fitness function. When the choices are discrete (who does which task), the problem is combinatorial; when decisions chain over time, dynamic programming breaks them into stages. Behind several of these, duality supplies prices and certificates of optimality.

Everything is optimization with a different cost. Least squares, maximum likelihood, the Kalman filter, LQR, MPC, training a network, assigning tasks and the Bellman equation share one skeleton; what each field mostly teaches is which cost is reasonable to write and how much time there is to solve it.

One update rule appears in three places. The adaptation law of MRAC, the LMS filter and stochastic gradient descent, and the correction of the Kalman filter all change their numbers by a gain times a prediction error times the signal that multiplies the number. Three communities reached the same rule because they solve the same problem: adjust some numbers until a prediction stops being wrong.

Time decides where the optimizer runs. An LQR is optimized once, offline, and online it is a matrix product of microseconds; an MPC solves a problem every period and must finish before the next one, in the worst case and not on average (real-time computing). A fleet's assignment runs every few seconds on a server, a production plan overnight.

The book attaches a warning to its own pattern: use it to find your bearings in a new problem, then do that problem's arithmetic. Writing a problem as an optimization leaves the cost exactly as right or wrong as it was, and optimizing precisely a wrong model is being wrong precisely; the flyswatter rule asks first whether a simple rule is already close enough.