Multiplying throughout byD, we get the increment in the original coordinate system as
x=ασDˆcp (4.49)
After the move is made to the new point, the process is repeated. The process is repeated until the function value converges to a maximum.
In the implementation of the interior method, an interior starting point satisfy- ing the constraints is needed. This poses some problems when equality constraints are present. Two phase approach presented earlier can be used here. This has been implemented in the program LPINTER. This program works with the same data set as that for the earlier programs. The program uses the Gauss elimination approach for equation solving at each iteration. No attempt has been made to introduce more efficient updating schemes to exploit the special structure of the matrices.
4.14 Quadratic Programming (QP) and the Linear
4.14 Quadratic Programming and the Linear Complementary Problem 177 We denote
w= u y
, z= x
v
, q= c
b
, M= Q AT
−A 0
(4.52) On rearranging the terms in Eq. 4.51 and introducing Eq. 4.52, we get the standard form for which an elegant solution is available.
w−Mz=q wTz=0
[w,z]≥0 (4.53)
From Wierstraas existence theorem (Chapter 1), we note that if the constraints in (4.53) define a bounded set, a solution will exist (the≤ensures closedness of the set, and a quadratic objective functioniscontinuous). However, numerical meth- ods may not be able to determine a solution necessarily. If the HessianQis pos- itive semidefinite, then the objective is convex and the problem is convex, which greatly increases the success rate of numerical methods. We assume here thatQis positive semidefinite, which makesMpositive semidefinite. This together with the assumption of boundedness of the feasible set guarantees that Lemke’s algorithm converges in finite number of steps (i.e., finite number of pivot operations). Further, for convex problems, any local minimum is also the global minimum. Of course, there are techniques, such as presented in Chapter 5 that can converge to a local minimum whenQ is not positive semidefinite, although not in a finite number of steps.
Firstly, note that if allqi≥0, thenw=q,z=0satisfies (4.53), and is hence the solution. Thus, it is understood that one or moreqi<0. Lemke introduces artificial variablez0to set up a tableau for the set of equations
Iw−Mz−ez0=q (4.54)
wheree=[1 1 . . . 1]T, andIis the identity matrix. In the above tableau, we start with an initial basic feasible solutionw=q+ez0andz=0.z0is chosen to be equal to the most negative component ofq. Letqs=minqi<0. This choice ofz0 ensures that the initial choice ofwis nonnegative. The algorithm consists of an “initial step”
followed by “typical steps”. In the initial step, a pivot operation is performed to bringz0into the basis and letwsleave the basis. Thereafter, the nonbasic variable that enters the basis is selected as thecomplement of the basic variable that just left the basis in the previous tableau. Thus, ifwr leaves the basis, then zr enters in the next tableau or vice versa, which maintains the complementarity condition wrzr=0.
Lemke’s Algorithm for LCP
Step 1:z0 enters basis,wi corresponding to most negativeqiexits the basis. If there is no negativeqi, then solution isz0=0,w=q,z=0. No further steps are necessary.
Step 2: Perform the elementary row operations (pivot operations) for column z0and rowi. All elements ofqare now nonnegative.
Step 3: Since basic variable in row i exited the basis, its complement, say, in columnjenters the basis. (At first, iterationwi exits andzienters basis.) Step 4: Perform the ratio test for column j to find the least qi/(positive row
elementi). The basic variable corresponding to rowinow exits the basis. If there are no positive row elements, there is no solution to the LCP. We call this theray solution, and terminate the calculations.
Step 5: Perform the elementary row operations to make the pivot 1 and other elements in the column zero. If the last operation results in the exit of the basic variablez0, then the cycle is complete, STOP. If not go to Step 3.
The above steps have been implemented in the program QPLCP. Linear program- ming problems can also be solved using LCP formulation by settingQ=0.
Example 4.6
minimize x12+ x22−3x1x2−6x1+5x2
subject to x1+ x2≤ 4 3x1+6x2≤20 x1 ≥0,x2≥0 Solution:
For this problem,Q= 2 −3
−3 2
c= −6 5
A= 1 1 3 6
b= 4 20
Above data are input into the data statements in the program QPLCP. The tableaus are given below. The tableaus have been obtained by adding a few print statements in the included program.
Initial Tableau
w1 w2 w3 w4 z1 z2 z3 z4 z0 q
w1 1.000 0.000 0.000 0.000 −2.000 3.000 −1.000 −3.000 −1.000 −6.000 w2 0.000 1.000 0.000 0.000 3.000 −2.000 −1.000 −6.000 −1.000 5.000 w3 0.000 0.000 1.000 0.000 1.000 1.000 0.000 0.000 −1.000 4.000 w4 0.000 0.000 0.000 1.000 3.000 6.000 0.000 0.000 −1.000 20.000
4.14 Quadratic Programming and the Linear Complementary Problem 179 Tableau 1 (z0Enters Basis,w1≡ws Leaves)
z0 −1.000 0.000 0.000 0.000 2.000 −3.000 1.000 3.000 1.000 6.000 w2 −1.000 1.000 0.000 0.000 5.000 −5.000 0.000 −3.000 0.000 11.000 w3 −1.000 0.000 1.000 0.000 3.000 −2.000 1.000 3.000 0.000 10.000 w4 −1.000 0.000 0.000 1.000 5.000 3.000 1.000 3.000 0.000 26.000
Tableau 2 (z1Enters Basis,w2Leaves)
z0 −0.600 −0.400 0.000 0.000 0.000 −1.000 1.000 4.200 1.000 1.600 z1 −0.200 0.200 0.000 0.000 1.000 −1.000 0.000 −0.600 0.000 2.200 w3 −0.400 −0.600 1.000 0.000 0.000 1.000 1.000 4.800 0.000 3.400 w4 0.000 −1.000 0.000 1.000 0.000 8.000 1.000 6.000 0.000 15.000
Tableau 3 (z2Enters Basis,w4Leaves)
z0 −0.600 −0.525 0.000 0.125 0.000 0.000 1.125 4.950 1.000 3.475 z1 −0.200 0.075 0.000 0.125 1.000 0.000 0.125 0.150 0.000 4.075 w3 −0.400 −0.475 1.000 −0.125 0.000 0.000 0.875 4.050 0.000 1.525 z2 0.000 −0.125 0.000 0.125 0.000 1.000 0.125 0.750 0.000 1.875
Tableau 4 (z4Enters Basis,w3Leaves)
z0 −0.111 0.056 −1.222 0.278 0.000 0.000 0.056 0.000 1.000 1.611 z1 −0.185 0.093 −0.037 0.130 1.000 0.000 0.093 0.000 0.000 4.019 z4 −0.099 −0.117 0.247 −0.031 0.000 0.000 0.216 1.000 0.000 0.377 z2 0.074 −0.037 −0.185 0.148 0.000 1.000 −0.037 0.000 0.000 1.593
Tableau 5 (z3Enters Basis,z4Leaves)
z0 −0.086 0.086 −1.286 0.286 0.000 0.000 0.000 −0.257 1.000 1.514 z1 −0.143 0.143 −0.143 0.143 1.000 0.000 0.000 −0.429 0.000 3.857 z3 −0.457 −0.543 1.143 −0.143 0.000 0.000 1.000 4.629 0.000 1.743 z2 0.057 −0.057 −0.143 0.143 0.000 1.000 0.000 0.171 0.000 1.657
Tableau 6 (w4Enters Basis,z0Leaves)
w4 −0.300 0.300 −4.500 1.000 0.000 0.000 0.000 −0.900 3.500 5.300 z1 −0.100 0.100 0.500 0.000 1.000 0.000 0.000 −0.300 −0.500 3.100 z3 −0.500 −0.500 0.500 0.000 0.000 0.000 1.000 4.500 0.500 2.500 z2 0.100 −0.100 0.500 0.000 0.000 1.000 0.000 0.300 −0.500 0.900 The solution is obtained asx1=3.1,x2=0.9, and the minimum value of the function is−12.05. Plotting of this problem is shown inFig. E4.6.
5 4.5 4 3.5
2.5 2 1.5 1 0.5 001
1 2 2
3
3
4 4
5 5
7 6
6 3
Figure E4.6. Solution of QP problem by Lemke’s algorithm.
Treatment of Equality Constraints
The LCP formulation and its implementation in the program is provided for inequality constraints, which are put in the LE form. If there is an equality con- straint, it can be treated by two inequality constraints. If 1 =b1 is the equality constraint, where1 is a linear or nonlinear form, it can be replaced by two con- straints1≤b1and1≥b1. It is easy to check that a system of equality constraints
1=b1 2=b2 3=b3
4=b4 (4.55)
Problems 4.1–4.11 181 is equivalent to
1≤b1 2≤b2
3≤b3 4≤b4
1+2+3+4≥b1+b2+b3+b4 (4.56) A system ofnequalities can be treated byn+1 inequalities.
COM PUTER PROGRAM S
SIMPLEX, REVSIMC, LPINTER, QPLCP, and EXCEL SOLVER, MATLAB PROBLEM S
P4.1. Fill in the blank:
When a slack variable equals zero, the corresponding constraint is
P4.2. Do all the calculations displayed in the structural design problem, Section 4.3.
P4.3. In the structural design problem in Section 4.3,Fig. 4.1, if the horizontal loca- tionsof loadW1 is a third variable, along withW1andW2, is the problem still an LP? Justify.
P4.4. Since the optimum, if it exists, is at a vertex of the feasible polytope, is it possible to evaluate the objective at each vertex and determine the optimum?
Discuss.
P4.5. Solve4the diet problem PM1 modeled in Section 4.4.
P4.6. Solve the alloy manufacturing problem PM2 modeled in Section 4.4.
P4.7. Solve the refinery problem PM3 modeled in Section 4.4.
P4.8. Solve the agriculture problem PM4 modeled in Section 4.4.
P4.9. Solve the trim problem PM5 modeled in Section 4.4.
P4.10. Solve the straightness evaluation problem PM6 modeled in Section 4.4.
P4.11. Solve the machine scheduling problem PM7 modeled in Section 4.4.
4 All solutions must include a discussion of active constraints, output interpretations.
P4.12. A set of points belonging to set 1 and another set of points belonging to set 2, are to be separated or “classified” by a straight line. That is, a liney–ax–b=0 must be determined, which separates the two sets of points. Thus, we will havey– ax–b>0 for each point in set 1 andy–ax–b<0 for points in set 2. Formulate this as an LP problem. Give formulation, solution, plot showing line, and points.
More general problems of this type are discussed in [S. Boyd and L. Vandenberghe, Convex Optimization]. Use SOLVER.
Hint: Use 3 design variables, namely,a,band (an additional variable)t, where tis the “gap” between the positive values for set 1 and negative values for set 2.
Maximizet.
xi yi
set 1
1 1
1 2
0.8 3.5
2 1.8
2 2.7
3 3.5
set 2
1.5 0.3
2.5 0.75
3 0.1
3.8 1
3.7 1.7
4 0
4 0.6
4.8 2.7
5 0.7
5.2 1
P4.13. Subcontracting dyeing operations in textile company: ABC textile mills manufacture fabrics with different colors. The factory has a high quality dyeing unit but with limited capacity. It is, thus, necessary for ABC mills to subcon- tract some of its dyeing operations – but the logistics manager wishes to know which fabrics are to be subcontracted and the corresponding quantity. The prob- lem, ignoring time scheduling and other complications, can be formulated as follows.
Problems 4.13–4.14 183 Let nf =number of different colored fabrics, xi = quantity of fabric i dyed in-house, andyi =quantity of fabric i, that is, subcontracted out for dyeing. Let Pi=unit profit,ci =unit cost to dye in-house,si=unit cost to dye as charged by the subcontractor, anddi=amount of fabric that needs to be dyed in a given time period (i.e., the demand). Further, letr=total amount of fabric that can be dyed in-house (of all types) andR=total fabric quantity that can be dyed by the subcon- tractor. A suitable objective function is the maximization of total revenue=total profit – total cost. This leads to the problem
maximize f =
(Pi−ci)xi+
(Pi−si)yi
subject to xi +yi =di i =1, . . . ,nf xi ≤r
yi ≤ R
all xi,yi ≥0.
The “design variables” are the quantitiesxiandyi, and the total number of variables n=2nf.The solution of course depends on the data. Typically, it is more expensive to subcontract, especially the high-end dyeing operations for the more profitable fabrics. However, owing to limited resources in-house, there is no option but to subcontract some amount. For the data below:
nf =4, r=50, R=1000 (unlimited), d1 =25, d2=45, d3=50, d4=60 (Pi−ci)= {10.0,6.5,6.0,5.0} and (Pi−si)= {−2.0,5.5,5.0,4.0}
determine the net revenue, and the amount of each fabric dyed in-house versus dyed outside.
P4.14. The furnace used in a cogeneration plant is capable of burning coal, oil, or gas, simultaneously. Taking efficiency into consideration, total input rate of 4000 kW equivalent of fuel must be burnt. Regulations require that the sulphur content of the emissions is limited to 2.5%. The heating capacities, emission values and the costs are given as follows