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

Local vs Global Minima

An optimizer that only looks at the slope beneath it finds the bottom of the valley it starts in, which may not be the deepest valley. You will define local and global minima precisely, use first- and second-order conditions to find and classify critical points, see saddle points and degenerate cases, understand basins of attraction, and use multistart to find all the inverse-kinematics solutions of a robot arm, including the local minima created by obstacles.

Level 0: Foundation

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

The lowest valley vs a low valley

Picture a hilly landscape in thick fog. You can only feel which way is downhill under your feet. Walk downhill and you’ll reach the bottom of a valley: a local minimum. There may be a deeper valley over the next ridge, the global minimum, but you can’t see it from where you’re standing.

Many optimization methods are like that foggy walker. Where you start decides where you end up.

Roll downhill: which valley do you end up in?
basins of attraction (bright = leads to the global minimum)
from x₀ = 4.00 the ball stops at 2.98 (f = -0.348) · global minimum -1.03 (f = -1.008) · 5 local minima
global basin covers 27% of starts → P(k = 5 random starts find it) = 79.9% · this draw's best: -1.03 ✓ global
Gradient-based methods only use local slope, so they stop at whichever valley they start in. Bumpier, higher-frequency landscapes have more and narrower basins. With A = 0 the bowl is convex: one minimum, and every start finds it. Multistart is a simple, honest fix whose cost grows as the global basin shrinks.
Why engineers care

Robot inverse kinematics, trajectory planning around obstacles, neural-network training and satellite orbit design all have many local minima. Knowing whether your problem has them, and how to cope (good starting guesses, multistart, convex reformulations), separates a robust system from one that fails mysteriously.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A local minimum is…
  2. 2. The global minimum is…
  3. 3. A downhill walker usually ends up…

Level 1: Beginner

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

Definitions

For ff on a feasible set F\mathcal F:

  • x⋆x^\star is a global minimizer if f(x⋆)≤f(x)f(x^\star)\le f(x) for all x∈Fx\in\mathcal F.
  • x⋆x^\star is a local minimizer if there’s an ε>0\varepsilon > 0 with f(x⋆)≤f(x)f(x^\star)\le f(x) for all feasible xx with ∥x−x⋆∥<ε\|x - x^\star\| < \varepsilon. It’s strict if the inequality is strict for x≠x⋆x\ne x^\star.

Every global minimizer is local, but not conversely.

Finding candidates in 1-D

At an interior local minimum of a differentiable ff, f′(x⋆)=0f'(x^\star) = 0. This is a critical point. If f′′(x⋆)>0f''(x^\star) > 0 it’s a strict local minimum. If f′′(x⋆)<0f''(x^\star) < 0 it’s a local maximum. If f′′=0f'' = 0 the test is inconclusive: x4x^4 has a minimum at 0, and x3x^3 has an inflection there.

Example: f(x)=x4−3x2+xf(x) = x^4 - 3x^2 + x has local minima at x≈−1.30x\approx-1.30 (global, f≈−3.51f\approx-3.51) and x≈1.13x\approx1.13 (local only, f≈−1.07f\approx-1.07), with a local maximum near 0.17 between them.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Every global minimizer is also…
  2. 2. f′(x) = 0 and f″(x) > 0 means…
  3. 3. f(x) = x³ at x = 0 is…

Level 2: Intermediate

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

In several variables

First-order necessary condition: ∇f(x⋆)=0\nabla f(x^\star) = 0. Second-order: with H=∇2f(x⋆)H = \nabla^2f(x^\star),

  • H≻0H\succ0 (all eigenvalues positive): strict local minimum;
  • H≺0H\prec0: strict local maximum;
  • eigenvalues of both signs: saddle point, going down in some directions and up in others;
  • some eigenvalue zero and the rest of one sign: degenerate, so higher-order terms decide.

In high dimensions, most critical points of a random function are saddles, not minima (Dauphin et al., 2014). That’s a theme in A6.3-8.

Basins of attraction

For a descent method, the basin of attraction of a minimum is the set of starting points that converge to it. Basins depend on the function and the algorithm: a method that takes big steps can hop over ridges. If the global basin occupies a fraction pp of the starting region, then kk independent random starts find it with probability 1−(1−p)k1 - (1 - p)^k. With p=0.1p = 0.1, you need 44 starts for 99%.

Strategies for global optimization

  • Exploit structure: convex problems have no spurious local minima (A6.2).
  • Good initialization from physics, a coarse solution or a learned guess.
  • Multistart / random restarts, keeping the best.
  • Global methods: branch and bound for a certified global optimum, simulated annealing, evolutionary methods (A6.4-3), Bayesian optimization (A6.4-2).
  • Continuation / homotopy: solve a smoothed problem first, then gradually sharpen it.
🐍 Exercise 1: local search and basins
Implement a 1-D pattern search. Find both minima of x⁴ − 3x² + x, and map which starts reach the global one with small and with large initial steps.
📝 Quick check (Level 2)
0/3 answered
  1. 1. A Hessian with eigenvalues (3, −1) indicates…
  2. 2. If the global basin is 20% of starts, P(5 starts find it) =
  3. 3. Basins of attraction depend on…

Level 3: Advanced

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

Proof of the first-order condition

Let x⋆x^\star be an interior local minimum with ff differentiable. For any direction dd and small t>0t > 0, f(x⋆+td)−f(x⋆)≥0f(x^\star + td) - f(x^\star)\ge0. Dividing by tt and letting t→0+t\to0^+ gives ∇f(x⋆)⊤d≥0\nabla f(x^\star)^\top d\ge0. Using −d-d gives ≤0\le0. So ∇f(x⋆)⊤d=0\nabla f(x^\star)^\top d = 0 for all dd, and hence ∇f(x⋆)=0\nabla f(x^\star) = 0. ∎

Proof of the second-order sufficient condition

Taylor: f(x⋆+d)=f(x⋆)+12d⊤Hd+o(∥d∥2)f(x^\star + d) = f(x^\star) + \tfrac12d^\top Hd + o(\|d\|^2). If H≻0H\succ0 with smallest eigenvalue λ>0\lambda > 0, then 12d⊤Hd≥λ2∥d∥2\tfrac12d^\top Hd\ge\tfrac\lambda2\|d\|^2, which dominates the o(∥d∥2)o(\|d\|^2) term for small dd. So f(x⋆+d)>f(x⋆)f(x^\star + d) > f(x^\star). ∎ The necessary condition is weaker (H⪰0H\succeq0). The gap is the degenerate case.

Local = global for convex functions

If ff is convex and x⋆x^\star is a local minimum, suppose some yy has f(y)<f(x⋆)f(y) < f(x^\star). Then points on the segment x⋆+t(y−x⋆)x^\star + t(y - x^\star) satisfy f≤(1−t)f(x⋆)+tf(y)<f(x⋆)f\le(1 - t)f(x^\star) + tf(y) < f(x^\star) for every small tt. That contradicts local minimality. ∎ This is why convexity (A6.2) is so valuable.

Exercise 3.1: Classify the critical points of f(x, y) = x² − y² + y⁴/2

∇f=(2x,−2y+2y3)=0\nabla f = (2x, -2y + 2y^3) = 0 gives x=0x = 0 and y∈{0,±1}y\in\{0, \pm1\}. At (0,0)(0, 0), H=diag⁡(2,−2)H = \operatorname{diag}(2, -2): a saddle. At (0,±1)(0, \pm1), H=diag⁡(2,4)H = \operatorname{diag}(2, 4): two global minima with f=−1/2f = -1/2.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The first-order condition ∇f = 0 is…
  2. 2. For convex f, every local minimum is…
  3. 3. H ⪰ 0 at a critical point is…

Level 4: Expert

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

Inverse kinematics has many minima

A planar 2-link arm reaching a target minimizes ∥fk(θ)−p∥2\|\mathrm{fk}(\theta) - p\|^2. A reachable target has two global minima with zero error: elbow up and elbow down. Both are equally good, and which one you get depends on the start. Add a penalty that keeps the elbow out of an obstacle, and new local minima appear: configurations pushed against the obstacle that can’t slide around it without first getting worse. Multistart finds a collision-free exact solution, but many single starts get stuck. Practical IK solvers (TRAC-IK; Beeson and Ames, 2015) use random restarts for exactly this reason.

🐍 Exercise 2 (research): multistart inverse kinematics
Implement forward kinematics, an IK cost with an obstacle penalty, and n-D compass search with multistart. Find both elbow solutions in free space and measure how often single starts get trapped once the obstacle is added.

Local minima in AI, robotics and aerospace

  • Trajectory optimization (CHOMP, TrajOpt) converges to locally optimal paths. Initialization and restarts matter (Ratliff et al., 2009; Schulman et al., 2014).
  • Neural networks: wide networks have many near-equivalent minima, and saddle points are the main obstacle (Choromanska et al., 2015; Dauphin et al., 2014).
  • Orbit and trajectory design (low-thrust transfers, multiple flybys) is famously multimodal. Global methods and continuation are standard (Izzo, 2010, global trajectory optimization).
  • Pose estimation and SLAM: rotation-averaging problems have spurious minima. Certifiable solvers (SE-Sync) prove global optimality (Rosen et al., 2019).

References

  1. J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 2.
  2. D. Bertsekas (2016). Nonlinear Programming, 3rd ed. Athena Scientific.
  3. Y. Dauphin et al. (2014). “Identifying and attacking the saddle point problem in high-dimensional non-convex optimization.” NeurIPS.
  4. A. Choromanska, M. Henaff, M. Mathieu, G. Ben Arous, Y. LeCun (2015). “The loss surfaces of multilayer networks.” AISTATS.
  5. P. Beeson, B. Ames (2015). “TRAC-IK: an open-source library for improved solving of generic inverse kinematics.” IEEE-RAS Humanoids.
  6. N. Ratliff, M. Zucker, J. A. Bagnell, S. Srinivasa (2009). “CHOMP: gradient optimization techniques for efficient motion planning.” ICRA.
  7. J. Schulman et al. (2014). “Motion planning with sequential convex optimization and convex collision checking.” IJRR, 33(9).
  8. D. Rosen, L. Carlone, A. Bandeira, J. Leonard (2019). “SE-Sync: a certifiably correct algorithm for synchronization over the special Euclidean group.” IJRR, 38(2–3).
  9. D. Izzo (2010). “Global optimization and space pruning for spacecraft trajectory design.” In Spacecraft Trajectory Optimization, Cambridge University Press.
  10. A. Törn, A. Žilinskas (1989). Global Optimization. Springer.