LINDO Interactive Execution
In this section, LINDO's annotative example of interactive execution is addressed. Annotation is given after ! sign. This example will address fundamentals of sensitivity analysis and parametric programming.
! There are three commands, ALTER, RANGE, and PARARHS for studying the
! effect of various parameters on the optimal solution.
!
! The ALTER command allows one to alter any coefficient of the problem,
! including ones which are currently zero. A subsequent optimization tries
! to use the last solution as a starting point for solving the altered
! problem. ALTER can be used to change a rhs or the direction of a row.
!
! The RANGE command causes a standard range report to be printed. This
! report specifies the allowable changes for objective function and
! right-hand-side coefficients which will not cause a change in basis.
: max x + y + z
?subject to
?2) 4 x + y <= 5
?3) 5 y - z >= 4
?4) x + 6 z = 7
?end
: ! Alter a constraint coefficient:
: alter
ROW:
4
VAR:
y
VARIABLE NOT IN THIS ROW. WANT IT INCLUDED?
?y
NEW COEFFICIENT:
?3
: ! Alter the direction of an inequality:
: alter 3 dir
NEW DIRECTION:
?<
: ! Alter the name of a row:
: alter 2 name
NEW NAME=
two
: ! The following is the net result of all the above alterations
: look all
MAX X + Y + Z
SUBJECT TO
TWO) 4 X + Y <= 5
3) 5 Y - Z <= 4
4) X + 3 Y + 6 Z = 7
END
: ! This is the end of ALTER section.
! The PARARHS command allows the user to automatically trace out the effect
! of varying a right-hand-side over a wide range. Its use is illustrated
! with the following example session.
: help para
PARA COMMAND:
TYPE "PARA row-id new-rhs" TO DO PARAMETRIC RHS ANALYSIS ON
ROW "row-id". "PARA" VARIES THE RHS OF THIS ROW FROM ITS
CURRENT VALUE TO THE NEW VALUE "new-rhs", DISPLAYING THE
OPTIMAL OBJECTIVE VALUE AT EACH BASIS CHANGE ALONG THE WAY.
THE PROBLEM MUST BE OPTIMIZED BEFORE CALLING PARA.
: help range
RANGE COMMAND:
PRINTS RANGE REPORT ON THE RHS AND OBJ COEFFICIENTS.
: ! Let us try an example problem for PARA
: max 20 astro + 30 cosmo
?subject to
?2) astro <= 60
?3) cosmo <= 70
?4) astro + 2 cosmo <= 210
?end
: terse
: go
LP OPTIMUM FOUND AT STEP 2
OBJECTIVE VALUE = 3300.00000
: solution
OBJECTIVE FUNCTION VALUE
1) 3300.0000
VARIABLE VALUE REDUCED COST
ASTRO 60.000000 0.000000
COSMO 70.000000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 0.000000 20.000000
3) 0.000000 30.000000
4) 10.000000 0.000000
NO. ITERATIONS= 2
: ! Now illustrate the RANGE commnad
: range
RANGES IN WHICH THE BASIS IS UNCHANGED:
OBJ COEFFICIENT RANGES
VARIABLE CURRENT ALLOWABLE ALLOWABLE
COEF INCREASE DECREASE
ASTRO 20.000000 INFINITY 20.000000
COSMO 30.000000 INFINITY 30.000000
RIGHTHAND SIDE RANGES
ROW CURRENT ALLOWABLE ALLOWABLE
RHS INCREASE DECREASE
2 60.000000 10.000000 60.000000
3 70.000000 5.000000 70.000000
4 210.000000 INFINITY 10.000000
: ! Now illustrate the PARA command on row 4:
: para
ROW:
4
NEW RHS VAL=
-1.
VAR VAR PIVOT RHS DUAL PRICE OBJ
OUT IN ROW VAL BEFORE PIVOT VAL
210.000 0.000000E+00 3300.00
SLK 4 SLK 3 4 200.000 0.000000E+00 3300.00
COSMO SLK 2 3 60.0000 15.0000 1200.00
ASTRO ART 2 0.000000E+00 20.0000 0.000000E+00
-1.00000 +INFINITY INFEASIBLE



