In
mathematics, a 'global optimum' is a selection from a given domain which yields either the highest value or lowest value (depending on the objective), when a specific
function is applied. For example, for the function
:''f''(''x'') = −''x''
2 + 2,
defined on the
real numbers, the global optimum occurs at ''x'' = 0, when ''f''(''x'') = 2. For all other values of ''x'', ''f''(''x'') is smaller.
For purposes of
optimization, a function must be defined over the whole domain, and must have a range which is a
totally ordered set, in order that the evaluations of distinct domain elements are comparable.
By contrast, a 'local optimum' is a selection for which ''neighboring'' selections yield values that are not greater. The concept of a
local optimum implies that the domain is a
metric space or
topological space, in order that the notion of "neighborhood" should be meaningful.