The * Lemke-Howson Algorithm* follows the edges of a polyhedron, which is implemented algebraically by pivoting as used by the simplex algorithm for solving a linear program. Let us see, if there is an efficient implementation that has no numerical errors by storing integers of arbitrary precision. The constraints defining the polyhedron are thereby represented as linear equations with nonnegative slack variables. For the polytopes P and Q in

P = {x ∈ R^{M}| x ≥ 0, B^{⊤}x ≤ 1},

Q = {y ∈ R^{N} |Ay ≤ 1, y ≥ 0}

these slack variables are nonnegative vectors s ∈ R^{N} and r ∈ R^{M} so that x ∈ P and y ∈ Q iff

B^{⊤}x + s = 1, r + Ay = 1 —– (1)

and

x ≥ 0, s ≥ 0, r ≥ 0, y ≥ 0 —— (2)

A binding inequality corresponds to a zero slack variable. The pair (x, y) is completely labeled iff x_{i}r_{i} = 0 ∀ i ∈ M and y_{j}s_{j} = 0 ∀ j ∈ N, which by (2) can be written as the orthogonality condition

x^{⊤}r = 0, y^{⊤}s = 0

A basic solution to (1) is given by n basic (linearly independent) columns of B^{⊤}x + s = 1 and m basic columns of r + Ay = 1, where the nonbasic variables that correspond to the m respectively n other (nonbasic) columns are set to zero, so that the basic variables are uniquely determined. A basic feasible solution also fulfills (2), and defines a vertex x of P and y of Q. The labels of such a vertex are given by the respective nonbasic columns.

Pivoting is a change of the basis where a nonbasic variable enters and a basic variable leaves the set of basic variables, while preserving feasibility (2).

Integer pivoting always maintains an integer matrix (or “tableau”) of coefficients of a system of linear equations that is equivalent to the original system B^{⊤}x + s = 1, in the form

CB^{⊤}x + Cs = C1 —– (3)

In (3), C is the inverse of the basis matrix given by the basic columns of the original system, multiplied by the determinant of the basis matrix. The matrix C is given by the (integer) cofactors of the basis matrix; the cofactor of a matrix entry is the determinant of the matrix when the row and column of that element are deleted. When each entry has a bounded number of digits (by at most a factor of n log n compared to the original matrix entries), then integer pivoting is a polynomial-time algorithm. It is also superior to using fractions of integers or rational numbers because their cancelation requires greatest common divisor computations that take the bulk of computation time.