58323338 numerical methods

50
Nonnegativity Conditions Any variable not already constrained to be nonnegative is replaced by the difference of two new variables which are so constrained. Linear constraints are of the form: i n j j ij b x a ~ 1 = where ~ stands for one of the relations ≤, ≥, = (not necessarily the same one for each i). The constants bi may always be assumed nonnegative. Example: The constraint 2x1 – 3x2 + 4x3 ≤ – 5 is multiplied by 1 to obtain 2x1 + 3x2 – 4x3 ≥ 5, which has a nonnegative right-hand side. Slack Variables and Surplus Variables A linear constraint of the form i j ij b x a can be converted into an equality by adding a new, nonnegative variable to the left-hand side of the inequality. Such a variable is numerically equal to the difference between the right- and left-hand sides of the inequality and is known as a slack variable. Example: A manufacturer is beginning the last week of production of four different models of wooden television consoles, labeled I, II, III, and IV, each of which must be assembled and then decorated. The models require 4, 5, 3, and 5 h, respectively, for assembling and 2, 1.5, 3, and 3 h, respectively, for decorating. The profits on the models are $7, $4, $6, and $9, respectively. The manufacturer has 30 000 h available for assembling these products (750 assemblers working 40 h/wk) and 20 000 h available for decorating (500 decorators working 40 h/wk). How many of each model should the manufacturer produce during this last week to maximize profit? Assume that all units made can be sold. The first constraint in above problem is 4x1 + 5x2 + 3x3 + 5x4 30 000 This inequality is transformed into the equation 4x1 + 5x2 + 3x3 + 5x4 + x5 = 30 000 by adding the slack variable x5 to the left-hand side of the inequality. Here x5 represents the number of assembly hours available to the manufacturer but not used. A linear constraint of the form i j ij b x a can be converted into an equality by subtracting a new, nonnegative variable from the left-hand side of the inequality. Such a variable is numerically equal to the difference between the left- and right-hand sides of the inequality and is know as a surplus variable. It represents excess input into that phase of the system modeled by the constraint. Example: Universal Mines Inc. operates three mines in West Virginia. The ore from each mine is separated into two grades before it is shipped; the daily production capacities of the mines, as well as their daily operating costs, are as follows: High-Grade Ore, tons/day Low-Grade Ore, tons/day Operating Cost, $1000/ day Mine I 4 4 20 Mine II 6 4 22 Mine III 1 6 18 Universal has committed itself to deliver 54 tons of high-grade ore and 65 tons of low-grade ore by the end of the week. It also has labor contracts that guarantee employees in each mine a full day’s pay for each day or fraction of a day the mine is open. Determine the number of days each mine should be operated during the upcoming week if Universal Mines is to fulfill its commitment at minimum total cost. The first constraint in the above problem is 4x1 + 6x2 + x3 54 The left-hand side of this inequality represents the combined output of high-grade ore from three mines, while the right-hand side is the minimum tonnage of such ore required to meet contractual obligations. This inequality is transformed into the equation 4x1 + 6x2 + x3 – x4 = 54 by subtracting the surplus variable x4 from the left-hand side of the inequality. Here x4 represents the amount of high-grade ore mined over and above that needed to fulfill the contract. 1-50

Upload: notnull991

Post on 15-May-2017

255 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: 58323338 Numerical Methods

Nonnegativity ConditionsAny variable not already constrained to be nonnegative is replaced by the difference of two new variables which are so constrained.Linear constraints are of the form:

i

n

jjij bxa ~

1∑

=

where ~ stands for one of the relations ≤, ≥, = (not necessarily the same one for each i). The constants bi may always be assumed nonnegative.

Example: The constraint 2x1 – 3x2 + 4x3 ≤ – 5 is multiplied by –1 to obtain 2x1 + 3x2 – 4x3 ≥ 5, which has a nonnegative right-hand side.

Slack Variables and Surplus Variables

A linear constraint of the form ∑ ≤ ijij bxa can be converted into an equality by adding a new, nonnegative variable to the

left-hand side of the inequality. Such a variable is numerically equal to the difference between the right- and left-hand sides of the inequality and is known as a slack variable. Example: A manufacturer is beginning the last week of production of four different models of wooden television consoles, labeled I, II, III, and IV, each of which must be assembled and then decorated. The models require 4, 5, 3, and 5 h, respectively, for assembling and 2, 1.5, 3, and 3 h, respectively, for decorating. The profits on the models are $7, $4, $6, and $9, respectively. The manufacturer has 30 000 h available for assembling these products (750 assemblers working 40 h/wk) and 20 000 h available for decorating (500 decorators working 40 h/wk). How many of each model should the manufacturer produce during this last week to maximize profit? Assume that all units made can be sold.

The first constraint in above problem is

4x1 + 5x2 + 3x3 + 5x4 ≤ 30 000

This inequality is transformed into the equation

4x1 + 5x2 + 3x3 + 5x4 + x5 = 30 000

by adding the slack variable x5 to the left-hand side of the inequality. Here x5 represents the number of assembly hours available to the manufacturer but not used.

A linear constraint of the form ∑ ≥ ijij bxa can be converted into an equality by subtracting a new, nonnegative variable from

the left-hand side of the inequality. Such a variable is numerically equal to the difference between the left- and right-hand sides of the inequality and is know as a surplus variable. It represents excess input into that phase of the system modeled by the constraint.Example: Universal Mines Inc. operates three mines in West Virginia. The ore from each mine is separated into two grades before it is shipped; the daily production capacities of the mines, as well as their daily operating costs, are as follows:

High-Grade Ore, tons/day

Low-Grade Ore, tons/day

Operating Cost, $1000/ day

Mine I 4 4 20Mine II 6 4 22Mine III 1 6 18

Universal has committed itself to deliver 54 tons of high-grade ore and 65 tons of low-grade ore by the end of the week. It also has labor contracts that guarantee employees in each mine a full day’s pay for each day or fraction of a day the mine is open. Determine the number of days each mine should be operated during the upcoming week if Universal Mines is to fulfill its commitment at minimum total cost.

The first constraint in the above problem is

4x1 + 6x2 + x3 ≥ 54

The left-hand side of this inequality represents the combined output of high-grade ore from three mines, while the right-hand side is the minimum tonnage of such ore required to meet contractual obligations. This inequality is transformed into the equation

4x1 + 6x2 + x3 – x4 = 54

by subtracting the surplus variable x4 from the left-hand side of the inequality. Here x4 represents the amount of high-grade ore mined over and above that needed to fulfill the contract.

1-50

Page 2: 58323338 Numerical Methods

Generating an Initial Feasible SolutionAfter all linear constraints (with nonnegative right-hand sides) have been transformed into equalities by introducing slack and surplus variables where necessary, add a new variable, called an artificial variable, to the left-hand side of each constraint equation that does not contain a slack variable. Each constraint equation will then contain either one slack variable or one artificial variable. A nonnegative initial solution to this new set of constraints is obtained by setting each slack variable and each artificial variable equal to the right-hand side of the equation in which it appears and setting all other variable, including the surplus variable, equal to zero.Example: The set of constraints

x1 + 2x2 ≤ 34x1 + 5x2 ≥ 67x1 + 8x2 = 15

is transformed into a system of equations by adding a slack variable, x3, to the left-hand side of the first constraint and subtracting a surplus variable, x4, from the left-hand side of the second constraint. The new system is

x1 + 2x2 + x3 = 34x1 + 5x2 – x4 = 67x1 + 8x2 = 15

If now artificial variables x5 and x6 are respectively added to the left-hand sides of the last two constraints in system, the constraints without a slack variable, the result is

x1 + 2x2 + x3 = 34x1 + 5x2 – x4 + x5 = 67x1 + 8x2 + x6 = 15

A nonnegative solution to this last system is x3 = 3, x5 = 6, x6 = 15, and x1 = x2 = x4 = 0. (Notice, however, that x1 = 0, x2 = 0 is not a solution to the original set of constraints.)

Penalty CostsThe introduction of slack and surplus variables alters neither the nature of the constraints nor the objective. Accordingly, such variables are incorporated into the objective function with zero coefficients. Artificial variables, however, do change the nature of the constraints. Since they are added to only one side of an equality, the new system is equivalent to the old system of constraints if and only if the artificial variables are zero. To guarantee such assignments in the optimal solution (in contrast to the initial solution), artificial variables are incorporated into the objective function with very large positive coefficients in a minimization program or very large negative coefficients in a maximization program. These coefficients, denoted by either M or –M, where M is understood to be a large positive number, represent the (severe) penalty incurred in making a unit assignment to the artificial variables.

Standard Matrix Form:

Minimize: z = x1 + 2x2 + 3x3

Subject to: 3x1 + 4x3 ≤ 55x1 + x2 + 6x3 = 78x1 + 9x3 ≥ 2

With: all variables nonnegative

Adding a slack variable x4 to the left-hand side of the first constraint, subtracting a surplus variable x5 from the left-hand side of the third constraint, and then adding an artificial variable x6 only to the left-hand side of the third constraint, we obtain the program

Minimize: z = x1 + 2x2 + 3x3 + 0x4 + 0x5 + Mx6

Subject to: 3x1 + 4x3 + x4 = 55x1 + x2 + 6x3 = 78x1 + 9x3 − x5 + x6 = 2

With: all variables nonnegative

This program is in standard form, with an initial feasible solutions x4 = 5, x2 = 7, x6 = 2, x1 = x3 = x5 = 0.

define

X ≡ [x1, x2, x3, x4, x5, x6]T

C ≡ [1, 2, 3, 0, 0, M]T

2-50

Page 3: 58323338 Numerical Methods

−≡

110908

000615

001403

A

2

7

5

B

6

2

4

0

x

x

x

X

In this case, x2 can be used to generate the initial solution rather than adding an artificial variable to the second constraint to achieve the same result. In general, whenever a variable appears in one and only one constraint equation, and there with a positive coefficient, that variable can be used to generate part of the initial solution by first dividing the constraint equation by the positive coefficient and then setting the variable equal to the right-hand side of the equation; an artificial variable need not be added to the equation.

The Simplex TableauThe simplex method is a matrix procedure for solving linear programs in the standard form

Optimize: z = CTXSubject to: AX = BWith: X ≥ 0

Where B ≥ 0 and a basic feasible solution X0 is known. Starting with X0, the method locates successively other basic feasible solutions having better values of the objective, until the optimal solution is obtained. For minimization programs, the simplex method utilizes tableau, in which C0 designates the cost vector associated with the variables in X0.

BCACC

BACX

C

X

TTT

T

T

00

00

−−

For maximization programs, tableau applies if the elements of the bottom row have their signs reversed.

Example: For the minimization program of above problem, C0 = [0, 2, M]T. Then

[ ] [ ]

−−=−

110908

000615

001403

,2,0,0,0,3,2,10 MMACC TT

[ ] [ ]MMMMM −++−= ,0,912,2,810,0,0,3,2,1

[ ]0,,0,99,0,89 MMM −−−−=

[ ] MMBC T 214

2

7

5

,2,00 −−=

−=−

And tableau becomes

MMMM

Mx

x

x

M

xxxxxx

2140099089

2110908

70006152

50014030

00321

6

2

4

654321

−−−−−−−

A Tableau Simplification

For each j (j = 1, 2, … , n), define zj = TC0 Aj, the dot product of C0 with the j th column of A. The j th entry in the last row of

Tableau is cj – zj (or, for a maximization program, zj – cj), where cj is the cost in the second row of the tableau, immediately above Aj. Once this last row has been obtained, the second row and second column of the tableau, corresponding to CT and C0, respectively, become superfluous and may be eliminated.

The Simplex Method

3-50

Page 4: 58323338 Numerical Methods

Step 1: Locate the most negative number in the bottom row of the simplex tableau, excluding the last column, and call the column in which this number appears the work column. If more than one candidate for most negative numbers exists, choose one.

Step 2: Form ratios by dividing each positive number in the work column, excluding the last row, into the element in the same row and last column. Designate the element in the work column that yields the smallest ration as the pivot element. If more that one element yields the same smallest ration, choose one. If no element in the work column is positive, the program has no solution.

Step 3: Use elementary row operations to convert the pivot element to 1 and then to reduce all other elements in the work column to 0.

Step 4: Replace the x-variable in the pivot row and first column by the x-variable in the first row and pivot column. This new first column is the current set of basic variables.

Step 5: Repeat Steps 1 through 4 until there are no negative numbers in the last row, excluding the last column.Step 6: The optimal solution is obtained by assigning to each variable in the first column that value in the corresponding row and

last column. All other variables are assigned the value zero. The associated z*, the optimal value of the objective function, is the number in the last row and last column for a maximization program, but the negative of this number for a minimization program.

Modification for Programs with Artificial VariablesWhenever artificial variables are part of the initial solution X0, the last row of Tableau will contain the penalty cost M. To minimize roundoff error, the following modifications are incorporated into the simplex method; the resulting algorithm is the two-phase method.Change 1: The last row of Tableau is decomposed into two rows, the first of which involves those terms not containing M, while

the second involves the coefficients of M in the remaining terms.Example: The last row of the tableau in the last example is

MMMM 2140,,0,99,0,89 −−−−−−

Under Change 1 it would be transformed into the two rows14000909 −−−20109,08 −−−

Change 2: Step 1 of the simplex method is applied to the last row created in Change 1 (followed by Step 2, 3, and 4), until this row contains no negative elements. The Step 1 is applied to those elements in the next-to-last row that are positioned over zeros in the last row.

Change 3: Whenever an artificial variable ceases to be basic – i.e., is removed from the first column of the tableau as a result of Step 4 – it is deleted from the top row of the tableau, as is the entire column under it. (This modification simplifies hand calculations but is not implemented in many computer programs.)

Change 4: The last row can be deleted from the tableau whenever it contains all zeros.Change 5: If nonzero artificial variables are present in the final basic set, then the program has no solution. (In contrast, zero-

valued artificial variables may appear as basic variables in the final solution when one or more of the original constraint equations is redundant.)

Solved Problems

Problem 1Maximize: z = x1 + 9x2 + x3

Subject to: x1 + 2x2 + 3x3 ≤ 93x1 + 2x2 +2x3 ≤ 15

With: all variables nonnegative

This program is put into matrix standard form by first introducing slack variables x4 and x5 in the first and second constraint inequalities, and then defining

X ≡ [x1, x2, x3, x4, x5]T C ≡ [1, 9,1, 0, 0]T

10223

01321A

15

9B

5

40 x

xX

The costs associated with the components of X0, the slack variable, are zero; hence C0 ≡ [0, 0]T.Tableau becomes

4-50

Page 5: 58323338 Numerical Methods

15102230

9013210

00191

5

4

54321

x

x

xxxxx

To compute the last row of this tableau, we use the tableau simplification and first calculate each zj by inspection: it is the dot product of column 2 and the j th column of A. We then subtract the corresponding cost cj from it (maximization program). In this case, the second column is zero, and so zj – cj = 0 – cj = – cj. Hence, the bottom row of the tableau, excluding the last element, is just the negative of row 2. The last element in the bottom row is simply the dot product of column 2 and the final, B-column, and so it too is zero. At this point, the second row and second column of the tableau are superfluous. Eliminating them, we obtain tableau as the complete initial tableau.

000191)(

1510223

901321

00191

5

*4

54321

−−−− jj cz

x

x

xxxxx

We are now ready to apply the simplex method. The most negative element in the last row of tableau is – 9, corresponding to the x2-column; hence this column becomes the work column. Forming the ratios 9/2 = 4.5 and 15/2 = 7.5, we find that the element 2, marked b the asterisk in the tableau, is the pivot element, since it yields the smallest ratio. Then, applying Steps 3 and 4 to the tableau, we obtain next tableau. Since the last row of the last table contains no negative elements, it follows from Step 6 that the optimal solution is x2 = 9/2, x5 = 6, x1 = x3 = x4 = 0, with z = 81/2.

Problem 2Minimize: z = 80x1 + 60x2

Subject to: 0.20x1 + 0.32x2 ≤ 0.25 x1 + x2 = 1

with: x1 and x2 nonnegative

Adding a slack variable x3 and an artificial variable x4 to the first and second constraints, respectively, we convert the program to standard matrix form, with

X ≡ [x1, x2, x3, x4]T C ≡ [80,60,0, M]T

1011

0132.020.0A

1

25.0B

4

30 x

xX

Substituting these matrices, along with C0 ≡ [0, M]T , we obtain initial tableau.

MMM

Mx

x

M

xxxx

−−− 006080

11011

25.00132.020.00

06080

5

3

4321

Since the bottom row involves M, we apply Change 1; the resulting tableau is the initial tableau for the two-phase method.

10011

0006080)(

11011

25.00132.020.0*

4

3

4321

−−−− jj zc

x

x

xxxx

Using both Step 1 of the Simplex method and Change 2, we find that the most negative element in the last row of tableau (excluding the last column) is – 1, which appears twice. Arbitrarily selecting the x1-column as the work column, we form the

5-50

Page 6: 58323338 Numerical Methods

ratios 0.25/0.20 = 1.25 and 1/1 = 1. Since the element 1, starred in tableau, yields the smallest ratio, it becomes the pivot. Then, applying Step 3 and 4 and Change 3 to tableau we generate next tableau.

0000

800200

1011

05.0112.00

1

*3

321

−−x

x

xxx

Observe that x1 replaces the artificial variable x4 in the first column of tableau, so that the entire x4-column is absent from the tableau. Now, with no artificial variables in the first column and with Change 3 implemented, the last row of the tableau should be all zeros. It is; and by Change 4 this row may be deleted, giving

800200 −−as the new last row of tableau.Repeating Steps 1 through 4, we find that the x2-column is the new work column, the starred element in the tableau is the new pivot, and the elementary row operations yield the next tableau, in which all calculations have been rounded to four significant figures. Since the last row of the tableau, excluding the last column, contains no negative elements, it follows from Step 6 that x1

= 0.5833, x2 = 0.4167, x3 = x4 = 0, with z = 71.67

67.717.16600

5833.0333.801

4167.0333.810

1

2

321

−−x

x

xxx

Problems:Use the simplex or two-phase method to solve the following problems.

3.15Maximize: z = x1 + x2

s.t. x1 + 5x2 ≤ 52x1 + x2 ≤ 4

With: x1, x2 nonnegative

3.16Maximize: z = 3x1 + 4x2

s.t. 2x1 + x2 ≤ 6 2x1 + 3x2 ≤ 9

With: x1, x2 nonnegative

3.17Minimize: z = x1 + 2x2

s.t. x1 + 3x2 ≥ 11

2x1 + x2 ≥ 9With: x1, x2 nonnegative

3.18Maximize: z = –x1 – x2

s.t. x1 + 3x2 ≥ 5000 2x1 + x2 ≥ 12000

With: x1, x2 nonnegative

3.19Maximize: z = 2x1 + 3x2 + 4x3

s.t. x1 + x2 + x3 ≤ 1 x1 + x2 + 2x3 = 2 3x1 + 2x2 + x3 ≥ 4

With: x1, x2, x3 nonnegative

The Dual Simplex MethodThe (regular) simplex method moves the initial feasible but nonoptimal solution to an optimal solution while maintaining feasibility through an iterative procedure. On the other hand, the dual simplex method moves the initial optimal but infeasible solution to a feasible solution while maintaining optimality through an iterative procedure.

Iterative procedure of the Dual Simplex Method:Step 1: Rewrite the linear programming problem by expressing all the constraints in ≤ form and transforming them into equations

through slack variables.Step 2: Exhibit the above problem in the form of a simplex tableau. If the optimality condition is satisfied and one or more basic

variables have negative values, the dual simplex method is applicable.Step 3: Feasibility Condition: The basic variable with the most negative value becomes the departing variable (D.V.). Call the row

in which this value appears the work row. If more than one candidate for D.V. exists, choose one.Step 4: Optimality Condition: Form ratios by dividing all but the last element of the last row of cj – zj values (minimization

problem) or the zj – cj values (maximization problem) by the corresponding negative coefficients of the work row. The nonbasic variable with the smallest absolute ration becomes the entering variable (E.V.). Designate this element in the work row as the pivot element and the corresponding column the work column. If more than one candidate for E.V. exists, choose one. If no element in the work row is negative, the problem has no feasible solution.

6-50

Page 7: 58323338 Numerical Methods

Step 5: Use elementary row operations to convert the pivot element to 1 and then to reduce all the other elements in the work column to zero.

Step 6: Repeat steps 3 through 5 until there are no negative values for the basic variables.

7-50

Page 8: 58323338 Numerical Methods

Solved Problems

Problem 1Use the dual simplex method to solve the following problem.

Minimize: z = 2x1 + x2 + 3x3

s.t. x1 – 2x2 + x3 ≥ 4 2x1 + x2 + x3 ≤ 8 x1 – x3 ≥ 0

With: all variables nonnegative

Expressing all the constraints in the ≤ form and adding the slack variables, the problem becomes:

Minimize: z = 2x1 + x2 + 3x3 + 0x4 + 0x5 + 0x6

s.t. – x1 + 2x2 – x3 + x4 = –4 2x1 + x2 + x3 + x5 = 8 – x1 + x3 + x5 = 0

With: all variables nonnegative

0000312)(

0100101

8010112

4001121

6

5

*4

654321

jj zc

x

x

x

xxxxxx

−−

−−−

Since all the (cj – zj) values are nonnegative, the above solution is optimal. However, it is infeasible because it has a nonpositive value for the basic variable x4. Since x4 is the only nonpositive variable, it becomes the departing variable (D.V.).

−−−−−−

32:ratios absolute

001121:row

000312: )(

4

654321

x

rowzc

xxxxxx

jj

Since x1 has the smallest absolute ratio, it becomes the entering variable (E.V.). Thus the element – 1, marked by the asterisk, becomes the pivot element. Using elementary row operations, we obtain the next tableau.

8002150:)(

4101220

0012150

4001121

6

5

1

654321

−−−−

−−−

jj zc

x

x

x

xxxxxx

Since all the variables have nonnegtive values, the above optimal solution is feasible. The optimal and feasible solution is x1 = 4, x2 = 0, x3 = 0, with z = 8.

Problem 2Use the dual simplex method to solve the following problem.Maximize: z = – 2x1 – 3x2

s.t. x1 + x2 ≥ 2 2x1 + x2 ≤ 10 x1 + x2 ≤ 8

with: x1 and x2 nonnegative

Expressing all the constraints in the ≤ form and adding the slack variables, the problem becomes:Maximize: z = – 2x1 – 3x2

s.t. x1 + x2 ≥ 2 2x1 + x2 ≤ 10 x1 + x2 ≤ 8

with: all variables nonnegative

8-50

Page 9: 58323338 Numerical Methods

000032:)(

810011

1001012

200111

5

4

*3

54321

jj cz

x

x

x

xxxxx

−−−

Since all the (cj – zj) values are nonnegative, the above solution is optimal. However, it is infeasible because it has a nonpositive value for the basic variable x3. Since x3 is the only nonpositive variable, it becomes the departing variable (D.V.).

−−−−−

32:ratios absolute

00111:row

00032:row )(

3

54321

x

cz

xxxxx

jj

Since x1 has the smallest absolute ration, it becomes the entering variable (E.V.). Thus the element – 1, marked by the asterisk, is the pivot element. Using elementary row operations, we obtain the next tableau.

400210:)(

610100

601210

200111

5

4

1

54321

−−

−−

jj cz

x

x

x

xxxxx

Since all the variables have nonnegative values, the above optimal solution is feasible. The optimal and feasible solution is x1 = 2, x2 = 0, with z = 4.

Problems:

3.31Minimize: z = 3x1 + x2

s.t. 3x1 + x2 ≥ 4 x1 – x2 ≥ 0

with: x1, x2 nonnegative

3.32Minimize: z = 5x1 + 3x2 + x3

s.t. – x1 + x2 + x3 ≥ 2 2x1 + x2 – x3 ≥ 4

with: all variables nonnegative

3.33Minimize: z = x1 + 2x2 + 3x3

s.t. x1 – 2x2 + x3 ≥ 13x1 – 4x2 + 6x3 ≤ 82x1 – 4x2 + 2x3 ≤ 2

with: all variables nonnegative

3.34Maximize: z = – 4x1 – 3x2

s.t. x1 + x2 ≥ 2x1 + 2x2 ≥ 8

with: x1, x2 nonnegative

3.35Maximize: z = – 3x1 – 4x2 – 5x3

s.t. x1 + x2 ≤ 10x1 + 3x2 + x3 ≥ 9 x2 + x3 ≥ 4

with: all variables nonnegative

3.36Minimize: z = 3x1 + 9x2

s.t. x1 + 3x2 ≥ 62x1 + 3x2 ≥ 9

with: x1, x2 nonnegative

9-50

Page 10: 58323338 Numerical Methods

Linear Programming: Duality and Sensitivity AnalysisEvery linear program in the variables x1, x2, … , xn has associated with it another linear program in the variables w1, w2, … , wm

(where m is the number of constraints in the original program), known as its dual. The original program, called the primal, completely determines the form of its dual.

Symmetric DualsThe dual of a (primal) linear program in the (nonstandard) matrix form

minimize: z = CTX(1)s.t. AX ≥ B

with: X ≥ 0

is the linear program

maximize: z = BTW(2)s.t. ATW ≤ C

with: W ≥ 0

Conversely, the dual of the second program is the first program.Programs (1) and (2) are symmetrical in that both involve nonnegative variables and inequality constraints; the w1, w2, … , wm are known as the symmetric duals of each other. The dual variables are sometimes called shadow costs.

Dual solutionsTheorem 1 (Duality Theorem): If an optimal solution exists to either the primal or symmetric dual program, then the other

program also has an optimal solution and the two objective functions have the same optimal value.In such situation, the optimal solution to the primal (dual) is found in the last row of the final simplex tableau for the dual (primal), in those columns associated with the slack or surplus variables. Since the solutions to both programs are obtained by solving either one, it may be computationally advantageous to solve a program’s dual rather than the program itself.Theorem 2 (Complementary Slackness Principle): Given that the pair of symmetric duals have optimal solutions, then if the k-

th constraint of one system holds as an inequality – i.e., the associated slack or surplus variable is positive – the k-th component of the optimal solution of tits symmetric dual is zero.

Unsymmetric DaulsFor primal programs in standard matrix form, duals may be defined as follows:

Primal DualMinimize: z = CTXs.t. AX = Bwith: X ≥ 0

(3)

Maximize: z = BTWs.t. ATW ≤ C

(4)

Maximize: z = CTXs.t AX = Bwith: X ≥ 0

(5)Minimize: z = BTWs.t. ATW ≥ C (6)

Conversely, the duals of programs (4) and (6) are defined as programs (3) and (5), respectively. Since the dual of a program in standard form is not itself in standard form, these duals are unsymmetric. Their forms are consistent with and a direct consequence of the definition of symmetric duals.Theorem 1 is valid for unsymmetric duals too. However, the solution to an unsymmetric dual is not, in general, immediately apparent from the solution to the primal; the relationships are

10

T0

T ACW −=* or0

1T0 CAW −= )(* (7)

1T0

T0

T ABX −= )(* or0

10 BAX −=* (8)

In (7), C0 and A0 are made up of those elements of C and A, in either program (3) or (5), that correspond to the basic variables in X*; in (8), B0 and A0 are made up of those elements of B and A, in either program (4) or (6), that correspond to the basic variables in W*.

Solved Problems1. Determine the symmetric dual of the programMinimize: z = 5x1 + 2x2 + x3

s.t. 2x1 + 3x2 + x3 ≥ 206x1 + 8x2 + 5x3 ≥ 307x1 + x2 + 3x3 ≥ 40 x1 + 2x2 + 4x3 ≥ 50

with: all variables nonnegative

10-50

Page 11: 58323338 Numerical Methods

maximize: z = 20w1 + 30w2 + 40w3 + 50w4

2w1 + 6w2 + 7w3 + w4 ≤ 53w1 + 8w2 + w3 + 2w4 ≤ 2 w1 + 5w2 + 3w3 + 4w4 ≤ 1

with: all variables nonnegative

2. Determine the symmetric dual of the programMaximize: z = 2x1 + x2

s.t. x1 + 5x2 ≤ 10 x1 + 3x2 ≤ 62x1 + 2x2 ≤ 8

with: all variables nonnegativeminimize: z = 10w1 + 6w2 + 8w3

s.t. w1 + w2 + 2w3 ≥ 25w1 + 3w2 + 2w3 ≥ 1

with: all variables nonnegativesolution for primal and dual problems:

variables slack

000012:)(

810022

601031

1000151

*5

4

3

54321

−−− jj cz

x

x

x

xxxxx

810010

4210011

2211020

6210140

1

4

3

54321

x

x

x

xxxxx

−−

dual the to solution

variables surplus

30011446

000008610)(

11010235

20101211

7

6

7654321

−−−−−

−−

jj zc

w

w

wwwwwww

804026

102112121

111054

3

5

54321

−−−−−

w

w

wwwww

primal the to solution

2. Determine the dual of the programMaximize: z = x1 + 3x2 – 2x3

s.t. 4x1 + 8x2 + 6x3 = 257x1 + 5x2 + 9x3 = 30

with: all variables nonnegative

The primal program can be solved by the two-phase method if artificial variables x4 and x5, respectively, are first added to the left-hand sides of the constraints equations. Simplex tableaux result.

5500151311

000231cz

3010957x

2501684x

xxxxx

jj

5

4

54321

−−−−−−− )(

7777668300

1933167101x

52811668010x

xxx

1

2

321

..

..

..

The primal program has the form (5); its unsymmetrid dual is given by (6) as Minimize: z = 25w1 + 30w2

s.t. 4w1 + 4w2 ≥ 18w1 + 5w2 ≥ 26w1 + 9w2 ≥ – 2

11-50

Page 12: 58323338 Numerical Methods

40001112121212

00000030302525zc

2001009966w

3100105588w

1010017744w

wwwwwwwww

jj

9

11

10

11109876543

−−−−−−

−−−−−

−−−

)(

77870528119530000

667311667016710000w

11110011110222201100w

44440019440138900011w

wwwwwww

9

6

3

9876543

...

...

...

...

−−−−−−

w1 = w3 – w4 = 0.4444w2 = w5 – w6 = – 0.1111

To verify, we note that the basic variables in X* are x1 and x2

[ ] [ ] [ ] [ ]11110444403643616364367

36836531

57

8431W

1T .,.,,,* −=−=

−=

=

To verify, we note that the basic variables in W* are w3, w6, and w9

[ ] [ ] [ ] [ ]0528119430365536115

13663642

0364368

0367365

03025

196

058

074

03025X

1

T ,.,.,,,,,,* ==

−−

−=

−−−

−=

Sensitivity AnalysisThe scope of linear programming does not end at finding the optimal solution to the linear model of a real-life problem. Sensitivity analysis of linear programming continues with the optimal solution to provide additional practical insight of the model. Since this analysis examines how sensitive the optimal solution is to changes in the coefficients of the LP model, it is called sensitivity analysis. This process is also known as postoptimality analysis because it starts after the optimal solution is found. Since we live in a dynamic world where changes occur constantly, this study of the effects on the solution due to changes in the data of a problem is very usefulIn general, we are interested in finding the effects of the following changes on the optimal LP solution:

(i) Changes in profit/unit or cost/unit (coefficients) of the objective function.(ii) Changes in the availability of resources or capacities of production/service center or limits on demands

(requirements vector or RHS of constraints).(iii) Changes in resource requirements/units of products or activities (technological coefficients of variables) in

constraints.(iv) Addition of a new product or activity (variable).(v) Addition of a new constraint.

The sensitivity analysis will be discussed for linear programs of the form:Maximize: z = CTXs.t. AX ≤ Bwith X ≥ 0where X is the column vector of unknowns; CT is the row vector of the corresponding costs (cost vector); A is the coefficient matrix of the constraints (matrix of technological coefficients); and B is the column vector of the right-hand sides of the constraints (requirements vector).Example 1:Maximize: z = 20x1 + 10x2

s.t. x1 + 2x2 ≤ 403x1 + 2x2 ≤ 60

with: x1 and x2 nonnegativeThis program is put into the following standard form by introducing the slack variables x3 and x4:Maximize: z = 20x1 + 10x2 + 0x3 + 0x4

x1 + 2x2 + x3 = 403x1 + 2x2 + x4 = 60

with: all variables nonnegativeThe solution for this problem is summarized as follows:Initial Simplex Tableau:

12-50

Page 13: 58323338 Numerical Methods

0001020cz

6010230 x

4001210 x

001020

xxxx

jj

4

3

4321

−−− )(

Final Simplex Tableau:

40032003100cz

2031032120 x

203113400 x

001020

xxxx

jj

1

3

4321

)( −

Since the last row of the above tableau contains no negative elements, the optimal solution is x1 = 20, x2 = 0, with z = 400Example 1.1 Modification of the cost CT

(a) Coefficients of the nonbasic variables.Let the new value of the cost coefficient corresponding to the nonbasic variable x2 be 15 instead of 10.The corresponding simplex tableau is

4003200350cz

2031032120 x

203113400 x

001520

xxxx

jj

1

3

4321

−−

)(

Since (z2 – c2) < 0, the new solution is not optimal. The regular simplex method is used to reoptimize the problem, starting with x2

as the entering variable.The new optimal tableau is

4254254500cz

1021210120 x

1541431015 x

001520

xxxx

jj

1

2

4321

)( −−

The optimal solution is x1 = 10, x2 = 15, with z = 425.(b) Coefficients of the basic variables.Let the cost coefficient of the basic variable x1 be changed from 20 to 10. Then the simplex tableau becomes

40031003100cz

2031032110 x

203113400 x

001010

xxxx

jj

1

3

4321

−−

)(

Since (z2 – c2) < 0, the new solution is not optimal. The regular simplex method is resorted to for reoptimization, first by entering x2. The new optimal tableau is

250252500cz

1021210120 x

1541431010 x

001010

xxxx

jj

1

2

4321

)( −−

The optimal solution is x1 = 10, x2 = 15, with z = 250.Example 1.2 Modification of the requirements vector BLet the RHS of the second constraint be changed from 60 to 130Then Xs = S-1B becomes

−=

−=

3131

1

3

4 3

3

1 3 0

4 0

310

311

x

x

13-50

Page 14: 58323338 Numerical Methods

Since x3 < 0, the new solution is not feasible. The dual simplex method used to clear the infeasibility starting with the following tableau:

6786667603330cz

33433300670120 x

333330133100 x

001020

xxxx

jj

1

3

4321

...)(

...

...

−−

The new final tableau is

800020300cz

40012120 x

1013400 x

001020

xxxx

jj

1

4

4321

)( −

−−

The optimal and feasible solution is x1 = 40, x2 = 0, with z = 800.Example 1.3 Modification of the matrix of coefficients AThe problem becomes more complicated, when the technological coefficients of the basic variables are considered. This is because here the matrix under the starting solution changes. In this case, it may be easier to solve the new problem than resort to the sensitivity analysis approach. Therefore our analysis is limited to the case of the coefficients of nonbasic variables only.Let the technological coefficients of x2 be changed from (2, 2)T to (2, 1)T.Then the new technological coefficients of x2 in the optimal simplex tableau of the original primal problem are given by

=

−=−

31

35

1

2

310

311

PS 21

Hence the new simplex tableau becomes

40032003100cz

2031031120 x

203113500 x

001020

xxxx

jj

1

3

4321

−−

)(

Since here (z2 – c2) < 0, the new solution is not optimal. Again the regular simplex method is resorted to for reoptimization, first by entering x2. The new optimal tableau is

4406200cz

1652510120 x

1251531010 x

001020

xxxx

jj

1

2

4321

)( −−

The optimal solution is x1 = 16, x2 = 12, with z = 440.Example 1.4 Addition of a variableLet a new variable xk be added to the original problem. This is accompanied by the addition to A of a column Pk = (3, 1)T and to CT

of a component ck = 30. Thus the new problem becomesMaximize: z = 20x1 + 10x2 + 30xk

s.t. x1 + 2x2 + 3xk ≤ 403x1 + 2x2 + xk ≤ 60

with: all variables nonnegativeThen the technological coefficients of xk in the optimal tableau are

=

−=−

31

38

1

3

310

311

PS k1

The corresponding (zk – ck) = (8/2)(0) + (1/3)(20) – 30 = 70/3Thus the modified simplex tableau is

14-50

Page 15: 58323338 Numerical Methods

40032003703100cz

203103132120 x

20311383400 x

00301020

xxxxx

jj

1

3

43k21

−−

)(

Now entering the variable xk, the regular simplex method is applied to obtain the following optimal tableau.

5758308700150cz

2358381021120 x

2158183121030 x

00301020

xxxxx

jj

1

k

43k21

)( −−

The optimal solution is x1 = 17.5, x2 = 0, xk = 7.5, with z = 575.Example 1.5 Addition of a constraintIf a new constraint added to the system is not active, it is called a secondary or redundant constraint, and the optimality of the problem remains unchanged. On the other hand, if the new constraint is active, the current optimal solution becomes infeasible.Let us consider the case of the addition of an active constraint, 2x1 + 3x2 ≥ 50 to the original problem. The current optimal solution (x1 = 20, x2 = 0) does not satisfy the above new constraint and hence becomes infeasible. Therefore, add the new constraint to the current optimal tableau. The new slack variable is x5. The new simplex tableau is

400032003100cz

50100320 x

20031032120 x

2003113400 x

0001020

xxxxx

jj

5

1

3

54321

)( +−−−

By using the row operations, the coefficient of x1 in the new constraint is made zero. The modified tableau becomes

400032003100cz

1013203500 x

20031032120 x

2003113400 x

0001020

xxxxx

jj

5

1

3

54321

)( +−−

The dual simplex method is used to overcome the infeasibility by departing the variable x5. The new tableau is

38028000cz

6535201010 x

16525300120 x

1254511000 x

0001020

xxxxx

jj

2

1

3

54321

)( +−−

The above tableau gives the optimal and feasible solution as x1 = 16, x2 = 6, x3 = 12, with z = 380.

The Revised Simplex MethodConsider the following linear programming problem in standard matrix form:Maximize: z = CTXs.t. AX = Bwith: X ≥ 0where X is the column vector of unknowns, including all slack, surplus, and artificial variables; CT is the row vector of corresponding costs; A is the coefficient matrix of the constraint equations; and B is the column vector of the right-hand side of the constraint equations. They are represented as follows:

=

=

=

=

=

mn211m

n22221

n11211

n

2

1

n

2

1

n

2

1

aaa

aaa

aaa

A

0

0

0

0

B

B

B

B

c

c

c

C

x

x

x

X

,,,,

15-50

Page 16: 58323338 Numerical Methods

Let Xs = the column vector of basic variables, CsT = the row vector of costs corresponding to Xs, and S = the basis matrix

corresponding to Xs.Step 1: Entering Vector Pk:

For every nonbasic vector Pj, calculate the coefficientzj – cj = WPj – cj (maximization program), or cj – zj = cj – WPj (minimization program), where W = Cs

TS-1.The nonbasic vector Pj with the most negative coefficient becomes the entering vector (E.V.), Pk.If more than one candidate for E.V. exists, choose one.

Step 2: Departing Vector Pr:(a) Calculate the current basic Xs: Xs = S-1B(b) Corresponding to the entering vector Pk, calculate the constraint coefficients tk: tk = S-1Pk

(c) Calculate the ratio θ:

m21i0tt

Xik

ik

is

i,,,,,

)(min =

>=θ

The departing vector (D.V.), Pr, is the one that satisfies the above condition.Note: If all tkj < 0, there is no bounded solution for the problem. Stop.

Step 3: New Basis:S-1

new = ES-1, where E = (u1, …, ur-1, η, ur+1, …, um)Note,

=

≠−=

=ri if

t

1

ri if t

t

where

rk

rk

ik

m

2

1

,

,, η

η

ηη

η

and ui is a column vector with 1 in the ith element and 0 in the other (m – 1) elements.Set S-1 = S-1

new and repeat steps 1 through 3, until the following optimality condition is satisfied.zj – cj ≥ 0 (maximization problem), or cj – zj ≥ 0 (minimization problem)Then the optimal solution is as follows: Xs = S-1B; z = Cs

TXs

Solved Problems1. Use revised simplex method to solve the following problem.Maximize: z = 10x1 + 11x2

s.t. x1 + 2x2 ≤ 1503x1 + 4x2 ≤ 2006x1 + x2 ≤ 175

with: x1 and x2 nonnegativeThis program is put in standard form by introducing the slack variables x3, x4, and x5,Maximize: z = 10x1 + 11x2 + 0x3 + 0x4 + 0x5

s.t. x1 + 2x2 + x3 = 1503x1 + 4x2 + x4 = 2006x1 + x2 + x5 = 175

With all variables nonnegative

P1 =

6

3

1

, P2 =

1

4

2

, P3 =

0

0

1

, P4 =

0

1

0

, P5 =

1

0

0

, B =

175

200

150

Initialization:Xs = (x3, x4, x5)T; Cs

T = (0, 0, 0)

S = (P3, P4, P5) = I = S-1 =

100

010

001

Iteration #1:The nonbasic vectors are P1 and P2.

(a) Entering Vector: W = CsTS-1 = (0, 0, 0)I = (0, 0, 0)

(z1 – c1, z2 – c2) = W(P1, P2) – (c1, c2) = (0, 0, 0)

16

43

21

– (10, 11) = (–10, –11)

16-50

Page 17: 58323338 Numerical Methods

Since the most negative coefficient corresponds to P2, it becomes the entering vector (E.V.)

(b) Departing Vector:

Xs = S-1B = IB = B =

175

200

150

t2 = S-1P2 = IP2 = P2 =

1

4

2

501

175

4

200

2

150 =

= ,,minθ

Since the minimum ratio corresponds to P4, it becomes the departing vector (D.V.)

(c) New Basis:

−=

−=

=41

41

21

41

41

42

t

tt

1t

t

42

52

42

42

32

η ; E = (u1, η, u3)

−==== −−

1410

0410

021111 EEIESSnew

Summary of Iteration #1:

Xs = (x3, x2, x5)T; CsT = (0, 11, 0)

Iteration #2:Now the nonbasic vectors are P1 and P4

(a) Entering Vector:

W = CsTS-1 = ( ) ( )04110

1410

0410

0211

0110 ,,,, =

(z1 – c1, z4 – c4) = W(P1, P4) – (c1, c4) = (0, 11/4 , 0)

06

13

01

– (10, 0) = (–7/4, 11/4)

Since the most negative coefficient corresponds to P1, it becomes the entering vector (E.V.)(b) Departing Vector:

=

−== −

125

50

50

175

200

150

1410

0410

02111BSX s

−=

−== −

421

43

21

6

3

1

1410

0410

0211

11

1 PSt

21500421

125,

43

50,min =

−=θ

Since the minimum ratio corresponds to P5, it becomes the departing vector (D.V.).

17-50

Page 18: 58323338 Numerical Methods

(c) New Basis:

−=

−−

=

=214

71

212

421

1421

43421

21

1

51

51

21

52

31

t

t

tt

t

η ; E = (u1, u2, η)

−−

−=

−== −−

2142110

71720

21221111

1410

0410

0211

21400

7110

21201

ESS 11new

Summary of Iteration #2:Xs = (x3, x2, x1)T; Cs

T = (0, 11, 10)Iteration #3:Now the nonbasic vectors are P5 and P4.(a) Entering Vector:

( ) ( )31,38,0

2142110

71720

21221111

10,11,01 =

−−

−== −SCW T

s

(z5 – c5, z4 – c4) = W(P5, P4) – (c5, c4) = (0, 8/3 , 1/3)

01

10

00

– (0, 0) = (1/3, 8/3)

Since all the coefficients are nonnegative, the above step gives the optimal basis. The optimal values of the variables and the objective function are as follows:

=

−−

−==

21500

7225

211300

175

200

150

2142110

71720

212211111

1

2

3

BS

x

x

x

( ) 31775

21500

7225

211300

10,11,0 =

== s

Ts XCz

2. Use the revised simplex method to solve the following problem.

Minimize: z = 3x1 + 2x2 + 4x3 + 6x4

s.t. x1 + 2x2 + x3 + x4 ≥ 10002x1 + x2 + 3x3 + 7x4 ≥ 1500

with: all variables nonnegative

This program is put in standard form by introducing the surplus variables x5 and x7, and the artificial variables x6 and x8.

Minimize: z = 3x1 + 2x2 + 4x3 +6x4 + 0x5 + Mx6 + 0x7 + Mx8

s.t. x1 + 2x2 + x3 + x4 – x5 + x6 = 10002x1 + x2 + 3x3 + 7x4 – x7 + x8 = 1500

with: all variables nonnegative

=

=

=

=

−=

=

=

=

=

1500

1000B

1

0P

1

0P

0

1P

0

1P

7

1P

3

1P

1

2P

2

1P 87654321 ,,,,,,,,

Initialization: Xs = (x6, x8)T; Cs

T = (M, M)

( )

==== −

10

01SIPPS 1

86 ,

Iteration #1:The nonbasic vectors are P1, P2, P3, P4, P5, and P7.(a) Entering Vector:

18-50

Page 19: 58323338 Numerical Methods

( ) ( )MMIMMSCW 1Ts ,, === −

( ) ( ) ( )754321754321775544332211 PPPPPPWcccccczczczczczczc ,,,,,,,,,,,,,,, −=−−−−−−

( ) ( )

−−=

107312

011121MM006423 ,,,,,,

( )MM6M84M42M33M3 ,,,,, +−+−+−+−=Since the most negative coefficient corresponds to P4, it becomes the entering vector (E.V.).(b) Departing Vector:

==== −

1500

1000BIBBSX 1

s

==== −

7

1PIPPSt 444

14

{ } 71500715001000 == ,minθSince the minimum ratio corresponds to P8, it becomes the departing vector (D.V)(c) New Basis:

;

−=

=71

71

t

1t

t

84

84

64

η E = (u1, η)

−==== −−

710

711EEIESS 11

new

Summary of Iteration #1:

( ) ( )6 MC xxX Ts

T46s ,;, ==

Iteration #2:Now the nonbasic vectors are P1, P2, P3, P8, P5, and P7.(a) Entering Vector:

( ) ( )7M76M710

7116MSCW 1T

s −=

−== − ,,

( ) ( ) ( )758321758321775588332211 PPPPPPWcccccczczczczczczc ,,,,,,,,,,,,,,, −=−−−−−−

( ) ( )

−−−=

101312

0101217M76M00M423 ,,,,,,

( )767MM767M87107M4787M13797M5 +−−+−+−+−= ,,,,,

Since the most negative coefficient corresponds to P2, it becomes the entering vector (E.V.).(b) Departing Vector:

( ) ( )7150075500715007150010001500

1000

710

711BSX 1

s ,, =−=

−== −

=

−== −

71

713

1

2

710

711PSt 2

12

3

55001500

3

5500

71

71500

713

75500=

=

= ,min,minθ

Since the minimum ratio corresponds to P6, it becomes the departing vector (D.V.)(c) New Basis:

( )2

62

42

62 uE 131

137

713

71713

1

t

tt

1

,; ηη =

=

−=

−=

−=

== −−

132131

131137

710

711

1131

0137ESS 11

new

19-50

Page 20: 58323338 Numerical Methods

Summary of Iteration #2:

( ) ( )62C xxX Ts

T42s ,;, ==

Iteration #3:Now the nonbasic vectors are P1, P6, P3, P8, P5, and P7.(a) Entering Vector:

( ) ( )1310138132131

13113762SCW 1T

s ,, =

−== −

( ) ( ) ( )758361758361775588336611 PPPPPPWcccccczczczczczczc ,,,,,,,,,,,,,,, −=−−−−−−

( ) ( )

−−=

101302

010111131013800M4M3 ,,,,,,

( )1310138M13101314M1381311 ,,,,, +−+−=Since all the coefficients are nonnegative, the above step gives the optimal basis. The optimal values of the variables and the objective function are as follows:

=

−==

132000

135500

1500

1000

132131

131137BS

x

x 1

4

2

( ) 1323000132000

13550062XCz s

Ts =

== ,

Karmarkar’s AlgorithmThe simplex method of linear programming finds the optimum solution by starting at the origin and moving along the adjacent corner points of the feasible solutions space. Although this technique has been successful is solving LP problems of various sizes, the number of iterations becomes prohibitive for some huge problems. This is an exponential time algorithm.On the other hand, Karmarkar’s interior point Lp algorithm is a polynomial time algorithm. This new approach finds the optimum solution by starting at a trial solution and shooting through the interior of the feasible solution space. Although this projective algorithm may be advantageous in solving very large LP problems, it becomes very cumbersome for not-so-large problems.Consider the following form of the linear programming problem:Minimize: z = CTXs.t. AX = 0

1X = 1X ≥ 0

where X is a column vector of size n; C is an integer column vector of size n; 1 is a unit row vector of size n; A is an integer matrix of size (m × n); n ≥ 2.In addition, assume the following two conditions:

1. X0 = (1/n, ..., 1/n) is a feasible solution.2. minimum z = 0

Summary of Karmarkar’s Iterative Procedure1. Preliminary Step:

k = 0X0 = (1/n, ..., 1/n)T

)1(1

−=

nnr

nn 3)1( −=α2. Iteration k:

(a) Define the following: (i) Y0 = X0

(ii) Dk = diag{Xk}, which is the diagonal matrix whose diagonal consists of the elements of Xk.

(iii)

=

1kAD

P

(iv) kT DCC =

(b) Compute the following:

(i) TTTp CPPPPIC ])([ 1−−=

Note: If Cp = 0, any feasible solution becomes an optimal solution. Stop.

(ii) p

pnew

C

CrYY α−= 0

(iii) )1()(1 newknewkk YDYDX =+(iv) z = CTXk+1

20-50

Page 21: 58323338 Numerical Methods

(v) k = k + 1(vi) Repeat iteration k until the objective function (z) value is less than a prescribed tolerance ε.

Transforming a Linear Programming Problem into Karmarkar’s Special FormConsider the following linear program in the matrix form:Minimize: z = CTXs.t. AX ≥ Bwith X ≥ 0

The simplified steps of converting the above problem into Karmarkar’s special form are as follows:1. Since every primal linear program in the variables x1, x2, …,xn has associated with it a dual linear program in the variables w1, w2, …, wm (where m is the number of constraints in the original program), write the dual of the given primal problem as shown below:Maximize: z = BTWs.t. ATW ≤ Cwith W ≥ 02. (a) Introduce slack and surplus variables to the primal and dual problems.

(b) Combine primal and dual problems.3. (a) Introduce a bounding constraint

∑ ∑ ≤+ Kwx ii

(K should be sufficiently large to include all feasible solutions of the original problem.)(b) Introduce a slack s in the bounding constraint and obtain the following equation:

∑ ∑ =++ Kswx ii

4. (a) Introduce a dummy variable d (subject to the condition d = 1) to homogenize the constraints.(b) Replace the equations

∑ ∑ =++ Kswx ii

and d = 1with the following equivalent equations:

∑ ∑ =−++ 0Kdswx ii

and ∑ ∑ +=+++ )1(Kdswx ii

5. Introduce the following transformations so as to obtain one on the RHS of the last equation:xj = (K + 1)yj, j = 1, 2, ..., m + nwj = (K + 1)ym+n+j, j = 1, 2, ..., m + ns = (K + 1)y2m+2n+1

d = (K + 1)y2m+2n+2

6. Introduce an artificial variable y2m+2n+2 (to be minimized) in all the equations such that the sum of the coefficients in each homogeneous equation is zero and the coefficient of the artificial variable in the last equation is one.

Solved Problems

1. Carry out the first two iterations of Karmarkar’s algorithm for the following problem.

Minimize: z = 2x2 – x3

s.t. x1 – 2x2 + x3 = 0x1 + x2 + x3 = 1

with all variables nonnegative

Preliminary Step:k = 0X0 = (1/n, …, 1/n)T = (1/3, 1/3, 1/3)T

( ) ( ) 6113311nn1r =−=−=

( ) ( ) ( ) 923313n31n =×−=−=α

Iteration 0:Y0 = X0 = (1/3, 1/3, 1/3)T

D0 = diag{X0} = diag{1/3, 1/3, 1/3}A = (1, –2, 1); CT = (0, 2, –1)AD0 = (1, –2, 1) diag{1/3, 1/3, 1/3} = {1/3, –2/3, 1/3}

−=

=

111

313231

1

ADP 0

( ) { } ( )31320313131diag 120DCC 0T −=−== ,,,,,,

21-50

Page 22: 58323338 Numerical Methods

( )

=

=

33300

051PP

30

06670PP

1TT

.

.;

.

( )

=

50050

010

50050

PPPP1TT

..

..

( ) ( )TT1TTP 167001670CPPPPIC .,,. −=

−=

( ) ( ) 23620167001670C 22P ... =−++=

( ) ( ) ( ) ( )TTT

P

P0new 397403333026920167001670

23620

6192313131

C

CrYY .,.,..,,.

.,, =−−=−= α

( )Tnew1 397403333026920YX .,.,.==

( )( ) 26920397403333026920120XCz T1

T ..,.,.,, =−==k = 0 + 1 = 1

Iteration 1:

{ } { }397403333026920diagXdiagD 11 .,.,.==( ) { } ( )39740666600397403333026920diag 120CDC 1 .,.,.,.,.,, −=−==

( ) { } ( )397406666026920397403333026920diag 121AD1 .,.,..,.,.,, −=−=

−=

=

111

397406666026920

1

ADP 1 ...

( )

=

=

33300

04821PP

30

06750PP

1TT

.

.;

.

( )

−−=

567005904920

059099200670

492006704410

PPPP1TT

...

...

...

( ) ( )TT1TTP 132001801510CPPPPIC .,.,. −−=

−=

( ) ( ) ( ) 20140132001801510C 222P .... =−+−+=

( ) ( ) ( ) ( )TTT

P

P0new 392803414026530132001801510

20140

6192313131

C

CrYY .,.,..,.,.

.,, =−−−=−= α

{ }( ) ( )TTnew1 156101138007140392803414026530397403333026920diagYD .,.,..,.,..,.,. ==

34130YD1 new1 .=

( )T

new1

new12 457403334020920

YD1

YDX .,.,.==

( )( ) 20940457403334020920120XCz T2

T ..,.,.,, =−==

2. Carry out the first two iterations of Karmarkar’s algorithm for the following problem.

Minimize: z = 2x1 + x2 + 2x3 – 2x4

s.t. 2x1 + x2 + 2x3 – 2x4 – 3x5 = 02x1 – x3 + x4 – 2x5 = 0 x1 + x2 + x3 + x4 + x5 = 0

with: all variables nonnegative

Preliminary Step:k = 0X0 = (1/n, …, 1/n)T = (1/5, 1/5, 1/5, 1/5, 1/5)T

( ) ( ) 20115511nn1r =−=−=

( ) ( ) ( ) 1543515n31n =×−=−=α

Iteration 0:Y0 = X0 = (1/n, …, 1/n)T = (1/5, 1/5, 1/5, 1/5, 1/5)T

22-50

Page 23: 58323338 Numerical Methods

D0 = diag{X0} = diag{1/5, 1/5, 1/5, 1/5, 1/5}

( )02212C 21102

32212A T ,,,,; −=

−−=

{ }

−−−−

=

−−=

404020040

60404020405151515151diag

21102

32212AD 0 ....

.....,,,,

−−−−

=

=

11111

402020040

6040402040

1

ADP 0 ....

.....

( ) { } ( )0404020405151515151diag02212DCC 0T ,.,.,.,.,,,,,,,, −=−==

( )

−=

=

2000

09891281520

08152035871

PP

500

040240

0240880

PP1TT

.

..

..

;..

..

( )

−−

=−

7761025430145701022027830

2543066740267400587028700

1457026740667403413011300

1022005870341302543024350

2783028700113002435063480

PPPP1TT

.....

.....

.....

.....

.....

( ) ( )TT1TTp 134301526008740061301670CPPPPIC .,.,.,.,. −−−=

−=

( ) ( ) ( ) ( ) ( ) 28390134301526008740061301670C 22222p ...... =+−+−+−+=

( ) ( )( ) ( ) =−−−−=−= TT

p

p0new 134301526008740061301670

28390

2011545151515151

C

CrYY .,.,.,.,.

.,,,,α

( )T1718023210218402129016490 .,.,.,.,.=

( )Tnew1 1718023210218402129016490YX .,.,.,.,.==

( )( ) 51540171802321021840212901649002212XCz T1

T ..,.,.,.,.,,,, =−==k = 0 + 1 = 1

Iteration 1:

{ } { }1718023210218402129016490diagXdiagD 11 .,.,.,.,.==( ) { } ( )0464204368021290329801718023210218402129016490diag02212DCC 1

T ,.,.,.,..,.,.,.,.,,,, −=−==

{ } =

−−= 1718023210218402129016490diag

21102

32212AD 1 .,.,.,.,.

−−−−

=343602321021840032980

5154046420436802129032980

....

.....

−−−−

=

=

11111

343602321021840032980

5154046420436802129032980

1

ADP 1 ....

.....

( )

−=

=

2000

01239331280

0312802421

PP

500

03284008270

0082708260

PP1TT

.

..

..

;..

..

( )

−−

=−

7879023550166500866027650

2355070330273600618027300

1665027360645603300013140

0866006180330002563026530

2765027300131402653060690

PPPP1TT

.....

.....

.....

.....

.....

( ) ( )TT1TTp 1093012140085800446014250CPPPPIC .,.,.,.,. −−−=

−=

( ) ( ) ( ) ( ) ( ) 237401093012140085800446014250C 22222p ...... =+−+−+−+=

23-50

Page 24: 58323338 Numerical Methods

( ) ( )( ) ( ) =−−−−=−= TT

p

p0new 1093012140085800446014250

23740

2011545151515151

C

CrYY .,.,.,.,.

.,,,,α

( )T1725023050221602112016420 .,.,.,.,.=

{ }( ) == Tnew1 17250230502216021120164201718023210218402129016490diagYD .,.,.,.,..,.,.,.,.

( )T0296005350048400450002710 .,.,.,.,.=20360YD1 new1 .=

( )T

new1

new12 1456026280237702209013300

YD1

YDX .,.,.,.,.==

( )( ) 43670145602628023770220901330002212XCz T2

T ..,.,.,.,.,,,, =−==

3. Convert the following problem into Karmarkar’s special from:Maximize: z = 2x1 + x2

s.t. x1 + x2 ≤ 5x1 – x2 ≤ 3

with: all variables nonnegativei) Dual of the given problem.Minimize: z = 5w1 + 3w2

s.t. w1 + w2 ≥ 2w1 – w2 ≥ 1

with: all variables nonnegativeii) Introduction of slack and surplus variables and combination of primal and dual problems.

x1 + x2 + x3 = 5 w1 + w2 – w3 = 2x1 – x2 + x4 = 3 w1 – w2 – w4 = 1 2x1 + x2 = 5w1 + 3w2

with: all variables nonnegativeiii) Addition of a boundary constraint with slack variable s.

x1 + x2 + x3 = 5 w1 + w2 – w3 = 2x1 – x2 + x4 = 3 w1 – w2 – w4 = 1 2x1 + x2 – 5w1 – 3w2 = 0

∑ ∑= =

=++4

1i

4

1iii Kswx

with: all variables nonnegativeiv) Homogenized equivalent system with dummy variable d.

x1 + x2 + x3 – 5d = 0 w1 + w2 – w3 – 2d = 0x1 – x2 + x4 – 3d = 0 w1 – w2 – w4 – d = 0 2x1 + x2 – 5w1 – 3w2 = 0

∑ ∑= =

=−++4

1i

4

1iii 0Kdswx

( )∑ ∑= =

+=+++4

1i

4

1iii 1Kdswx

with: all variables nonnegativev) Introduction of the transformations.

xj = (K + 1)yj, j = 1, …, 4 s = (K + 1)9

wj = (K + 1)y4+j, j = 1, …, 4 d = (K + 1)10

The above transformations yield the following system:y1 + y2 + y3 – 5y10 = 0 y5 + y6 – y7 – 2y10 = 0y1 – y2 + y4 – 3y10 = 0 y5 – y6 – y8 – y10 = 0 2y1 + y2 – 5y5 – 3y6 = 0

0Kyy 10

9

1ii =−∑

=

1y10

1ii =∑

=

with: all variables nonnegativevi) Introduction of the artificial variable with appropriate constraint coefficients.Minimize: y11

s.t. y1 + y2 + y3 – 5y9 + 2y11 = 0y1 – y2 + y4 – 3y10 + 2y11 = 0

24-50

Page 25: 58323338 Numerical Methods

y5 + y6 – y7 – 2y10 + y11 = 0y5 – y6 – y8 – y10 + 2y11 = 0

2y1 + y2 – 5y5 – 3y6 + 5y11 = 0

( )∑=

=−+−9

1i1110i 0y9KKyy

∑=

=11

1ii 1y

with: all variables nonnegative

4. Convert the following problem into Karmarkar’s special from:Maximize: z = x1 + 4x2

s.t. x1 + 2x2 ≤ 102x1 + 3x2 ≤ 20 x1 ≤ 6

with: all variables nonnegativei) Dual of the give problem.Minimize: z = 10w1 + 20w2 + 6w3

s.t. w1 + 2w2 + w3 ≥ 1 2w1 + 3w2 ≥ 4

with: all variables nonnegativeii) Introduction of slack and surplus variables and combination of primal and dual problems.

x1 + 2x2 + x3 = 10 w1 + 2w2 + w3 – w4 = 12x1 + 3x2 + x4 = 20 2w1 + 3w2 – w5 = 4 x1 + x5 = 6

x1 + 4x2 = 10w1 + 20w2 + 6w3

with: all variables nonnegativeiii) Addition of a boundary constraint with slack variable s.

x1 + 2x2 + x3 = 10 w1 + 2w2 + w3 – w4 = 12x1 + 3x2 + x4 = 20 2w1 + 3w2 – w5 = 4 x1 + x5 = 6

x1 + 4x2 – 10w1 – 20w2 – 6w3 = 0

∑∑ =++5

ii

5

ii Kswx

with: all variables nonnegativeiv) Homogenized equivalent system with dummy variable d.

x1 + 2x2 + x3 – 10d = 0 w1 + 2w2 + w3 – w4 – d = 02x1 + 3x2 + x4 – 20d = 0 2w1 + 3w2 – w5 – 4d = 0 x1 + x5 – 6d = 0

x1 + 4x2 – 10w1 – 20w2 – 6w3 = 0

∑∑ =−++5

ii

5

ii 0Kdswx

( )∑∑ +=+++5

ii

5

ii 1Kdswx

with: all variables nonnegativev) Introduction of the transformations

xj = (K + 1)yj, j = 1, …, 5 s = (K + 1)11

wj = (K + 1)y5+j, j = 1, …, 5 d = (K + 1)12

The following transformations yield the following system: y1 + 2y2 + y3 – 10y12 = 0 y6 + 2y7 + y8 – y9 – y12 = 02y1 + 3y2 + y4 – 20y12 = 0 2y6 + 3y7 – y10 – 4y12 = 0 y1 + y5 – 6y12 = 0 y1 + 4y2 – 10y6 – 20y7 – 6y8 = 0

0Kyy 12

11

ii =−∑

1y12

ii =∑

vi) Introduction of the artificial variable with appropriate constraint coefficients.Minimize: y13

s.t.: y1 + 2y2 + y3 – 10y12 + 6y13 = 02y1 + 3y2 + y4 – 20y12 + 14y13 = 0

25-50

Page 26: 58323338 Numerical Methods

y1 + y5 – 6y12 + 4y13 = 0y6 + 2y7 + y8 – y9 – y12 – 2y13 = 0

2y6 + 3y7 – y10 – 4y12 = 0y1 + 4y2 – 10y6 – 20y7 – 6y8 + 31y13 = 0

( ) 0y11KKyy 1312

11

ii =−+−∑

1y13

ii =∑

with: all variables nonnegative

26-50

Page 27: 58323338 Numerical Methods

Integer ProgrammingBranch-and-Bound Algorithm

BranchingThe first approximation to the solution of any integer program may be obtained by ignoring the integer requirement and solving the resulting linear program by one of the techniques already presented. If the optimal solution to the linear program is not an integral, components of the first approximation can be round to the nearest feasible integers – second approximation.If the first approximation contains a variable that is not integral, say xj, then i1 < xj < i2, where i1 and i2 are consecutive, nonnegative integers. Two new integer programs are then created by augmenting the original integer program with either the constraint xj ≤ i1 or the constraint xj ≥ i2. This process called branching, has the effect of shrinking the feasible region in a way that eliminates from further consideration the current nonintegral solution for xj but still preserves all possible integral solutions to the original problem.

Example 1maximize: z = 10x1 + x2

s.t. 2x1 + 5x2 ≤ 11 (1)with x1 and x2 nonnegative and integralwe consider the associated linear program obtained by deleting the integral requirement. The solution is found to be x1 = 5.5, x2 = 0, with z = 55. Since 5 < x1 < 6, branching creates the two new integer programsmaximize: z = 10x1 + x2

s.t. 2x1 + 5x2 ≤ 11 (2) x1 ≤ 5

with x1 and x2 nonnegative and integralmaximize: z = 10x1 + x2

s.t. 2x1 + 5x2 ≤ 11 (3) x1 ≥ 6

with x1 and x2 nonnegative and integralFor the two integer programs created by the branching process, first approximations are obtained by again ignoring the integer requirement and solving the resulting linear programs. If either first approximation is still nonintegral, then the integer program which gave rise to that first approximation becomes a candidate for further branching.

Example2By solving inequalities we find that (2) has the first approximation x1 = 5, x2 = 0.2, with z = 50.2, while program (3) has no feasible solution. Thus, program (2) is a candidate for further branching. Since 0 < x2 < 1, we augment (2) with either x2 ≤ 0 or x2

≥ 1, and obtain the two new programsmaximize: z = 10x1 + x2

s.t. 2x1 + 5x2 ≤ 11 (4) x1 ≤ 5 x2 ≤ 0

with x1 and x2 nonnegative and integralmaximize: z = 10x1 + x2

s.t. 2x1 + 5x2 ≤ 11 (5) x1 ≤ 5 x2 ≥ 1

with x1 and x2 nonnegative and integral

With the integer requirements ignored, the solution to program (4) is x1 = 5, x2 = 0, with z = 50, while the solution to program (5) is x1 = 3, x2 = 1, with z = 31. Since both these first approximations are integral, no further branching is required.

BoundingAssume that the objective function is to be maximized. Branching continues until an integral first approximation (which is thus an integral solution) is obtained. The value of the objective for this first integral solution becomes a lower bound for the problem, and all programs whose first approximations, integral or not, yield values of the objective function smaller than the lower bound are discarded. if, in the process, a new integral solution is uncovered having a value of the objective function greater than the current lower bound, then this value of the objective function becomes the new lower bound. The branching process continues until there are no programs with nonintegral first approximations remaining under consideration. At this point, the current lower bound solution is the optimal solution to the original integer program.If the objective function is to be minimized, the procedure remains the same, except that upper bounds are used.

Cut AlgorithmsAt each stage of branching in the branch-and-bound algorithm the current feasible region is cut into two smaller regions by the imposition of two new constraints derived from the first approximation to the current program. This splitting is such that the optimal solution to the current program must show up as the optimal solution to one of the tow new programs. The cut algorithms operate essentially in like fashion, the only difference being that a single new constraint is added at each stage, whereby the feasible region is diminished without being split.

27-50

Page 28: 58323338 Numerical Methods

The Gomory AlgorithmThe new constraint are determined by the following three-step procedureStep1: In the current final simplex tableau, select one (any one) of the nonintegral variables and, without assigning zero values to

the nonbasic variables, consider the constraint equation represented by the row of the selected variable.

225431004

14110121

21121371021

2

3

54321

−−−

x

x

xxxxx

The noninteger assignment for x3 came from the first row of the tableau, which represents the constraint

211

21

37

21

2431 =+−+− xxxx

Step2: Rewrite each fractional coefficient and constant in the constraint equation obtained form Step1 as the sum of an integer and a positive fraction between 0 and 1. Then rewrite the equation so that the left-hand side contains only terms with fractional coefficients (and a fractional constant), while the right-hand side contains only terms with integral coefficients (and an integral constant). Equation becomes

2

15

2

10

3

23

2

11 5431 +=

++

+−++

+− xxxx

or

431541 352

1

2

1

3

2

2

1xxxxxx +−+=−++

Step3: Require the left-hand side of the rewritten equation to be nonnegative. The resulting inequality is the new constraint.

02

1

2

1

3

2

2

1541 ≥−++ xxx or

2

1

2

1

3

2

2

1241 ≥++ xxx

Solved Problemmaximize: z = 2x1 + x2

s.t. 2x1 + 5x2 ≤ 17 (1)3x1 + 2x2 ≤ 10

with: x1 and x2 nonnegative and integral

Ignoring the integer requirements and applying the simplex method to the resulting linear program, we obtain the optimal tableau after one iteration.

320320310

310310321

3313213110

1

3

4321

x

x

xxxx

Tableau 1

The first approximation to program, therefore, is x1 = 10/3, x3 = 31/3, x2 = x4 = 0. Both x1 and x3 are noninteger. Arbitrary selecting x1, we consider the constraint represented by the second row of the tableau, the row defining x1; namely,

310

31

32

421 =++ xxx

Writing each fraction as the sum of an integer and a fraction between 0 and 1, we have

3

13

3

10

3

20 421 +=

++

++ xxx or 142 3

31

31

32

xxx −=−+

Requiring the left-hand side of this equation to be nonnegative, we obtain

031

31

32

42 ≥−+ xx or 12 42 ≥+ xx

as the new constraint. Rewriting the constraints of the original program in the forms suggested by the tableau and adding the new constraint, we generate the new programmaximize: z = 2x1 + x2 + 0x3 + 0x4

s.t. 3

11 x2 + x3 – 32 x4 =

331

(2)

x1 + 32

x2 + 31

x4 = 3

10

2x2 + x4 ≥ 1with: all variables nonnegative and integral

28-50

Page 29: 58323338 Numerical Methods

A surplus variable, x5, and an artificial variable, x6, are introduced into the inequality constraint of (2) and then the two-phase method is applied, with x1, x3, and x6 as the initial set of basic variables. The optimal simplex tableau is obtained after only one iteration. The first approximation to program (2) is thus x1 = 3, x2 = 1/2, x3 = 17/2, x4 = x5 = 0. Choosing x2 to generate the new constraint, we obtain from the third row of Tableau 2

2136121000

212121010

3310001

21761125100

2

1

3

54321

x

x

x

xxxxx

Tableau 2

021

21

21

54 ≥−+ xx or 154 ≥+ xx

This, combined with the constraints of program (2) in the forms suggested by the Tableau 2, gives the new integer programmaximize: z = 2x1 + x2 + 0x3 + 0x4 + 0x5

s.t. x3 – 25

x4 + 25

x5 = 2

17

x1 + 31 x5 = 3 (3)

x2 + 21

x4 – 21

x5= 21

x4 + x5 ≥ 1with: all variables nonnegative and integralIgnoring the integer constraint and applying the two-phase method to program (3), with x1, x2, x3, and x7 (artificial) as the initial basic set, we obtain the optimal Tableau 3.

31961031000

1111000

12101010

3831031001

3206110313100

5

2

1

3

654321

−−

−−

x

x

x

x

xxxxxx

Tableau 3

A new iteration of the process is started from x1 = 38

in Tableau 3. This results in a program whose solution is integral, with x1 =

3, x2 = 0, and z = 6. This solution is then the optimal solution to integer program (1).

Summary of the Gomory cut algorithmConsider the optimal tableau that results from applying the simplex method to an integer program with the integer requirements ignored, and assume that one of the basic variables, xb is nonintegral. The constraint equation corresponding to the tableau row that determined xb must have the form

∑ =+ 0yxyx jjb (1)

where the sum is over all nonbasic variables. The y-terms are the coefficients and the constant term appearing in the tableau row determining xb. Since xb is obtained from (1) by setting the nonbasic variables equal to zero, it follows that y0 is also nonintegral. Write each y-term in (1) as the sum of an integer and a nonnegative fraction less than 1:

jjj fiy += and 000 fiy +=Some of the fj may be zero, but f0 is guaranteed to be positive. Equation (1) becomes

( )∑ +=++ 00 fixfix jjjb

or

∑ ∑−=−+ jjjjb xffixix 00 (2)

If each x-variable is required to be integral, then the left-hand side of (2) is integral, which forces the right-hand side also to be

integral. But, since each fj and xj is nonnegative, so too is ∑ jj xf . The right-hand side of (2) then is an integer which is

smaller than a positive fraction less than 1; that is, a nonpositive integer.

∑ ≤− 00 jj xff or ∑ ≥− 00fxf jj

This is the new constraint in the Gomory algorithm.

29-50

Page 30: 58323338 Numerical Methods

Another cut algorithmConsider (1) in the summary of Gomory algorithm. If each nonbasic variable xj is zero, then xb = y0 is nonintegral. If xb is to become integer-valued, then at least one of the nonbasic xj must be made different from zero. Since all variables are required to be nonnegative and integral, it follows that at least one nonbasic variable must be made greater than or equal to 1. This in turn implies that the sum of all the nonbasic variables must be made greater that or equal to 1. If this condition is used as the new constraint to be adjoined to the original integer program, we have the cut algorithm first suggested by Danzig.

Solved problemmaximize: z = 3x1 + 4x2

s.t. 2x1 + x2 ≤ 62x1 + 3x2 ≤ 9

with: x1 and x2 nonnegative and integral

Introducing slack variables x3 and x4 and then solving the resulting program, with the integer requirements ignored, by the simplex method, we obtain Tableau 1.

75.1225.125.000

5.15.05.010

25.225.075.001

2

1

4321

−−

x

x

xxxx

Tableau 1

The first approximation is, therefore, x1 = 2.25, x2 = 1.5, which is not integral. The nonbasic variables are x3 and x4, so the new constraint is x3 + x4 ≥ 1. Appending this constraint to Tableau 1, after the introduction of surplus variable x5 and artificial variable x6, and solving the resulting program by two-phase method, we generate Tableau 2.

25.1225.01000

111100

55.01010

5.175.01001

3

2

1

54321

−−

x

x

x

xxxxx

Tableau 2

It follows from Tableau 2 that x1 = 1.5, x2 = 2, x3 = 1, with x4 and x5 nonbasic. Since this solution is nonintegral, we take x4 + x5 ≥ 1 as the new constraint. Adjoining this constraint to Tableau 2, after the introduction of surplus variable x6 and artificial variable x7, and solving the resulting program by the two-phase method, we generate Tableau 3.

25.1225.0075.0000

1111000

2102100

5.25.005.1010

75.075.0075.1001

5

3

2

1

654321

−−

−−

x

x

x

x

xxxxxx

Tableau 3From Tableau 3, the current optimal solution is nonintegral, with nonbasic variables x4 and x6. The new constraint is thus x4 + x6 ≥ 1. Adjoining it to Tableau 3 and solving the resulting program by the two-phase method, we obtain x1 = 0, x2 = 3, with z = 12. Since this solution is integral, it is optimal solution to the original integer program.

30-50

Page 31: 58323338 Numerical Methods

Integer Programming: The Transportation AlgorithmA transportation problem involves m sources, each of which has available ai (i = 1, 2, …, m) units of a homogeneous product, and n destinations, each of which requires bj (j = 1, 2, …, n) units of this product. The numbers ai and bj are positive integers. The cost cij of transporting one unit of product from the ith source to the jth destination is given for each i and j. The objective is to develop an integral transportation schedule (the product may not be fractionalized) that meets all demands from current inventory at a minimum total shipping cost.It is assumed that total supply and total demand are equal; that is

∑ ∑= =

=m

i

n

jji ba

1 1

(1)

Equation (1) is guaranteed by creating either a fictitious destination with a demand equal to the surplus if total demand is less than total supply, or a fictitious source with a supply equal to the shortage if total demand exceeds total supply.Let xij represent the (unknown) number of units to be shipped from source i to destination j. Then the standard mathematical model for this problem is:

minimize: ∑∑= =

=m

i

n

jijij xcz

1 1

s.t. ( )miaxn

jiij ,,1

1

==∑=

(2)

( )njbxm

iiij ,,1

1

==∑=

with: all xij nonnegative and integral

The Transportation AlgorithmThe first approximation to system (2) is always integral, and therefore is always the optimal solution. Rather than determining this first approximation by a direct application of the simplex method, we find it more efficient to work with Tableau 1. All entries are self-explanatory, with the exception of the terms ui, and vj, which will be explained shortly. The transportation algorithm is the simplex method specialized to the format of Tableau 1; as usual, it involves

(i) finding an initial, basic feasible solution;(ii) testing the solution for optimality;(iii) improving the solution when it is not optimal;(iv) repeating steps (ii) and (iii) until the optimal solution is obtained.

Destinations

1 2 3 … n Supply ui

Sou

rces

1c11 c12 c13 c1n

a1 u1 x11 x12 x13 … x1n

2c21 c22 c23 c2n

a2 u2 x21 x22 x23 … x2n

…… …… …… …… … …… …… ……

m

cm

1 cm

2 cm

3 cm

n

am um

xm

1 xm

2 xm

3 …xm

n

Demand b1 b2 b3 … bn

vj v1 v2 v3 … vn

Tableau 1

An Initial Basic SolutionNorthwest Corner Rule. Beginning with (1.1) cell in Tableau 1 (the northwest corner), allocate to x11 as many units as possible without violating the constraints. This will be the smaller of a1 and b1. Thereafter, continue by moving one cell to the right, if some supply remains, or if not, one cell down. At each step, allocate as much as possible to the cell (variable) under consideration without violating the constraints: the sum of the i-th row allocations cannot exceed ai, the sum of the j-th column allocations cannot exceed bj, and no allocation can be negative. The allocation may be zero.Vogel’s Method. For each row and each column having some supply or some demand remaining calculate its difference, which is the nonnegative difference between the two smallest shipping costs cij associated with unassigned variables in that row or column. Consider the row or column having the largest difference; in case of a tie, arbitrarily choose one. In this row or column, locate that unassigned variable (cell) having the smallest unit shipping cost and allocate to it as many units as possible without violating the constraints. Recalculate the new differences and repeat the above procedure until all demands are satisfied.

31-50

Page 32: 58323338 Numerical Methods

Variables that are assigned values by either one of these starting procedures become the basic variables in the initial solution. The unassigned variables are nonbasic and, therefore, zero. We adopt the convention of not entering the nonbasic variables in Tableau 1 – they are understood to be zero – and of indicating basic-variable allocations in boldface type.The northwest corner rule is the simpler of the two rules to apply. However, Vogel’s method, which takes into account the unit shipping costs, usually results in a closer-to-optimal starting solution.

Test for OptimalityAssign on (any one) of the ui or vi in Tableau 1 the value zero and calculate the remaining ui and vi so that for each basic variable ui + vj = cij. Then, for each nonbasic variable, calculate the quantity cij – ui – vj. If all these letter quantities are nonnegative, the current solution is optimal; otherwise, the current solution is not optimal.

Improving the SolutionDefinition: A loop is a sequence of cells in Tableau 1 such that: (i) each pair of consecutive cells lie in either the same row or the same column; (ii) no three consecutive cells lie in the same row or column; (iii) the first and last cells of the sequence lie in the same row or column (iv) no cell appears more that once in the sequence.Example 1The sequences {(1,2), (1,4), (2,4), (2, 6), (4, 6), (4, 2)} and {(1, 3), (1, 6), (3, 6), (3, 1), (2, 1), (2, 2), (4, 2), (4, 4), (2, 4), (2, 3)} illustrated if Fig 1 and 2, respectively, are loops. Note that a row or column can have more than two cells in the loop (as the second row of Fig 2), but no more than two can be consecutive.

Consider the nonbasic variable corresponding to the most negative of the quantities cij – ui – vj calculated in the test for optimality; it is made the incoming variable. Construct a loop consisting exclusively of this incoming variable (cell) and current basic variables (cells). Then allocate to the incoming cell as many units as possible such that, after appropriate adjustments have been made to the other cells in the loop, the supply and demand constraint are not violated, all allocations remain nonnegative, and one of the old basic variables has been reduced to zero (whereupon it ceases to be basic).

DegeneracyIn view of condition (1), only n + m – 1 of the constraint equations in system (2) are independent. Then a nondegenerate basic feasible solution will be characterized by positive values for exactly n + m – 1 basic variables. If the process of improving the current basic solution results in two or more current basic variables being reduced to zero simultaneously, only one is allowed to become nonbasic (solver’s choice, although the variable with the largest unit shipping cost is preferred). The other variable(s) remains (remain) basic, but with a zero allocation, thereby rendering the new basic solution degenerate.The northwest corner rule always generates an initial basic solution; but it may fail to provide n + m – 1 positive values, thus yielding a degenerate solution. If Vogel’s method is used, and does not yield that same number of positive values, additional variables with zero allocations must be designated as basic. The choice is arbitrary, to a point: basic variables cannot form loops, and preference is usually given to variables with the lowest associated shipping costs.Improving a degenerate solution may result in replacing one basic variable having a zero value by another such. Although the two degenerate solutions are effectively the same – only the designation of the basic variables has changes, not their values – the additional iteration is necessary for the transportation algorithm to proceed.

Solved Problems1. A car rental company is faced with an allocation problem resulting from rental agreements that allow cars to be returned to locations other than those at which they were originally rented. At the present time, there are two locations (sources) with 15 and 13 surplus cars, respectively, and four locations (destinations) requiring 9, 6, 7, and 9 cars, respectively. Unit transportations costs (in dollars) between the locations are as follows:

Dest. 1 Dest. 2 Dest. 3 Dest. 4Source 1 45 17 21 30Source 2 14 18 19 31Set up the initial transportation tableau for the minimum-cost schedule.

32-50

Page 33: 58323338 Numerical Methods

Since the total demand (9 + 6 + 7 + 9 = 31) exceeds the total supply (15 + 13 = 28), a dummy source is created having a supply equal to the 3-unit shortage. In reality, shipments from this fictitious source are never made, so the associated shipping costs are taken as zero. Positive allocations from this source to a destination represent cars that cannot be delivered due to a shortage of supply; they are shortages a destination will experience under an optimal shipping schedule. The xij, ui, and vi are not entered, since they are unknown at the moment.

We begin with x11 and assign it the minimum of a1 = 15 and b1 = 9. Thus, x11 = 9, leaving six surplus cars at the first source. We next move one cell to the right and assign x12 = 6. These two allocations together exhaust the supply at the first source, so we move one cell down and consider x22. Observe, however, that the demand at the second destination has been satisfied by the x12

allocation. Since we cannot deliver additional cars to it without exceeding its demand, we must assign x22 = 0 and the move one cell to the right. Continuing in this manner, we obtain the degenerate solution (fewer than 4 + 3 – 1 = 6 positive entries) depicted in Tableau 1B.

To determine whether the initial allocation found in Tableau 1B is optimal, we first calculate the terms u1 and vj with respect to the basic-variable cells of the tableau. Arbitrarily choosing u2 = 0 (since the second row contains more basic variables that any other row or column, this choice will simplify the computations), we find:(2, 2) cell: u2 + v2 = c22, 0 + v2 = 18, or v2 = 18(2, 3) cell: u2 + v3 = c23, 0 + v3 = 19, or v3 = 19(2, 4) cell: u2 + v4 = c24, 0 + v4 = 31, or v4 = 31(1, 2) cell: u1 + v2 = c12, u1 + 18 = 17, or u1 = -1(1, 1) cell: u1 + v1 = c11, -1 + v1 = 45, or v1 = 46(3, 4) cell: u3 + v4 = c34, u3 + 31 = 0, or u3 = -31These values are shown in Tableau 1C. Next we calculate the quantities cij – ui – vj for each nonbasic variable cell of Tableau 1B.(1, 3) cell: c13 – u1 – v3 = 21 – (-1) – 19 = 3(1, 4) cell: c14 – u1 – v4 = 30 – (-1) – 31 = 0(2, 1) cell: c21 – u2 – v1 = 14 – 0 – 46 = -32(3, 1) cell: c31 – u3 – v1 = 0 – (-31) – 46 = -15(3, 2) cell: c32 – u3 – v2 = 0 – (-31) – 18 = 13(3, 3) cell: c33 – u3 – v3 = 0 – (-31) – 19 = 12These results also are recorded in Tableau 1C, in parentheses.

33-50

Page 34: 58323338 Numerical Methods

Since at least one of these (cij – ui – vj)-values is negative, the current solution is not optimal, and a better solution can be obtained by increasing the allocation to the variable (cell) having the largest negative entry, here the (2, 1) cell of Tableau 1C. We do so by placing a boldface plus sign (signaling an increase) in the (2, 1) cell and identifying a loop containing, besides this cell, only basic-variable cells. Such a loop is shown by the heavy lines in Tableau 1C. We now increase the allocation the (2, 1) cell as much as possible, simultaneously adjusting the other cell allocations in the loop so as not to violate the supply, demand, or nonnegativity constraints. Any positive allocation to the (2, 1) cell would force x22 to become negative. To avoid this, but still make x21 basic, we assign x21 = 0 and remove x22 from our set of basic variables. The new basic solution, also degenerate, is given in Tableau 1D.We now check whether this solution is optimal. Working directly on Tableau 1D, we first calculate the new ui and vj with respect to the new basic variables, and then compute cij – ui – vj for each nonbasic variable cell. Again we arbitrarily choose u2 = 0, since the second row contains more basic variables than any other row or column. These results are shown in parentheses in Tableau 1E. Since two entries are negative, the current solution is not optimal, and a better solution can be obtained by increasing the allocation to the (1, 4) cell. The loop whereby this is accomplished is indicted by heavy lines in Tableau 1E; it consists of the cells (1, 4), (2, 4), (2, 1) and (1, 1). Any amount added to cell (1, 4) must be simultaneously subtracted from cells (1, 1) and (2, 4) and then added to cell (2, 1), so as not to violate the supply-demand constraints. Therefore, no more than six cars can be added to cell (1, 4) without forcing x24 as a basic variable. The new, nondegenerate basic solution is shown in Tableau 1F.

After one

further optimality test (negative) and consequent change of basis, we obtain Tableau 1H, which also shown the results of the optimality test fo the new basic solution. It is seen that each cij – ui – vj is nonnegative; hence the new solution is optimal. Than is, x12 = 6, x13 = 3, x14 = 6, x21 = 9, x23 = 4, x34 = 3, with all other variables nonbasic and, therefore, zero. Furthermore,

z = 6(17) + 3(21) + 6(30) + 9(14) + 4(19) + 3(0) = $547

The fact that some positive allocation comes from the dummy source indicates that not all demands can be met under this optimal schedule. In particular, destination 4 will receive three fewer cars than it needs.

34-50

Page 35: 58323338 Numerical Methods

Nonlinear Programming: Single-Variable Optimization

The ProblemA one-variable, unconstrained, nonlinear program has the form

optimize: z = f(x) (1)

where f(x) is a (nonlinear) function of the single variable x, and the search for the optimum (maximum or minimum) is conducted over the infinite interval (-∞, ∞). If the search is restricted to a finite subinterval [a, b], then the problem becomes

optimize: z = f(x)s.t. a ≤ x ≤ b (2)

which is one-variable, constrained program.An objective function f(x) has a local (or relative) minimum at x0 if there exists a (small) interval centered at x0 such that f(x) ≥ f(x0) for all x at which the function is defined, then the minimum at x0 (besides being local) is a global (or absolute) minimum. Local and global maxima are defined similarly, in terms of the reversed inequality.Program (1) seeks a global optimum; program (2) does too, insofar as it seems the best of the local optima over [a, b]. It is possible that the objective function assumes even better values outside [a, b], but these are not of interest.

Results from CalculusTheorem 1: If f(x) is continuous on the closed and bounded interval [a, b], then f(x) has global optima (both a maximum and a

minimum) on this interval.Theorem 2: If f(x) has a local optimum at x0 and if f(x) is differentiable on a small interval centered at x0, then f’(x0) = 0.Theorem 2: If f(x) is twice-differentiable on a small interval centered at x0, and if f’(x0) = 0 and f’’(x0) > 0, then f(x) has a local

minimum at x0. If instead f’(x0) = 0 and f’’(x0) < 0, then f(x) has local maximum at x0.If follows from the first two theorems that if f(x) is continuous on [a, b], then local and global optima for program (2) will occur among points where f’(x0) does not exist, or among points where f’(x0) = 0 (generally called stationary or critical points), or among the end points x = a and x = b.Since program (1) is not restricted to a closed and bounded interval, there are no endpoints to consider. Instead, the values of the objective function at the stationary points and at points where f’(x) does not exist are compared to the limiting values of f(x) as x → ± ∞. It may be that neither limit exists (consider f(x) = sin x). But if either limit does exist – and we accept ± ∞ as a “limit” here – and yields the best value of f(x) (the largest for a maximization program of the smallest for a minimization program), then a global optimum for f(x) does not exist. If the best value occurs at one of the finite points, then this best value is the global optimum.

Sequential-search TechniquesIn practice, locating optima by calculus is seldom fruitful: either the objective function is not known analytically, so that differentiation is impossible, or the stationary points cannot be obtained algebraically. In such cases, numerical methods are used to approximate the location of (some) local optima to within an acceptable tolerance.Sequential-search techniques start with a finite interval in which the objective function is presumed unimodal; that is, the interval is presumed to include one and only one point at which f(x) has a local maximum or minimum. The techniques then systematically shrink the interval around the local optimum until the optimum is confined to within acceptable limits; this shrinking is effected by sequentially evaluating the objective function at selected points and then using the unimodal property to eliminate portions of the current interval.Specific sequential searches are considered in the three sections that follow.

Three-point Interval SearchThe interval under consideration is divided into quarters and the objective function evaluated at the three equally spaced interior points. The interior point yielding the best value of the objective is determined (in case of a tie, arbitrarily choose one point), and the subinterval centered at this point and made up of two quarters of the current interval replaces the current interval. The three-point interval search is the most efficient equally spaced search procedure in terms of achieving a prescribed tolerance with a minimum number of functional evaluations. It is also one of the easiest sequential searches to code for the computer.

Fibonacci SearchThe Fibonacci sequence, {Fn} = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …}, forms the basis of the most efficient sequential-search technique. Each number in the sequence is obtained by adding together the two preceding numbers; exceptions are the first two number, F0 and F1, which are both 1.The Fibonacci search is initialized by determining the smallest Fibonacci number that satisfies FNε ≥ b – a, where ε is a prescribed tolerance and [a, b] is the original interval of interest. Set ε ≡ (b – a) / FN. The first two points in the search are located FN – 1ε’ units in from the endpoint of the [a, b], where FN – 1 is the Fibonacci number preceding FN. Successive points in the search are considered one at a time and are positioned Fjε’(j = N – 2, N – 3, …, 2) units in from the newest endpoint of the current interval. Observe that with the Fibonacci procedure we can state in advance the number of functional evaluations that will be required to achieve a certain accuracy; moreover, that number is independent of the particular unimodal function.

Golden-Mean SearchA search nearly as efficient as the Fibonacci search is based on the number ( ) 6180.0215 =− , known as the golden mean. The first two points of the search are located (0.6180)(b – a) units in from the endpoints of the initial interval [a, b].

35-50

Page 36: 58323338 Numerical Methods

Successive points are considered one at a time and are positioned 0.6180Li units in from the newest endpoint of the current interval, where Li denotes the length of this interval.

Convex FunctionsSearch procedures are guaranteed to approximate global optima on a search interval only when the objective function is unimodal there. In practice, one usually does not know whether a particular objective function is unimodal over a specified interval. When a search procedure is applied in such a situation, there is no assurance it will uncover the desired global optimum. Exceptions include programs that have convex or concave objective functions.A function f(x) is convex on an interval φ (finite or infinite) if for any two points x1 and x2 in φ and for all 0 ≤ α ≤ 1,

( )( ) ( ) ( ) ( )211211 xfxfxxf αααα −+≤−+ (3)

If (3) holds with the inequality reversed, then f(x) is concave. Thus, the negative of a convex function is concave, and conversely. The graph of a convex function is shown in Fig. 4; a defining geometrical property is that the curve lies on or above any of its tangents. Convex functions and concave functions are unimodal.Theorem 4: If f(x) is twice-differentiable on φ, then f(x) is convex on φ if and only if f’’(x) ≥ 0 for all x in φ. It is concave if and

only if f’’(x) ≤ 0 for all x in φ.Theorem 5: If f(x) is convex on φ, then any local minimum on φ is a global minimum on φ. If f(x) is concave on φ, then any local

maximum on φ is a global maximum on φ.If (3) holds with strict inequality except at α = 0 and α = 1, the functions is strictly convex. Such a function has a strictly positive second derivative, and any local (and therefore global) minimum is unique. Analogous results hold for strictly concave functions.

Solved Problems1. Maximize: z = x(5π – x) on [0, 20]Here f(x) = x(5π – x) is continuous, and f’(x) = 5π – 2x. With the derivative defined everywhere, the global maximum on [0, 20] occurs at an endpoint x = 0 or x = 20, or at a stationary point, where f’(x) = 0. We find x = 5π/2 as the only stationary point in [0, 20]. Evaluating the objective function at each of these points, we obtain the table

84.8569.610)(

20250

−xf

x π

from which we conclude that x = 5π/2, with z = 61.69.

2. Maximize: [ ]4 ,4on 82 −−=xz .Here

≤−≤≤−−

−≤−=−=

xx

xx

xx

xxf

88

888

88

8)(2

2

2

2

is a continuous function, with

<<<−−

−<=′

xx

xx

xx

xf

82

882

82

)(

The derivative does not exist at 8±=x , and it is zero at x = 0; all three points are in [–4, 4]. Evaluating the objective function at each of these points, and at the endpoints 4±=x , we generate the table

80808)(

48084

xf

x −−

from which we conclude that the global maximum on [–4, 4] is z = 8, which is assumed at the three points 4±=x and x = 0.

3. Use the three-point interval search to approximate the location of the maximum of f(x) = x(5π – x) on [0, 20] to within ε = 1.

Since f’’(x) = -2 < 0 everywhere, it follows from Theorem (4) that f(x) is concave, hence unimodal, on [0, 20]. Therefore, the three-point interval search is guaranteed to converge to the global maximum.First iteration: Dividing [0, 20] into quarters, we have x1 = 5, x2 = 10, and x3 = 15 as the three interior points. Therefore

f(x1) = x1(5π – x1) = 5(5π – 5) = 53.54f(x2) = x2(5π – x2) = 10(5π – 10) = 57.08f(x3) = x3(5π – x3) = 15(5π – 15) = 10.62

Since x2 is the interior point generating the greatest value of the objective function, we take the interval [5, 15], centered at x2 as the new interval of interest.Second iteration: We divide [5, 15] into quarters, with x4 = 7.5, x2 = 10, x5 = 12.5 as the three interior points. So

f(x4) = x4(5π – x4) = 7.5(5π – 7.5) = 61.56f(x2) = x2(5π – x2) = 10(5π – 10) = 57.08 (as before)f(x5) = x5(5π – x5) = 12.5(5π – 12.5) = 40.10

36-50

Page 37: 58323338 Numerical Methods

As x4 is the interior point yielding the largest value of f(x), we take the interval [5, 10], centered at x4, as the new interval of interest.Third iteration: We divide [5, 10] into quarters, with x6 = 6.25, x4 = 7.5, and x7 = 8.75 as the new interior points. So

f(x6) = x6(5π – x6) = 6.25(5π – 6.25) = 59.11f(x4) = 61.56 (as before)f(x7) = x7(5π – x7) = 8.75(5π – 8.75) = 60.88

As x4 yields the largest value of f(x), we take the interval [6.25, 8.75]. centered at x4, as the new interval of interest.Fourth iteration: Dividing [6.25, 8.75] into quarters, we generate x8 = 6.875, x4 = 7.5, and x9 = 8.125 as the new interior points. Thus

f(x8) = x8(5π – x8) = 6.875(5π – 6.875) = 60.73f(x4) = 61.56 (as before)f(x9) = x9(5π – x9) = 8.125(5π – 8.125) = 61.61

Now x9 is the interior point yielding the largest value of the objective function, so we take the subinterval centered at x9, namely [7.5, 8.75], as the new interval for consideration. The midpoint of this interval however, is within the prescribed tolerance, ε = 1, of all other point in the interval; hence we take

x = x9 = 8.125 with z = f(x9) = 61.61

4. Redo Problem 3 using the Fibonacci search.

Initial points: The first Fibonacci number such that FN(1) ≥ 20 – 0 is F8 = 21. We set N = 8,

9524.021

020 =−=−=′NF

abε

and then position the first two points in the search

38.12)9524.0(137 ==′εF units

in from each endpoint. Consequently,x1 = 0 + 12.38 = 12.38 x2 = 20 – 12.38 = 7.62

f(x1) = (12.38)(5π – 12.38) = 41.20f(x2) = (7.62)(5π – 7.62) = 61.63

Using the unimodal property, we conclude that the maximum must occur to the left of 12.38, we reduce the interval of interest to [0, 12.38].First iteration: The next-lower Fibonacci number (F7 was the last one used) is F6 = 8; so the next point in the search is positioned

619.7)9524.0(86 ==′εF units

in from the newest endpoint, 12.38. Thusx3 = 12.38 – 7.619 = 4.761

f(x3) = (4.761)(5π – 4.761) = 52.12We conclude that the maximum must occur in the new interval of interest [4.761, 12.38].Second iteration: The next-lower Fibonacci number now is F5 = 5. Thus

)9524.0(55 =′εFx4 = 4.761 + 5(0.9524) = 9.523

f(x4) = (9.523)(5π – 9.523) = 58.90We conclude that the new interval of interest is [4.761, 9.523].Third iteration: The next-lower Fibonacci number now is F4 = 3. Hence

x5 = 9.523 – 3(0.9524) = 6.666f(x5) = (6.666)(5π – 6.666) = 60.27

From the unimodal property follows that the new interval of interest is [6.666, 9.523]Fourth iteration: The next-lower Fibonacci number now is F3 = 2, Hence

x6 = 6.666 + 2(0.9524) = 8.571f(x6) = (8.571)(5π – 8.571) = 61.17

We conclude that [6.666, 8.571] is the new interval of interest. The midpoint of this interval, however, is within ε = 1 (in fact, within ε = 0.9524) of every other point of the interval. (Theoretically, the midpoint should coincide with x2; the small apparent discrepancy arises from roundoff.) We therefore accept x2 as the location of the maximum, i.e.,x = x2 = 7.62 with z = f(x2) = 61.63

5. Redo Problem 3 using the golden-mean search.Initial points: The length of the initial interval is L1 = 20, so the first two points in the search are positioned

(0.6180)(20) = 12.36 unitsin from each endpoint. Thus

x1 = 0 + 12.36 = 12.36 x2 = 20 – 12.36 = 7.64f(x1) = (12.36)(5π – 12.36) = 41.38f(x2) = (7.64)(5π – 7.64) = 61.64

From the unimodal property follows that the maximum must occur to the left of 12.36; hence we retain [0, 12.36] as the new interval of interest.First iteration: The new interval has length L2 = 12.36, so the next point in the search is positioned 0.6180L2 units in from the newest end point. Therefore

37-50

Page 38: 58323338 Numerical Methods

x3 = 12.36 – (0.6180)(12.36 = 4.722f(x3) = (4.722)(5π – 4.722) = 51.88

We determine [4.722, 12.36] as the new interval of interest.Second iteration: L3 = 12.36 – 4.722 = 7.638; thus

x4 = 4.722 + (0.6180)(7.638) = 9.442f(x4) = (9.442)(5π – 9.442) = 59.16

We conclude that [4.722, 9.442] is the new interval of interest

Third iteration: L4 = 9.442 – 4.722 = 4.720; thusx5 = 9.442 – (0.6180)(4.720) = 6.525f(x5) = (6.525)(5π – 6.525) = 59.92

We conclude that [6.525, 9.442] is the new interval of interest.Fourth iteration: L5 = 9.442 – 6.525 = 2.917; hence

x6 = 6.525 + (0.6180)(2.917) = 8.328f(x6) = (8.328)(5π – 8.328) = 61.46

We find [6.525, 8.328] as the new interval of interest. Notice that this new interval is of length less than 2ε = 2, but that the included sample point, x2, is not within ε of all other points in the interval. Therefore, another iteration is required. Fifth iteration: L6 = 8.328 – 6.525 = 1.803; therefore

x7 = 8.328 – (0.6180)(1.803) = 7.214f(x7) = (7.214)(5π – 7.214) = 61.28

This new point determines [x7, x6] = [7.214, 8.328] as the new interval of interest. Now, however, the interior point x2 = 7.64 is within ε = 1 of all other points in the interval; so we take it as the location of the maximum. That is,

x = x2 = 7.64 with z = f(x2) = 61.64

Nonlinear Programming: Multivariable Optimization without ConstraintsThe present chapter will largely consist in a generalization of the results of single-variable optimization to the case of more than one variable.

optimize: z = f(X) where X ≡ [x1, x2, …, xn]T (1)Moreover, we shall always suppose the optimization in (1) to be a maximization; all results will apply to a minimization program if f(X) is replaced by – f(X).

Local and Global MaximaDefinition: An ε-neighborhood (ε > 0) around Χis the set of all vectors X such that

( ) ( ) ( ) ( ) ( ) 22222

211 ˆˆˆˆˆ ε≤−++−+−≡Χ−ΧΧ−Χ nn

Txxxxxx

In geometrical terms, an ε-neighborhood around Χis the interior and boundary of an n-dimensional sphere of radius ε centered at

Χ.

Gradient Vector and Hessian MatrixThe gradient vector f∇associated with a function f(x1, x2, …, xn) having first partial derivatives is defined by

T

nx

f

x

f

x

ff

∂∂

∂∂

∂∂≡∇ ,,,

21

The notation Χ∇ ˆf signifies the value of the gradient at Χ. For small displacements from Χin various directions, the

direction of maximum increase in f(X) is the direction of the vector Χ∇ ˆf .

Example 1 For ( ) 33

222

21321 3,, xxxxxxxf −= , with [ ]T3,2,1ˆ =Χ ,

−−=∇

23

22

332

21

21

3

23

6

xx

xxx

xx

f whence

−−=

−−=∇

108

105

12

)3()2(3

)3)(2(2)1(3

)2)(1(6

22

32f

Therefore, at [1, 2, 3]T, the function increases most rapidly in the direction of [12, –105, –108]T.The Hessian matrix associated with a function f(x1, x2, …, xn) that has second partial derivatives is

∂∂∂≡Η

jif xx

f2

(i, j = 1, 2,…,n)

The notation ΧΗ

ˆf signifies the value of the Hessian matrix at Χ. In preparation for Theorems 4 and 5 below, we shall need

the following:Definition: An n × n symmetric matrix A (one such that A = AT) is negative definite (negative semi-definite) if XTAX is negative

(nonpositive) for every n-dimensional vector X ≠ 0.Theorem 1: Let A ≡ [aij] be an n × n symmetric matrix, and define the determinants

38-50

Page 39: 58323338 Numerical Methods

( ) Α−≡+≡−≡≡ − det1 1

332331

322221

312111

32221

12112111

nnA

aaa

aaa

aaa

Aaa

aaAaA

Then A is negative definite if and only if A1, A2, …, An are all negative; A is negative semi-definite if and only if A1, A2, …, Ar (r < n) are all negative and the remaining A’s are all zero.

Example 2 For the function of Example 1,

−−−−=Η

322

232

232

331

12

660

626

066

xxxx

xxxx

xx

f whence

−−−−=Η

Χ721080

108546

0612

ˆf

For ΧΗ

ˆf , A1 = 12 > 0, so that fΗ is not negative definite, or even negative semi-definite, at Χ.

Results from CalculusTheorem 2: If f(X) is continuous on a closed and bounded region, then f(X) has a global maximum (and also a global minimum)

on that region.Theorem 3: If f(X) has a local maximum (or a local minimum) at X* and if f∇exists on some ε-neighborhood around X*, then

.0=∇ ∗Χf

Theorem 4: If f(X) has second partial derivatives on an ε-neighborhood around X*, and if 0=∇ ∗Χf and ∗ΧΗf is negative

definite, then f(X) has a local maximum at X*.It follows from Theorem 2 and 3 that a continuous f(X) assumes its global maximum among those points at which f∇does not exist or among those points at which 0=∇f (stationary points) – unless the function assumes even larger values as XTX → ∞. In the latter case, no global maximum exists.Analytical solutions based on calculus are even harder to obtain for multivariable programs than for single-variable programs, and so, once again, numerical methods are used to approximate (local) maxima to within prescribed tolerance.

The Method of Steepest AscentChoose an initial vector X0, making use of any prior information about where the desired global maximum might be found. Then determine vectors X1, X2, X3, … by the iterative relation

kfkkk Χ

∗+ ∇+Χ=Χ λ1 (2)

Here ∗kλ is a positive scalar which maximizes ( )

kff k Χ∇+Χ λ ; this single-variable program is solved by the methods of

single-variable optimization. It is best if ∗kλ represents a global maximum; however, a local maximum will do. The iterative

process terminates if and when the differences between the values of the objective function at two successive X-vectors is smaller than a prescribed tolerance. The last-computed X-vector becomes the final approximation to X*.

The Newton-Raphson MethodChoose an initial vector X0, as in the method of steepest ascent. Vectors X1, X2, X3, … then are determined iteratively by

kk

ffkk Χ

Χ+ ∇

Η−Χ=Χ1

1 (3)

The stopping rule is the same as for the method of steepest ascent.The Newton-Raphson method will converge to a local maximum if fΗ is negative definite on some ε-neighborhood around the maximum and if X0, lies in that ε-neighborhood.

Remark 1: If fΗ is negative definite, 1−Ηf exists and is negative definite.

If X0 is not chosen correctly, the method may converge to a local minimum or it may not converge at all. In either case, the iterative process is terminated and then begun anew with a better initial approximation.

The Fletcher-Powell MethodThis method, an eight-step algorithm, is begun by choosing an initial vector Χand prescribing a tolerance ε, and by setting an n

× n matrix G equal to the identity matrix. Both Χand G are continually updated until successive values of the objective function

differ by less than ε, whereupon the last value of Χis taken as X*.

Step1: Evaluate )ˆ(Χ= fα and .Χ∇= fB

Step2: Determine ∗λ such that ( )Β+Χ Gˆ λf is maximized when .∗=λλ Set .GD Β= ∗λStep3: Designate Dˆ +Χ as the updated value of .ΧStep4: Calculate )ˆ(Χ= fβ for the updated values of .ΧIf ,εαβ <− go to Step5; if not, go to Step6.

Step5: Set ,)(,ˆ β=ΧΧ=Χ ∗∗ f and stop.

Step6: Evaluate C = Χ∇ ˆf for the updated vector ,Χand set Y = B – C.

39-50

Page 40: 58323338 Numerical Methods

Step7: Calculate the n × n matrices

GGYYGYY

1-MandDD

YD

1L T

T

=

= T

T

Step8: Designate G + L + M as the updated value of G. Setα equal to the current value of ,β B equal to the current value of C, and return to Step2.

Hooke-Jeeves’ Pattern SearchThis method is a direct-search algorithm that utilizes exploratory moves, which determine an appropriate direction, and pattern moves, which accelerate the search. The method is begun by choosing an initial vector, B ≡ [b1, b2, …, bn]T, and step size, h.Step1: Exploratory moves around B are made by perturbing the components of B, in sequence, by ±h units. If either perturbation

improves |(i.e., increases) the value of the objective function beyond the current value, the initial value being f(B), the perturbed value of that component is retained; otherwise the original value of the component is kept. After each component has been tested in turn, the resulting vector is denoted by C. If C = B, go to Step2; otherwise go to Step3.

Step2: B is the location of the maximum to within a tolerance of h. Either h is reduced and Step1 repeated, or the search is terminated with X* = B.

Step3: Make a pattern move to a temporary vector T = 2C – B. (T is reached by moving from B to C and continuing for an equal distance in the same direction.)

Step4: Make exploratory moves around T similar to the ones around B described in Step1. Call the resulting vector S. If S = T, go to Step6.

Step5: Set B = C and return to Step1.Step6; Set B = C, C = S, and return to Step3.

A Modified Pattern SearchHooke-Jeeves’ pattern search terminates when no perturbation of any one component of B leads to an improvement in the objective function. Occasionally this termination is premature, in that perturbations of two or more of the components simultaneously may lead to an improvement in the objective function. Simultaneous perturbations can be included in the method by modifying Step2 as follows:Step2’: Conduct an exhaustive search over the surface of the hypercube centered at B by kh units, where k = –1, 0, 1. For a vector

of n components, there are 3n – 1 perturbations to consider. As soon as an improvement is realized, terminate the exhaustive search, set the improved vector equal to B, and return to Step1. If no improvement is realized, B is the location of the maximum to within a tolerance of h. Either h is reduced and Step1 repeated, or the search is terminated with X* = B.

Choice of an Initial ApproximationEach numerical method starts with a first approximation to the desired global maximum. At times, such an approximation is apparent from physical or geometrical aspects of the problem. In other cases, a random number generator is used to provide different values for X. Then f(X) is calculated for each randomly chosen X, and that X which yields the best value of the objective function is taken as the initial approximation. Even this random sampling procedure implies and initial guess of the location of the maximum, in that the random numbers must be normalized so as to lie in some fixed interval.

Concave FunctionsThere is no guarantee that a numerical method will uncover a global maximum. It may converge to merely a local maximum or, worse yet, may not converge at all. Exceptions include programs having concave objective functions.A function f(X) is convex on a convex region R, if for any two vector X1 and X2 in R and for all 0 ≤ α ≤ 1,

f(αX1 + (1 – α)X2) ≤ αf(X1) + (1 – α)f(X2) (4)A function is concave on R if and only if its negative is convex on R. The convex region R may be finite or infinite.Theorem 5: If f(X) has second partial derivatives on R, then f(X) is concave on R if and only if its Hessian matrix fΗ is

negative semi-definite for all X in R.Theorem 6: If f(X) is concave on R, then any local maximum on R is a global maximum on R.

These two theorems imply that, if fΗ is negative semi-definite everywhere, then any local maximum yields a solution to

program (1). If fΗ is negative definite everywhere, then f(X) is strictly concave (everywhere), and the solution to program (1) is unique.

Solved Problems

1. Maximize: )3()1( 23321 −+−= xxxxz

Here ).3()1(),,( 23321321 −+−= xxxxxxxf The gradient vector, [ ] ,33,,1 2

312T

xxxf −−=∇ exists everywhere

and is zero only atX1 = [0, 1, 1]T and X2 = [0, 1, – 1]T

We have f(X1) = – 2 and f(X2) = 2. But f(x1, x2, x3) becomes arbitrarily large as x3 (for instance) does so; hence no global maximum exists. The vector X2 is not even the site of a local maximum; rather, it is a saddle point, as is X1.

2. Minimize: ( ) ( ) .105 22

2

1 +−+−= πxxz

Multiplying this objective function by – 1, we obtain the equivalent maximization program

40-50

Page 41: 58323338 Numerical Methods

Maximize: ( ) ( ) 105 22

2

1 −−−−−= πxxz

for which [ ] .,52 21

Txxz π−−−=∇ Thus there is a single stationary point, ,,5 21 π== xx at which z = – 10. Now, as

,22

21 ∞→+ xx z becomes arbitrarily small; consequently, z* = – 10 is the global maximum, and z* = + 10 is the global minimum

for the original minimization program. The minimum is, of course, also assumed as .1416.3,2361.25 21 ≈=≈= ∗∗ πxx

3. Use the method of steepest ascent to

minimize: ( ) ( ) 105 22

2

1 +−+−= πxxz

Going over to the equivalent program

maximize: ( ) ( ) 105 22

2

1 −−−−−= πxxz (1)

we require a starting program solution, which we obtain by a random sampling of the objective function over the region – 10 ≤ x1, x2 ≤ 10. The sample points and corresponding z-values are shown in the table below. The maximum z-entry is – 36.38, occurring at X0 = [6.567, 5.891]T, which we take as the initial approximation to X*. The gradient of the objective function for program (1) is

( )( )

−−−−=∇

π2

1

2

52

x

xf

x1 – 8.537 – 0.9198 9.201 9.250 6.597 8.411 8.202 – 9.173 – 9.337 – 5.794x2 – 1.099 – 8.005 – 2.524 7.546 5.891 – 9.945 – 5.709 – 6.914 8.163 – 0.0210z – 144.0 – 144.2 – 90.61 – 78.59 – 36.58 – 219.4 – 123.9 – 241.3 – 169.2 – 84.48

First iteration.

( )( )

−−

=

−−−−+

=∇+Χ Χ λ

λπ

λλ499.5891.5

722.8597.6

891.52

5597.62891.5

597.60

0 f

( ) ( ) ( )59.363.1063.106

10499.5891.55722.8597.6

2

22

00

−+−=

−−−−−−−=∇+Χ Χ

λλ

πλλλ ff

Using the analytical methods described in previous chapter, we determine that this function of λ assumes a (global) maximum at

.5.00 =∗λ Thus,

( )( )

=

−−

=∇+Χ=Χ Χ∗

142.3

236.2

5.0499.5891.5

5.0722.8597.60

001 fλ

with f(X1) = – 10.00. Since the difference between f(X0) = – 36.58 and f(X1) = – 10.00 is significant, we continue iterating.

Second iteration.

( )( )

−+

=

−−−−+

=∇+Χ Χ λ

λπ

λλ0008.0142.3

0001.0236.2

142.32

5236.22142.3

236.21

1 f

( ) ( ) ( )( ) 782

22

1

1010382.6500.6

100008.0142.350001.0236.21

Χ

+−−=

−−−−−−−=∇+Χ

λλ

πλλλ ff

Using the analytical methods described in previous chapter, we find that this function of λ has a (global) maximum at

.4909.01 =∗λ Thus,

( )( )

=

−+

=∇+Χ=Χ Χ∗

142.3

236.2

4909.00008.0142.3

4909.00001.0236.21

112 fλ

Since X1 = X2 (to four significant figures), we accept X* = [2.236, 3.142]T, with z* = – 10.00, as the solution to program (1). The solution to the original minimization program is then X* = [2.236, 3.142]T, with z* = + 10.00. Compare this with the results in Problem 2.

4. Use the Newton-Raphson method to

maximize: ( ) ( ) 105 22

2

1 +−+−= πxxzto within a tolerance of 0.05From Problem 3 we take the initial approximation X0 = [6.567, 5.891]T, with f(X0) = – 36.58. The gradient vector, Hessian matrix, and inverse Hessian matrix for this objective function are, respectively,

41-50

Page 42: 58323338 Numerical Methods

( )( )

−−−−=∇

π2

1

2

52

x

xf

−=Η

20

02f

−=Η−

5.00

05.01f

for all x1 and x2.

First iteration.

( )( )

−−

=

−−−−=∇ Χ 499.5

722.8

891.52

5597.620 π

f

00

1

01 Χ

Χ∇

Η−Χ=Χ ff

=

−−

−−

=

142.3

236.2

499.5

722.8

5.00

05.0

891.5

597.6

with f(X1) = – 10.00. Sincef(X1) – f(X0) = – 10.00 – (– 36.58) = 26.58 > 0.05

we continue iterating.

Second iteration.

( )( )

−=

−−−−=∇ Χ 0008.0

0001.0

142.32

5236.221 π

f

11

1

12 Χ

Χ∇

Η−Χ=Χ ff

=

−−

=

142.3

236.2

0008.0

0001.0

5.00

05.0

142.3

236.2

with f(X2) = – 10.00. Since f(X2) – f(X1) = 0 < 0.05, we take X* = X2 = [2.236, 3.142]T, with z* = f(X2) = – 10.00.

5. A major oil company wants to build a refinery that will be supplied from three port cities. Port B is located 300 km east and 400 km north of Port A, while Port C is 400 km east and 100 km south of Port B. Determine the location of the refinery so that the total amount of pipe required to connect the refinery to the ports is minimized.The objective is tantamount to minimizing the sum of the distances between the refinery and the three ports. As an aid to calculating this sum, we establish a coordinate system, with Port A as the origin. In this system, Port B has coordinates (300, 400) and Port C has coordinates (700, 300). With (x1, x2) designating the unknown coordinates of the refinery, the objective is

minimize: ( ) ( ) ( ) ( )22

21

22

21

22

21 300700400300 −+−+−+−++= xxxxxxz

Solve the problem to within 0.25 km by the Fletcher-Powell method.This problem is equivalent to a maximization program with objective function

( ) ( ) ( ) ( ) ( )22

21

22

21

22

21 300700400300 −+−−−+−−+−=Χ xxxxxxf (1)

and gradient vector

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

−+−

−−−+−

−−+

−+−

−−−+−

−−+

=∇

22

21

2

22

21

2

22

21

2

22

21

1

22

21

1

22

21

1

300700

300

400300

400300700

700

400300

300

xx

x

xx

x

xx

xxx

x

xx

x

xx

x

f (2)

To initialize the Fletcher-Powell method, we set ε = 0.25 and

=

10

01G

and choose [ ] ,200,400ˆ T=Χ which appears to be a good approximation to the optimal location of the refinery.

Step1:( ) ( )200,400ˆ ff =Χ=α

( ) ( ) ( ) ( ) ( ) ( ) 05.987100300200100200400 222222 −=−+−−−+−+−=

−=∇=Β Χ 76344.0

39296.0ˆf

Step2:

( )

+−

=

+

=Β+Χ

λλ

λλ76344.0200

39296.0400

76344.0

39296.0

10

01

200

400Gˆ fff

42-50

Page 43: 58323338 Numerical Methods

( ) ( )( ) ( )( ) ( )22

22

22

76344.010039296.0300

76344.020039296.0100

76344.020039296.0400

λλ

λλ

λλ

+−+−−−

+−+−−

++−−=

Making a three-point interval search of [0, 425], we determine λ* ≈ 212.5. Therefore,

( )

−=

=Β= ∗

23.162

504.83

79644.0

39296.0

10

015.212GD λ

Step3:

=

−+

=+Χ

23.362

50.316

23.162

504.83

200

400Dˆ

which we take as the updated [ ] .23.362,50.316ˆ :ˆ T=ΧΧStep4:

( ) ( ) 76.91023.362,50.316ˆ −==Χ= ffβ( ) 25.029.7605.98776.910 >=−−−=−αβ

Step6:

−=∇= Χ 0031594.0

071207.0C ˆf

−=

−−

−=−Β=Υ

76028.0

32175.0

0031594.0

0071207.0

73644.0

39296.0C

Step7:

[ ]

[ ]

[ ]

[ ]

−=

−−=

−=

ΥΥ−=Μ

=

−=ΥΥ

−=

−=

−==

=

−−=Υ

84811.035892.0

35892.015189.0

57803.024462.0

24462.010352.0

68155.0

1

10

0176028.0,32175.0

76028.0

32175.0

10

01

68155.0

1

GG68155.0

1

68155.076028.0

32175.0

10

0176028.0,32175.0G

21.175187.90

187.90421.46

2631913547

135479.6972

21.150

1

23.162,504.8323.162

504.83

21.150

1DD

21.150

1L

21.15076028.0

32175.023.162,504.83D

T

T

T

T

Step8:

−=

−+

−+

=Μ++

36.175828.89

828.89269.47

84811.035892.0

35892.015189.0

21.175187.90

187.90421.46

10

01LG

which we take as the updated G. We also update α = – 910.76 and

−=Β

0031594.0

071207.0

Step2:

( )

( ) ( )( ) ( )( ) ( )22

22

22

9504.623.626497.350.383

9504.677.376497.350.16

9504.623.3626497.350.316

9504.623.362

6497.350.316

0031594.0

071207.0

36.175828.89

828.89269.47

23.362

50.316Gˆ

λλ

λλ

λλ

λλ

λλ

++−−−

+−+−−

++−−=

+−

=

−+

=Β+Χ

f

ff

Making a three-point interval search of [0, 10], we determine λ* ≈ 1.25. Therefore,

43-50

Page 44: 58323338 Numerical Methods

( )

−=

−=Β= ∗

6880.8

5621.4

0031594.0

071207.0

36.175828.89

828.89269.4725.1GD λ

Step3:

=

−+

=+Χ

92.370

94.311

6880.8

5621.4

23.362

50.316Dˆ

which we take as the updated .ΧStep4:

( ) ( )( ) 25.018.076.9158.910

58.91092.370,94.311ˆ

<=−−−=−−==Χ=

αββ ff

Step5:

=Χ=Χ∗

92.370

91.311ˆ and ( ) 58.910−==Χ∗ βf

Thus the problem is solved by km. 58.910 with km, 92.370 km, 91.311 21 +=== ∗∗∗ zxx

Nonlinear Programming: Multivariable Optimization with ConstraintsStandard FormsWith X ≡ [x1, x2, …, xn]T, standard form for nonlinear programs containing only equality constraints is

maximize: z = f(X)s.t. g1(X) = 0

g2(X) = 0 (1)………..gm(X) = 0

with: m < n (fewer constraints than variables)As in previous chapter minimization programs are converted into maximization programs by multiplying the objective function by – 1.Standard form for nonlinear programs containing only inequality constraints is either

maximize: z = f(X)s.t. g1(X) ≤ 0

g2(X) ≤ 0 (2)………..gm(X) ≤ 0

ormaximize: z = f(X)

g1(X) ≥ 0g2(X) ≥ 0 (3)………..gm(X) ≥ 0

with: X ≥ 0The two forms are equivalent: (2) goes over into (3) (with m = p) under the substitution X = U – V, with U ≥ 0 and V ≥ 0; on the other hand, (3) is just (2) in the special case p = m + n and gm + i(X) = – xi (i = 1, 2, …, n). Form (3) is appropriate when the solution procedure requires nonnegative variables. In (1), (2), or (3), f is a nonlinear function, but some or all of the g’s may be linear.Nonlinear programs not in standard form are solved either by putting them in such form or by suitably modifying the solution procedure given below for programs in standard form.

Lagrange MultipliersTo solve program (1), first form the Lagrangian function

( ) ( ) ( )∑ Χ−Χ≡=

m

iiimn gfxxxL

12121 ,,,,,,, λλλλ (4)

where λi (i = 1, 2, …, m) are (unknown) constants called Lagrange multipliers. Then solve the system of n + m equations

( )

( )miL

njx

L

i

j

,,2,1 0

,,2,1 0

==∂∂

==∂∂

λ

(5)

Theorem 1: If a solution to program (1) exists, it is contained among the solutions to system (5), provided f(X) and gi(X) (i = 1, 2, …, m) all have continuous first partial derivatives and the m × n Jacobian matrix,

∂∂≡

j

i

x

gJ

has rank m at X = X*.

44-50

Page 45: 58323338 Numerical Methods

The method of Lagrange multipliers is equivalent to using the constraint equations to eliminate certain of the x-variables from the objective function and then solving an unconstrained maximization problem in the remaining x-variables.

Newton-Raphson Method

Since ( ) ( )Ζ≡ LxxxL mn λλλ ,,,,,,, 2121 is nonlinear, it is usually impossible to solve (5) analytically. However, since

the solutions to (5) are the stationary points of L(Z), and since (Theorem 3 of previous chapter) the maxima and minima of L(Z) occur among these stationary points, it should be possible to use the Newton-Raphson method (see previous chapter) to approximate the “right” extremum of L(Z); that is, the one that corresponds to the optimal solution of (1). The iterative formula applicable here is

kk

ffkk Ζ

Ζ+ ∇

Η−Ζ=Ζ1

1 (6)

This approach is of limited value because, as in previous chapter, it is very difficult to determine an adequate Z0. For an incorrect Z0, the Newton-Raphson method may diverge or may converge to the “wrong” extremum of L(Z). It is also possible for the method to converge when no optimal solution exists.

Penalty FunctionsAn alternative approach to solving program (1) involves the unconstrained program

maximize: ( ) ( )∑ Χ−Χ==

m

iii gpfz

1

2ˆ (7)

where pi > 0 are constants (still to be chosen) called penalty weights. The solution to program (7) in the solution to program (1) when each gi(X) = 0. For large values of the pi, the solution to (7) will have each gi(X) near zero to avoid adverse effects on the

objective function from the terms ( );2 Χii gp and as each ,∞→ip each ( ) .0→Χig

In practice, this process cannot be accomplished analytically except in rare cases. Instead, program (7) is solved repeatedly by the modified pattern search described in previous chapter, each time with either a new set of increased penalty weights or a decreased step size. Each pattern search with a specified set of penalty weights and a given step size is one phase of the solution procedure. The starting vector for a particular phase is the final vector from the phase immediately preceding it. Penalty weights for the first phase are chosen small, often 1/50 = 0.02; the first step size generally is taken as 1.Convergence of this procedure is affected by the rates at which the penalty weights are increased and the step size is decreased. Decisions governing these rates are more a matter of art than of science.

Kuhn-Tucker ConditionsTo solve program (3), first rewrite the nonnegativity conditions as – x1 ≤ 0, – x2 ≤ 0, …, – xn ≤ 0, so that the constraint set is m + n

inequality requirements each with a less than or equals sign. Next add slack variables ,,,, 22

22

21 mnnn xxx +++

respectively, to the left-hand sides of the constraints, thereby converting each inequality into an equality. Here the slack variables are added as squared terms to guarantee their nonegativity. Then form the Lagrangian function

( ) ( )[ ] [ ]∑ ∑ +−−+Χ−Χ≡=

+

+=++

m

i

nm

miiniiinii xxxgfL

1 1

22 λλ (8)

where nm+λλλ ,,, 21 are Lagrange multipliers. Finally solve the system

( )mnjx

L

j

+==∂∂

2 , 2, 1, 0 (9)

( )mniL

i

+==∂∂

2 , 2, 1, 0 λ (10)

( )mnji +=≥ 2 , 2, 1, 0 λ (11)

Equations (9) through (11) constitute the Kuhn-Tucker conditions for program (2) and (3).The first two sets, (9) and (10), follow directly from Lagrange multiplier theory; set (11) is known as the constraint qualification. Among the solutions to the Kuhn-Tucker conditions will be the solution to program (3) if f(X) and each gi(X) have continuous first partial derivatives.

Method of Feasible DirectionsThis is a five-step algorithm for solving program (2). The method is applicable only when the feasible region has an interior, and then it will converge to the global maximum only if the initial approximation is “near” the solution. The feasible region will have no interior if two of the inequality constraints have arisen from the conversion of an equality constraint.

Step1: Determine an initial, feasible approximation to the solution, designating it B.Step2: Solve the following linear program for the d1, d2, …, dn + 1:

maximize: z = dn + 1

s.t.

45-50

Page 46: 58323338 Numerical Methods

( )

( )

( )Β−≤+∂∂

++∂∂

+∂∂

Β−≤+∂∂++

∂∂+

∂∂

Β−≤+∂∂++

∂∂+

∂∂

≤+∂∂−−

∂∂−

∂∂−

+ΒΒΒ

+ΒΒΒ

+ΒΒΒ

+ΒΒΒ

pnpnn

ppp

nnn

nnn

nn

gdkdx

gd

x

gd

x

g

gdkdx

gd

x

gd

x

g

gdkdx

gd

x

gd

x

g

dx

fd

x

fd

x

f

122

11

2122

22

21

1

2

1111

22

11

1

1

122

11

0

(12)

with: dj ≤ 1 (j = 1, 2, …, n + 1)Here ki (i = 1, 2, …, p) is 0 if gi(X) is linear and 1 if gi(X) is nonlinear.

Step3: If dn + 1 = 0, then X* = B; if not, go to Step 4.Step4: Set D = [d1, d2, …, dn]T. Determine a nonnegative value for λ that maximizes f(B + λD) while keeping B + λD feasible;

designate this value as λ*.Step5: Set B = B + λ*D and return to Step2.

Solved Problems1. maximize: z = 2x1 +x1 x2 + 3x3

s.t. x12 + x2 = 3

It is apparent that for any large negative x1 there is a large negative x2 such that the constraint equation is satisfied. But thenz ≈ x1x2 → ∞. There is no global maximum.

2. minimize: z = x1 + x2 + x3

s.t. x12 + x2 = 3

x1 + 3x2 + 2x3 = 7The given program is equivalent to the unconstrained minimization of

z = ½ (x12 + x1 + 4)

which obviously has a solution. We may therefore apply the method of Lagrange multipliers to the original program standardized as

maximize z = – x1 – x2 – x3

s.t. x12 + x2 – 3 = 0 (1)

x1 + 3x2 + 2x3 – 7 = 0Here, f(x1, x2, x3) = – x1 – x2 – x3, n = 3 (variables), m = 2 (constraints),

g1(x1, x2, x3) = x12 + x2 – 3 g2(x1, x2, x3) = x1 + 3x2 + 2x3 – 7

The Lagrangian function is thenL = (– x1 – x2 – x3) – λ1(x1

2 + x2 – 3) – λ2(x1 + 3x2 + 2x3 – 7)and system (5) becomes

( )

( )

( )

( ) ( )

( ) ( )6 0723

5 03

4 021

3 031

2 021

3212

221

1

23

212

2111

=−++−=∂∂

=−+−=∂∂

=−−=∂∂

=−−−=∂∂

=−−−=∂∂

xxxL

xxLx

Lx

L

xx

L

λ

λ

λ

λλ

λλ

Successively solving (4) for λ2, (3) for λ1, (2) for x1, (5) for x2, and (6) for x3, we obtain the unique solution λ2 = – 0.5, λ1 = 0.5, x1 = – 0.5, x2 = 2.75, and x3 = – 0.375, with

z = – x1 – x2 – x3 = – (– 0.5) – 2.75 – (– 0.375) = – 1.875Since the first partial derivatives of f(x1, x2, x3), g1(x1, x2, x3), and g2(x1, x2, x3) are all continuous, and since

=

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

=231

012J 1

3

2

2

2

1

2

3

1

2

1

1

1

x

x

g

x

g

x

gx

g

x

g

x

g

is of rank 2 everywhere (the last two columns are linearly independent everywhere), either x1 = – 0.5, x2 = 2.75, x3 = – 0.375 is the optimal solution to program (1) or no optimal solution exists. Checking feasible points in the region around (– 0.5, 2.75, – 0.375),

46-50

Page 47: 58323338 Numerical Methods

we find that this point is indeed the location of a (global) maximum for program (1). Therefore, it is also the location of a global minimum for the original program, with z* = – (– 1.875) = 1.875.

3. Disregarding Problem 1 use the Newton-Raphson method tomaximize: z = 2x1 +x1 x2 + 3x2

s.t. x12 + x2 = 3

Here, L = (2x1 + x1x2 + 3x2) – λ1(x12 + x2 – 3). Therefore,

+−−−+

−+=∇

3

3

22

221

11

112

xx

x

xx

L λλ

−−−

−−=Η

012

101

212

1

11

x

x

L

λ

Arbitrarily taking Z0 = [1, 1, 1]T, we calculate:First iteration

=∇

1

3

1

0ZL

−−−−−

=Η012

101

212

0ZL ( )

−−−−−−−

=Η −

141

442

121

6

11

0ZL

and ( ) [ ]TL L 310,310,3100

101 =∇Η=Ζ=Ζ Ζ

−Ζ

Second iteration

−=∇

94

0

928

1ZL

−−−−−

=Η032

303

2320

3

11ZL ( )

−−−−−−−

=Η −

9669

6646

969

72

11

1ZL

and ( ) [ ]TL L 311,38,3211

112 =∇Η=Ζ=Ζ Ζ

−Ζ

Continuing for two more iterations, we obtainZ3 = [0.6333, 2.6, 3.633]T

Z4 = [0.6330, 2.599, 3.633]T

As the components of Z have stabilized to three significant figures, we take x1* = 0.633, x2

* = 2.60, and λ1* = 3.63 with

z* = 2x1* + x1

* x2* + 3 x2

* = 10.7By expressing z as a (cubic) function of x1 alone, we can easily see that in this particular case the Newton-Raphson method has converged on a local maximum.

4. Use the penalty function approach to maximize: z = – 4 – 3(1 – x1) 2 – (1 – x2)2 s.t. 3x1 + x2 = 5

Penalty function for this problem becomes

maximize: ( ) ( ) ( ) 2211

22

21 531134ˆ −+−−−−−−= xxpxxz

This unconstrained maximization program in the two variables x1 and x2 is sufficiently simple that it may be solved analytically. Setting ,0ˆ =∇z we obtain

( )( ) 12111

12111

5113

5131

pxpxp

pxpxp

+=+++=++

Solving these equations for x1 and x2 in terms of p1, we obtain

( )( ) 41

51

41

51

1

1

1

121 +

+=++==

p

p

p

pxx

Since the Hessian matrix

−−−

−−−=Η

11

11ˆ 226

6186

pp

ppz

is negative definite for every positive value of p1, z is a strictly concave function, and its sole stationary point must be a global maximum. Therefore, letting p1 → +∞ we obtain the optimal solution to the original program:

∗=→ 11 4

5xx ∗=→ 22 4

5xx

with ( ) ( ) 25.411342

22

1 −=−−−−−= ∗∗∗ xxz

5. Use the penalty function approach to minimize: z = (x1 – x2)2 + (x3 – 1)2 +1s.t. x1

5 + x25 + x3

5 = 16Putting this program in standard form, we have

47-50

Page 48: 58323338 Numerical Methods

maximize: z = – (x1 – x2)2 – (x3 – 1)2 – 1 (1)s.t. x1

5 + x25 + x3

5 – 16 = 0For program (1), penalty function becomes

maximize: ( ) ( ) ( )253

52

511

23

221 1611ˆ −++−−−−−−= xxxpxxxz (2)

Phase 1. We set p1 = 0.02 in (2) and consider the program

maximize: ( ) ( ) ( )253

52

51

23

221 1602.011ˆ −++−−−−−−= xxxxxxz (3)

Arbitrarily selecting [0, 0, 0]T as our initial vector, and setting h = 1, we apply the modified pattern search to program (3). The result after 78 functional evaluations is [1, 1, 1]T, with

f(1, 1, 1) = – 1 and g1(1, 1, 1) = – 13Phase 2. Since g1(1, 1, 1) = – 13 ≠ 0, the constraint in program (1) is not satisfied. To improve this situation, we increase p1 in (2) to 0.2 and consider the program

maximize: ( ) ( ) ( )253

52

51

23

221 162.011ˆ −++−−−−−−= xxxxxxz (4)

Taking [1, 1, 1]T from Phase1 as the initial approximation, we apply the modified pattern search to (4), still keeping h = 1. The result remains [1, 1, 1]T, indicating that the constraint cannot be satisfied in integers.Phase 3. Since increasing p1 did not improve the current solution, we return to program (3), reduce h to 0.1, and make a new pattern search, again with [1, 1, 1]T as initial approximation. The result is [1.5, 1.5, 1]T with

f(1.5, 1.5, 1) = – 1 and g1(1.5, 1.5, 1) = 0.1875Continuing in this manner, we complete the table below. Using the results of Phase 9, we conclude that x1

* = 1.496, x2* = 1.496,

x3* = 1.003, with z* = +1.000, approximates the optimal solution to the original minimization program.

Phase p1 h Final Vecgtor X f(X) g1(X)x1 x2 x3

1 0.02 1 1 1 1 – 1 – 132 0.2 1 1 1 1 – 1 – 133 0.02 0.1 1.5 1.5 1 – 1 0.18754 0.2 0.1 1.5 1.5 1 – 1 0.18755 0.02 0.01 1.49 1.5 1 – 1.000 – 0.06236 0.2 0.01 1.49 1.5 1.01 – 1.000 – 0.01137 0.2 0.001 1.196 1.496 1.002 – 1.000 – 0.00398 2 0.001 1.496 1.496 1.003 – 1.000 0.00129 20 0.001 1.496 1.496 1.003 – 1.000 0.0012

6. Solve the following program by use of the Kuhn-Tucker conditions:

minimize: 32132312123

22

21 51021264105 xxxxxxxxxxxxz ++−−+−++=

s.t. x1 + 2x2 + x3 ≥ 4with: all variables nonnegative

First transforming into the standard form and then introducing squared slack variables, we obtain

maximize: 32132312123

22

21 51021264105 xxxxxxxxxxxxz −−++−+−−−=

s.t. – x1 – 2x2 – x3 + 4 + x42 = 0

– x1 + x52 = 0

– x2 + x62 = 0

– x3 + x72 = 0

For this program, the Lagrangian function is

( ) ( ) ( ) ( )2734

2623

2512

243211

32132312123

22

21

42

51021264105

xxxxxxxxxx

xxxxxxxxxxxxL

+−−+−−+−−++−−−−

−−++−+−−−=

λλλλTaking the derivatives indicated in (9) and (10), we have

48-50

Page 49: 58323338 Numerical Methods

(11) 0

(10) 0

(9) 0

(8) 042

(7) 02

(6) 02

(5) 02

(4) 02

(3) 0512620

(2) 021012410

(1) 02642

273

4

262

3

251

2

24321

1

747

636

525

414

412133

313122

213211

=−=∂∂

=−=∂∂

=−=∂∂

=−−++=∂∂

=−=∂∂

=−=∂∂

=−=∂∂

=−=∂∂

=++−+−−=∂∂

=++−++−=∂∂

=+++−+−=∂∂

xxL

xxL

xxL

xxxxL

xx

L

xx

L

xx

L

xx

L

xxxx

L

xxxx

L

xxxx

L

λ

λ

λ

λ

λ

λ

λ

λ

λλ

λλ

λλ

These equations can be simplified. Set s1 = x4

2 (12)Equations (4) through (7) imply respectively that either λ1 or x4, either λ2 or x5, either λ3 or x6, either λ4 or x7, equals zero. But, by (9) through (12), x4, x5, x6, and x7 are zero if and only if s1, x1, x2, and x4 are respectively zero. Thus, (4) through (7) and (9) through (12) are equivalent to the system

0

0

0

0

34

23

12

11

====

x

x

x

s

λλλλ

(13)

There are 16 solutions to this system. Results are listed in the table below

λ1 λ2 λ3 λ4 x1 x2 x3 s1

1 0 0 0 0 11.5 -3 -5.5 -42 0 0 0 11 -5 -3 0 -153 0 0 6 0 17.5 0 -5.5 -44 0 0 6 11 1 0 0 -35 0 -1.643 0 0 0 -4.643 -3.036 -16.326 0 2 0 17 0 -1 0 -27 0 -3.5 13 0 0 0 -0.25 -4.258 0 -2 10 5 0 0 0 -4

90.3809 0 0 0

14.36 -2.238 -5.881 0

10 1.764 0 0

14.53

2.941

0.5294 0 0

11 -3.2 0 18.8 0 6.3 0 -2.3 012 6 0 -8 11 4 0 0 013 6.623 -8.738 0 0 0 1.507

0.9855 0

14 15 -25 0 -34 0 2 0 015 85 -63 -208 0 0 0 4 0

49-50

Page 50: 58323338 Numerical Methods

16 … … … … 0 0 0 0

The only row in this table having nonnegative entries for all variables, as required by the Kuhn-Tucker conditions, is row 10 with z* = 3.235.

50-50