# Mehrotra predictor–corrector method

Mehrotra's predictor–corrector method in optimization is a specific interior point method for linear programming. It was proposed in 1989 by Sanjay Mehrotra.
The method is based on the fact that at each iteration of an interior point algorithm it is necessary to compute the Cholesky decomposition (factorization) of a large matrix to find the search direction. The factorization step is the most computationally expensive step in the algorithm. Therefore, it makes sense to use the same decomposition more than once before recomputing it.
At each iteration of the algorithm, Mehrotra's predictor–corrector method uses the same Cholesky decomposition to find two different directions: a predictor and a corrector.
The idea is to first compute an optimizing search direction based on a first order term (predictor). The step size that can be taken in this direction is used to evaluate how much centrality correction is needed. Then, a corrector term is computed: this contains both a centrality term and a second order term.
The complete search direction is the sum of the predictor direction and the corrector direction.
Although there is no theoretical complexity bound on it yet, Mehrotra's predictor–corrector method is widely used in practice. Its corrector step uses the same Cholesky decomposition found during the predictor step in an effective way, and thus it is only marginally more expensive than a standard interior point algorithm. However, the additional overhead per iteration is usually paid off by a reduction in the number of iterations needed to reach an optimal solution. It also appears to converge very fast when close to the optimum.

## Derivation

The derivation of this section follows the outline by Nocedal and Wright.

### Predictor step - Affine scaling direction

A linear program can always be formulated in the standard form
${\begin{aligned}&{\underset {x}{\min }}&q(x)&=c^{T}x,\\&{\text{s.t.}}&Ax&=b,\\&\;&x&\geq 0,\end{aligned}}$
where $c\in \mathbb {R} ^{n\times 1},\;A\in \mathbb {R} ^{m\times n}$ and $b\in \mathbb {R} ^{m\times 1}$ define the problem with $m$ constraints and $n$ equations while $x\in \mathbb {R} ^{n\times 1}$ is a vector of variables.
The Karush-Kuhn-Tucker (KKT) conditions for the problem are
${\begin{aligned}A^{T}\lambda +s&=c,\;\;\;{\text{(Lagrange gradient condition)}}\\Ax&=b,\;\;\;{\text{(Feasibility condition)}}\\XSe&=0,\;\;\;{\text{(Complementarity condition)}}\\(x,s)&\geq 0,\end{aligned}}$
where $X={\text{diag}}(x)$ and $S={\text{diag}}(s)$ whence $e=(1,1,\dots ,1)^{T}\in \mathbb {R} ^{n\times 1}$.
These conditions can be reformulated as a mapping $F:\mathbb {R} ^{2n+m}\rightarrow \mathbb {R} ^{2n+m}$ as follows
${\begin{aligned}F(x,\lambda ,s)={\begin{bmatrix}A^{T}\lambda +s-c\\Ax-b\\XSe\end{bmatrix}}&=0\\(x,s)&\geq 0\end{aligned}}$
The predictor-corrector method then works by using Newton's method to obtain the affine scaling direction. This is achieved by solving the following system of linear equations
$J(x,\lambda ,s){\begin{bmatrix}\Delta x^{\text{aff}}\\\Delta \lambda ^{\text{aff}}\\\Delta s^{\text{aff}}\end{bmatrix}}=-F(x,\lambda ,s)$
where $J$, defined as
$J(x,\lambda ,s)={\begin{bmatrix}\nabla _{x}F&\nabla _{\lambda }F&\nabla _{s}F\end{bmatrix}},$
is the Jacobian of F.
Thus, the system becomes
${\begin{bmatrix}0&A^{T}&I\\A&0&0\\S&0&X\end{bmatrix}}{\begin{bmatrix}\Delta x^{\text{aff}}\\\Delta \lambda ^{\text{aff}}\\\Delta s^{\text{aff}}\end{bmatrix}}={\begin{bmatrix}-r_{c}\\-r_{b}\\-XSe\end{bmatrix}},\;\;\;r_{c}=A^{T}\lambda +s-c,\;\;\;r_{b}=Ax-b$

### Centering step

The average value of the products $x_{i}s_{i},\;i=1,2,\dots ,n$ constitute an important measure of the desirability of a certain set $(x^{k},s^{k})$ (the superscripts denote the value of the iteration number, $k$, of the method). This is called the duality measure and is defined by
$\mu ={\frac {1}{n}}\sum _{i=1}^{n}x_{i}s_{i}={\frac {x^{T}s}{n}}.$
For a value of the centering parameter, $\sigma \in [0,1],$ the centering step can be computed as the solution to
${\begin{bmatrix}0&A^{T}&I\\A&0&0\\S&0&X\end{bmatrix}}{\begin{bmatrix}\Delta x^{\text{cen}}\\\Delta \lambda ^{\text{cen}}\\\Delta s^{\text{cen}}\end{bmatrix}}={\begin{bmatrix}-r_{c}\\-r_{b}\\-XSe+\sigma \mu e\end{bmatrix}}$

### Corrector step

Considering the system used to compute the affine scaling direction defined in the above, one can note that taking a full step in the affine scaling direction results in the complementarity condition not being satisfied:
$\left(x_{i}+\Delta x_{i}^{\text{aff}}\right)\left(s_{i}+\Delta s_{i}^{\text{aff}}\right)=x_{i}s_{i}+x_{i}\Delta s_{i}^{\text{aff}}+s_{i}\Delta x_{i}^{\text{aff}}+\Delta x_{i}^{\text{aff}}\Delta s_{i}^{\text{aff}}=\Delta x_{i}^{\text{aff}}\Delta s_{i}^{\text{aff}}\neq 0.$
As such, a system can be defined to compute a step that attempts to correct for this error. This system relies on the previous computation of the affine scaling direction.
${\begin{bmatrix}0&A^{T}&I\\A&0&0\\S&0&X\end{bmatrix}}{\begin{bmatrix}\Delta x^{\text{cor}}\\\Delta \lambda ^{\text{cor}}\\\Delta s^{\text{cor}}\end{bmatrix}}={\begin{bmatrix}0\\0\\-\Delta X^{\text{aff}}\Delta S^{\text{aff}}e\end{bmatrix}}$

### Aggregated system - Center-corrector direction

The predictor, corrector and centering contributions to the system right hand side can be aggregated into a single system. This system will depend on the previous computation of the affine scaling direction, however, the system matrix will be identical to that of the predictor step such that its factorization can be reused.
The aggregated system is
${\begin{bmatrix}0&A^{T}&I\\A&0&0\\S&0&X\end{bmatrix}}{\begin{bmatrix}\Delta x\\\Delta \lambda \\\Delta s\end{bmatrix}}={\begin{bmatrix}-r_{c}\\-r_{b}\\-XSe-\Delta X^{\text{aff}}\Delta S^{\text{aff}}e+\sigma \mu e\end{bmatrix}}$
The predictor-corrector algorithm then first computes the affine scaling direction. Secondly, it solves the aggregated system to obtain the search direction of the current iteration.

## Adaptive selection of centering parameter

The affine scaling direction can be used to define a heuristic to adaptively choose the centering parameter as
$\sigma =\left({\frac {\mu _{\text{aff}}}{\mu }}\right)^{3},$
where
${\begin{aligned}\mu _{\text{aff}}&=(x+\alpha _{\text{aff}}^{\text{pri}}\Delta x^{\text{aff}})^{T}(s+\alpha _{\text{aff}}^{\text{dual}}\Delta s^{\text{aff}})/n,\\\alpha _{\text{aff}}^{\text{pri}}&=\min \left(1,{\underset {i:\Delta x_{i}^{\text{aff}}<0}{\min }}-{\frac {x_{i}}{\Delta x_{i}^{\text{aff}}}}\right),\\\alpha _{\text{aff}}^{\text{dual}}&=\min \left(1,{\underset {i:\Delta s_{i}^{\text{aff}}<0}{\min }}-{\frac {s_{i}}{\Delta s_{i}^{\text{aff}}}}\right),\end{aligned}}$
Here, $\mu _{\text{aff}}$ is the duality measure of the affine step and $\mu$ is the duality measure of the previous iteration.

## Step lengths

In practical implementations, a version of line search is performed to obtain the maximal step length that can be taken in the search direction without violating nonnegativity, $(x,s)\geq 0$.

## Adaptation to Quadratic Programming

Although the modifications presented by Mehrotra were intended for interior point algorithms for linear programming, the ideas have been extended and successfully applied to quadratic programming as well.