• No results found

Chapter 3 Algorithms

3.3 Algorithms for LCPs

3.3.1 Lemke’s Algorithm

Lemke’s algorithm modifies the LCP with a positivecovering vector dand a positive scalar z0. The scalar z0 becomes a new variable in the modified problem. The

covering vector can be chosen to be any positive vector. The LCP is modified by replacing the matrix equation (2.1) with:

w=M z+q+dz0. (3.1)

We are interested in almost complementary solutions to this modified system. A solution is almost complementary if it hasnbasic variables, and if there is at most one pair of complementary variables that are non-basic in the solution (recall that a variable is basic if it is allowed to be non-negative in the solution). Lemke’s algorithm will compute a sequence of almost complementary solutions to the modified system. An initial almost complementary solution can be found easily. Let e = min(qi/di : 1≤i≤n). If e is positive, then every element of q must be positive, so the LCP has a trivial solution, and the algorithm can terminate. Otherwise, if we set z0 = −e, then we have that setting w = q +dz0 and z = 0 is an almost

complementary solution. The two vectors clearly satisfy Equation 3.1 and they obviously satisfy the complementarity condition. They satisfy the non-negativity constraint, because for each variablewi we havewi=q−d·e≥0. Moreover, for the indexiwhereqi=ewe havewi=q−d·e= 0 and zi = 0. The algorithm proceeds by performing a pivot operation between the variablez0 and the variablewi.

For example, consider the following P-matrix linear complementarity prob- lem: M =   2 1 1 3   , q =   −2 −3   .

If we choose the covering vector to be di = 1 for every i, then we have that min(qi/di : 1 ≤ i ≤ n) is −3. It can easily be verified that if z0 is set to −3,

then q+d·z0 is positive. Moreover, the second component of w is 0. The algo-

rithm would therefore perform a pivot operation between the variable z0 and the

variablew2.

This pivot operation is implemented as follows. To begin, the algorithm constructs the tableaux [I, M, d, q], which is:

  1 0 2 1 1 −2 0 1 1 3 1 3   .

The column associated with z0 is the column that contains the covering vector d,

and the column associated with w2 is the second column of the identity matrix.

These two columns are swapped to obtain the following tableaux:

  1 1 2 1 0 −2 0 1 1 3 1 3   .

The algorithm then performs Gauss-Jordan elimination to transform the first two columns back to an identity matrix. It can easily be seen that subtracting the

second row from the first row will achieve this. Therefore, the algorithm arrives at the following tableaux:

 1 0 1 −2 −1 1 0 1 1 3 1 3   . The new LCP can be read off from this tableaux, to give:

M =   1 −2 1 3   , d=   −1 1   , q =    1 −3   .

In this LCP, the variable z0 is the second variable in w, and the variable w2 is

multiplied by the covering vector d. It can easily be verified that setting w1 = q1,

z0 = 3, and all other variables to 0 gives an almost complementary solution to this

LCP.

We now discuss how Lemke’s algorithm moves from one almost complemen- tary solution to the next. Since each almost complementary solution has exactly n basic variables, one of which will bez0, the solution must contain a complementary

pair of variableswi andzi where bothwi = 0 andzi= 0. One of these variables will be chosen to be the driving variable. In the next almost complementary solution, the driving variable will be basic, and some basic variable in the current solution will be made non-basic. The difficulty is choosing which basic variable in the cur- rent solution can be made non-basic while ensuring that we still have an almost complementary solution. In particular, we want to ensure that all basic variables in the next solution are positive.

In each step of the algorithm our almost complementary solution will have the following form:

xB=M′xN +q′.

WherexB is thendimensional vector of basic variables, xN is then+ 1 dimensional vector of nonbasic variables,M′is annbyn+1 matrix which is the result of applying

pivot operations toM and d, and q′ is the result of applying pivot operations toq.

Suppose that the driving variable ni is the i-th component of xN. In the next solution, we will allow ni to become basic, which means that ni will rise from 0 to some positive value. The question we are interested in is: how far can ni be raised before some basic variable becomes negative? Ifeis thei-th column ofM′, then for each basic variablebj we have:

bj =ej·ni+q′j.

If ej is positive then the value of the basic variable bj will rise as the value of ni rises. On the other hand, if ej is negative then ni can only be increased to −q′j/ej before the variablebj becomes negative.

This gives us the following minimum ratio test to decide which variable should be made non-basic:

min{−qj′/ej : j∈ {1,2, . . . n} and ej <0}. (3.2)

The minimum ratio test gives us the smallest amount that ni can be increased before some basic variable becomes negative. The basic variable bj that achieves this minimum is called theblocking variable. Lemke’s algorithm will perform a pivot operation between the driving variable and the blocking variable.

After the pivot operation has taken place, we can set the driving variable be basic, and the blocking variable to be non-basic. We can then compute a solution to our new system of equations. By using the minimum ratio test, it is guaranteed that all of our basic variables will be positive in this new solution. Moreover, in the previous iteration there was exactly one complementary pair of variables that were non-basic. Since we chose one of those variables to be the driving variable, it follows that there can be at most one pair of complementary variables that are non-basic in the current iteration. Since z0 is still a basic variable, we also have that there

is at least one pair of complementary variables that are non-basic. Therefore, we have arrived at an almost complementary solution, which can be taken into the next iteration.

To complete our description of the algorithm, we must specify which variable will be chosen to be the driving variable in each iteration. As we have noted, there will always be some complementary pair of variableswi and zi that are non-basic. In the first iteration, the algorithm selects zi to be the driving variable. In each subsequent iteration, the algorithm selects the complement of the blocking variable from the previous iteration. The algorithm continues untilz0is the blocking variable.

After this occurs, the variablez0will become non-basic, and a solution to the original

LCP is recovered.

Let us return to our example. In the first iteration the variables w2 and z2

are both non-basic. Sincew2 was pivoted withz0, the algorithm will selectz2 to be

the driving variable in this iteration. The column associated withz2 is the second

column ofM′, which means that the vector ewill be (−2,3). Only the first element of this vector is negative, therefore, the variablew1 must be chosen as the blocking

variable in this iteration. Therefore, the variable z2 will be exchanged with the

variable w1 in a pivot operation to obtain an LCP in which the first element of w

isz2 and the second element of w isz0.

In general, Lemke’s algorithm may not find a solution to the LCP. This is because there may not be a basic variablebj such thatej is negative, and therefore the minimum ratio test given in (3.2) is not well defined. In this situation, no basic variable will ever become negative, no matter how muchnj is increased. If Lemke’s algorithm ever encounters such a situation, then it will give up, and terminate without a solution. This is called ray termination. Fortunately, this situation can never arise when the input matrixM is a P-matrix.

Proposition 3.8 ([CPS92]). If M is a P-matrix, then for every q, Lemke’s algo- rithm will terminate with a solution when it is applied to LCP(M, q).