# Barrier function

In constrained optimization, a field of mathematics, a barrier function is a continuous function whose value on a point increases to infinity as the point approaches the boundary of the feasible region (Nocedal and Wright 1999). It is used as a penalizing term for violations of constraints. The two most common types of barrier functions are inverse barrier functions and logarithmic barrier functions. Resumption of interest in logarithmic barrier functions was motivated by their connection with primal-dual interior point method.

## Logarithmic barrier function

This introduces a gradient to the function being optimized which favors less extreme values of $x$ (in this case values lower than $b$ ), while having relatively low impact on the function away from these extremes.

Logarithmic barrier functions may be favored over less computationally expensive inverse barrier functions depending on the function being optimized.

### Higher dimensions

Extending to higher dimensions is simple, provided each dimension is independent. For each variable $x_{i}$ which should be limited to be strictly lower than $b_{i}$ , add $-\log(b_{i}-x_{i})$ .