Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Optimization asks us to:

Find x\mathbf{x} that minimizes f(x)f(\mathbf{x}) subject to g(x)=0\mathbf{g}(\mathbf{x}) = \mathbf{0} and h(x)≥0\mathbf{h}(\mathbf{x}) \ge \mathbf{0}

  • ff is the objective function and typically a scalar

  • g(x)\mathbf{g}(\mathbf{x}) is a list of equality constraints

  • h(x)\mathbf{h}(\mathbf{x}) is a list of inequality constraints

  • Maximization for ff is merely minimization of −f-f.

  • Optimization differs from root finding in the constraints and smoothness of ff.

We saw with root finding that using gradient information to help search algorithms has important benefits. That remains true in optimization, but since they are often high dimensional (x\mathbf{x} is a large vector), and ff is not necessarily well behaved, great value is placed on methods that do not require (direct) gradient / Hessian calculations.

Local vs Global minima

Even in 1D, optimization is confounded by local minima. The lowest of the local minima is the global minimum.

There is no good way to ensure a local minimum is a global one without calculating and comparing them all!

There are lots of algorithms that attempt to find the global minimum. They either:

  • launch multiple minimizers over the range of arguments

  • typically involve perturbing good solutions in an attempt to escape from local minima basins.

Interestingly, many of these methods are modelled after nature! (Why?)

  • Genetic algorithms - mutations, cross-overs, selection

  • Simulated annealing - metallurgical process that accepts worse solutions

  • Particle swarm - mimics swarming behaviour to track multiple solutions

  • Amoeba search (which we will talk about)

Introduction of constraints can further complicate things since sometimes the minimum is at a bound!

Example: local and global minima

Minimize f(x)=x2−cos⁡(5x)f(x) = x^2 - \cos(5 x)

Example: Eggholder surfaces

Minimize ysin⁡(∣x+y∣)+xsin⁡(∣x−y∣)y \sin(\sqrt{|x + y|}) + x \sin(\sqrt{|x - y|})

Example: Constrained minimization

Minimize −x2+x-x^2 + x such that ∣x∣≤1|x| \le 1