Foundations to Frontier
Tests
A. Mathematical Foundations › A6 Optimization › Foundations

Formulating Optimization Problems: Objectives and Constraints

Every optimizer needs a problem written in a standard shape: decision variables, an objective to minimize, and constraints that define the feasible set. You will learn to translate engineering goals into that form, convert maximization, inequalities and absolute values into standard ones, recognize problem classes (LP, QP, nonlinear, integer), see why the formulation matters as much as the algorithm, and allocate spacecraft thrusters as a linear program.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Making the best choice within the rules

A rover has one day. Driving costs a lot of battery, and doing science costs a little. How many hours of each should it spend? This is an optimization problem. It has three parts:

  1. Decisions you control: the hours of driving and of science.
  2. A goal to make as good as possible: the most useful day.
  3. Rules you must obey: the battery can’t run out, and there are only 8 hours of daylight.

All the plans that obey the rules are the feasible plans. The best feasible plan is the optimum.

Plan a rover's day: variables, constraints, objective
x: drive hoursy: science hours
optimum x = 0.00, y = 8.00 · active constraints: time x + y ≤ 8; x ≥ 0
Shaded: the feasible set, all plans that satisfy every constraint. Dashed: level sets of the objective. With a linear objective the best plan is always at a corner of the polygon; tilting w makes it jump between corners. With a quadratic objective the optimum is the unconstrained target if feasible (no active constraints), otherwise the closest feasible point on the boundary. Loosening an inactive constraint changes nothing.
Why engineers care

Trajectory design, thruster allocation, controller tuning, training a neural network and scheduling a telescope are all optimization problems. Writing them down precisely is often the hardest and most valuable step. A good formulation can be solved reliably in milliseconds, and a bad one may be unsolvable.

📝 Quick check (Level 0)
0/3 answered
  1. 1. The quantities you get to choose are the…
  2. 2. Plans that obey all the rules are…
  3. 3. The optimum is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Standard form

min⁡x∈Rn f(x)s.t. gi(x)≤0,i=1,…,mhj(x)=0,j=1,…,p\begin{aligned}\min_{x\in\mathbb R^n}\ & f(x)\\ \text{s.t.}\ & g_i(x)\le0,\quad i = 1, \dots, m\\ & h_j(x) = 0,\quad j = 1, \dots, p\end{aligned}
  • ff is the objective (cost or loss). gig_i are inequality constraints and hjh_j are equality constraints.
  • The feasible set is F={x:gi(x)≤0, hj(x)=0}\mathcal F = \{x : g_i(x)\le0,\ h_j(x) = 0\}. The optimal value is p⋆=inf⁡x∈Ff(x)p^\star = \inf_{x\in\mathcal F}f(x).
  • If F\mathcal F is empty the problem is infeasible. If p⋆=−∞p^\star = -\infty it’s unbounded.

Standard tricks

  • Maximize u(x)u(x) by minimizing −u(x)-u(x).
  • Write g(x)≥bg(x)\ge b as b−g(x)≤0b - g(x)\le0.
  • An equality is two inequalities: h≤0h\le0 and −h≤0-h\le0.
  • A constraint is active at xx if gi(x)=0g_i(x) = 0. Inactive constraints could be deleted without changing the local solution.
📝 Quick check (Level 1)
0/3 answered
  1. 1. To maximize u(x) in standard form, you minimize…
  2. 2. x₁ + x₂ ≥ 3 in standard form is…
  3. 3. An empty feasible set means the problem is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Problem classes

Class Objective Constraints Typical solver
Linear program (LP) linear linear simplex, interior point
Quadratic program (QP) convex quadratic linear active set, interior point, OSQP
Nonlinear program (NLP) smooth smooth SQP, interior point (IPOPT)
Mixed-integer (MILP/MINLP) any some variables integer branch and bound
Unconstrained smooth none gradient descent, Newton (A6.1-3, A6.1-4)

Convex problems (A6.2) have no bad local minima, so recognizing them is worth a lot.

Reformulation tricks

  • Absolute values and L1: min⁡∑i∣ai⊤x−bi∣\min\sum_i|a_i^\top x - b_i| becomes an LP. Introduce tit_i with −ti≤ai⊤x−bi≤ti-t_i\le a_i^\top x - b_i\le t_i and minimize ∑ti\sum t_i.
  • Minimax: min⁡max⁡ifi(x)\min\max_i f_i(x) becomes min⁡t\min t s.t. fi(x)≤tf_i(x)\le t (the epigraph form).
  • Slack variables: Ax≤bAx\le b becomes Ax+s=bAx + s = b with s≥0s\ge0.
  • Penalties: move a constraint into the objective as f+μ∑max⁡(0,gi)2f + \mu\sum\max(0, g_i)^2. This is approximate unless μ→∞\mu\to\infty.
  • Scaling: choose units so the variables and constraints are of order 1. It’s crucial for numerical solvers.

Multiple objectives

Mass vs energy, speed vs safety: there’s usually no single best point, only the Pareto front of plans that can’t improve one objective without worsening another. Scalarize with weights, min⁡w1f1+w2f2\min w_1f_1 + w_2f_2, or with an ε\varepsilon-constraint, min⁡f1\min f_1 s.t. f2≤εf_2\le\varepsilon.

🐍 Exercise 1: solve small problems by brute force
Grid-search 2-D constrained problems. Find the optimum, list the active constraints, and see that an LP optimum is a vertex while a loose constraint changes nothing.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Minimizing Σ|aᵢᵀx − bᵢ| can be written as…
  2. 2. The epigraph trick turns min max fᵢ into…
  3. 3. A Pareto-optimal point…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Existence of a minimizer

Weierstrass: a continuous ff on a nonempty compact (closed and bounded) feasible set attains its minimum. Without compactness, a minimizer may not exist: min⁡ex\min e^x over R\mathbb R has p⋆=0p^\star = 0 but no minimizer. Coercivity (f(x)→∞f(x)\to\infty as ∥x∥→∞\|x\|\to\infty) on a closed set also guarantees existence: some sublevel set is compact and nonempty.

Why LP optima sit at vertices

A linear objective on a polytope: any feasible point is a convex combination of vertices, x=∑λkvkx = \sum\lambda_kv_k, so c⊤x=∑λkc⊤vk≥min⁡kc⊤vkc^\top x = \sum\lambda_kc^\top v_k\ge\min_kc^\top v_k. ∎ For Bu=wBu = w, u≥0u\ge0 with B∈Rm×nB\in\mathbb R^{m\times n}, vertices are basic feasible solutions with at most mm nonzero entries. The simplex method walks between them.

Equivalent problems aren’t equally easy

min⁡∥Ax−b∥2\min\|Ax - b\|_2 and min⁡∥Ax−b∥22\min\|Ax - b\|_2^2 have the same minimizers, but the squared version is smooth and has the closed form x=(A⊤A)−1A⊤bx = (A^\top A)^{-1}A^\top b. Replacing x∈{0,1}x\in\{0, 1\} by 0≤x≤10\le x\le1 (a relaxation) gives a lower bound that’s easy to compute. That’s the foundation of branch and bound (A6.4-5).

Exercise 3.1: Write the L∞ fit as an LP

min⁡xmax⁡i∣ai⊤x−bi∣\min_x\max_i|a_i^\top x - b_i| becomes min⁡x,tt\min_{x, t}t s.t. −t≤ai⊤x−bi≤t-t\le a_i^\top x - b_i\le t for all ii. That’s n+1n + 1 variables and 2m2m linear constraints.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Weierstrass guarantees a minimizer when f is continuous and the feasible set is…
  2. 2. min eˣ over ℝ has…
  3. 3. A basic feasible solution of Bu = w (B is 3×6) has at most how many nonzeros?

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Thruster allocation on a spacecraft

A planar spacecraft has 6 thrusters that can only push. A controller requests a wrench w=(Fx,Fy,τ)w = (F_x, F_y, \tau). Find thrusts u≥0u\ge0 with Bu=wBu = w.

  • Least-norm formulation u=B+wu = B^+w: it’s elegant but ignores u≥0u\ge0, so some thrusters are asked to pull. Clipping fixes the signs and breaks the wrench.
  • LP formulation min⁡∑u\min\sum u s.t. Bu=wBu = w, u≥0u\ge0: this minimizes fuel and is feasible. Its optimum fires at most 3 thrusters. Real attitude-control systems solve this kind of LP or QP at every control step (Bodson, 2002, control allocation).
🐍 Exercise 2 (research): thruster allocation as an LP
Compare the minimum-norm allocation with a fuel-optimal LP solved by enumerating vertices. Check feasibility, sparsity and what clipping does to the wrench.

Formulation in AI, robotics and aerospace

  • Trajectory optimization: direct collocation and multiple shooting turn optimal control into a large sparse NLP (Betts, 2010). Lossless convexification makes powered-descent landing a convex SOCP solved on board (Açıkmeşe and Ploen, 2007).
  • Model predictive control solves a QP every few milliseconds, which needs a formulation that stays well-posed (OSQP; Stellato et al., 2020).
  • Machine learning is empirical-risk minimization: min⁡θ1n∑ℓ(fθ(xi),yi)+λR(θ)\min_\theta\frac1n\sum\ell(f_\theta(x_i), y_i) + \lambda R(\theta).
  • Scheduling and planning (telescope time, Deep Space Network antennas) are mixed-integer programs.

References

  1. S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. Ch. 1 and 4.
  2. J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 1 and 12.
  3. D. Bertsimas, J. Tsitsiklis (1997). Introduction to Linear Optimization. Athena Scientific.
  4. G. Dantzig (1963). Linear Programming and Extensions. Princeton University Press.
  5. M. Bodson (2002). “Evaluation of optimization methods for control allocation.” Journal of Guidance, Control, and Dynamics, 25(4).
  6. J. Betts (2010). Practical Methods for Optimal Control and Estimation Using Nonlinear Programming, 2nd ed. SIAM.
  7. B. Açıkmeşe, S. Ploen (2007). “Convex programming approach to powered descent guidance for Mars landing.” Journal of Guidance, Control, and Dynamics, 30(5).
  8. B. Stellato, G. Banjac, P. Goulart, A. Bemporad, S. Boyd (2020). “OSQP: an operator splitting solver for quadratic programs.” Mathematical Programming Computation, 12.
  9. K. Miettinen (1999). Nonlinear Multiobjective Optimization. Kluwer.
  10. A. Wächter, L. Biegler (2006). “On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming.” Mathematical Programming, 106.