RANGE Command

Use the RANGE command to generate a range report for the model in the active window. A range report shows over what ranges you can, 1) change a coefficient in the objective without causing any of the optimal values of the decision variables to change, or, 2) change a row's constant term (also referred to as the right-hand side coefficient) without causing any of the optimal values of the dual prices or reduced costs to change.

Note:The solver computes range values when you solve a model. Range computations must be enabled in order for the solver to compute range values.  Range computations are not enabled by default, so you will need to switch them on with the command: SET DUALCO 2. Range computations can take some time. If speed is a concern, you don’t want to enable range computations unnecessarily.

The example model below, when solved, yields the range report that follows.

[OBJECTIVE] MAX = 20 * A + 30 * C;

[ALIM]      A <= 60;

[CLIM]      C <= 50;

[JOINT]     A + 2 * C  <= 120;

Here is the range report:

Ranges in which the basis is unchanged:

 

               Objective Coefficient Ranges

             Current    Allowable    Allowable

Variable  Coefficient     Increase     Decrease

      A     20.00000     INFINITY     5.000000

      C     30.00000     10.00000     30.00000

 

                  Righthand Side Ranges

    Row      Current    Allowable    Allowable

                 RHS     Increase     Decrease

   ALIM     60.00000     60.00000     40.00000

   CLIM     50.00000     INFINITY     20.00000

  JOINT     120.0000     40.00000     60.00000

The first section of the report is titled Objective Coefficient Ranges. In the first column, Variable, all the optimizable variables are listed by name. The next column, Current Coefficient, lists the current coefficient of the variable in the objective row. The third column, Allowable Increase, tells us the amount that we could increase the objective coefficient without changing the optimal values for the variables. The final column, Allowable Decrease, lists the amount that the objective coefficient of the variable could decrease before the optimal values of the variables would change. Information on the allowable increases and decreases on objective coefficients can be useful when you need answers to questions like, "How much more (less) profitable must this activity be before we should be willing to do more (less) of it?".

Referring to the Objective Coefficient Ranges report for our example, we can say, as long as the objective coefficient of A is greater-than-or-equal-to 15, the optimal values of the variables will not change. The same may be said for the objective coefficient of variable C, as long as it falls within the range of [0,40].

Note:Ranges are valid only if you are planning to alter a single objective or right-hand side coefficient. The range information provided by LINGO cannot be applied in situations where one is simultaneously varying two or more coefficients. Furthermore, ranges are only lower bounds on the amount of change required in a coefficient to actually force a change in the optimal solution. You can change a coefficient by any amount up to the amount that is indicated in the range report without causing a change in the optimal solution. Whether the optimal solution will actually change if you exceed the allowable limit is not certain.

The second section of the range report is titled Right-hand Side Ranges. The first column, Row, lists the names of all the optimizable rows, or constraints, in the model. The second column, Current RHS, gives the constant term, or right-hand side value, for the row. The next two columns, Allowable Increase and Allowable Decrease, tell us how far we can either increase or decrease the right-hand side coefficient of the row without causing a change in the optimal values of the dual prices or reduced costs. If you recall, the dual prices on rows are, effectively, shadow prices, which tell us at which price we should be willing to buy (or sell) our resources for. The dual prices do not, however, tell us what quantity we should be willing to buy (or sell) at the dual price. This information is obtained from the allowable increases and decreases on the right-hand side coefficients for the row. So, for our example, the dual prices and reduced costs will remain constant as long as the right-hand side of row ALIM falls within the range [20,120], the right-hand side of CLIM is greater-than-or-equal-to 30, and the right-hand side of JOINT is in [60,160].

Note: We preceded all the rows in our model with a name enclosed in square brackets. This is an important practice if you wish to generate range reports. If you do not name your rows, LINGO assigns them a name that corresponds to the internal index of the row. This internal index will not always correspond to the order of the row in the text of the original model. To make the Right-hand Side Ranges section of range reports meaningful, be sure to name all your rows. For details on assigning names to rows, refer to the section Constraint Names.
Note: If a variable is nonlinear in the objective, its value in the Current Coefficient column will be displayed as NONLINEAR. Similarly, if a row is nonlinear, the value in the Current RHS column will be displayed as NONLINEAR.

Coefficients that can be increased or decreased indefinitely will display a range of INFINITY.

Fixed variables are substituted out of a model and will not appear in a range report. Rows that contain only fixed variables are also substituted out of models and will also not appear in range reports. As an example, suppose we changed the following inequality in our sample model from:

[ALIM]      A <= 60;

to the equality:

[ALIM]      A = 60;

LINGO can now solve directly for the value of A. The variable A is considered fixed; as is the row ALIM (since it contains no optimizable variables). Given this, the variable A will no longer appear in the Objective Coefficient Ranges section of the range report, and the row ALIM will not appear in the Right-hand Side Ranges section. We can verify this by examining the updated range report:

Ranges in which the basis is unchanged:

 

               Objective Coefficient Ranges

             Current    Allowable    Allowable

Variable  Coefficient     Increase     Decrease

      C     30.00000     INFINITY     30.00000

 

                  Righthand Side Ranges

    Row      Current    Allowable    Allowable

                 RHS     Increase     Decrease

   CLIM     50.00000     INFINITY     20.00000

  JOINT     60.00000     40.00000     60.00000

As a final note, if the range report is scrolling off the screen, you can use the PAGE n command to set the page length to n lines, so LINGO will pause every time n lines are printed and wait until you are ready to proceed with the next page. In addition, if you would like to capture the solution report in a file, use the DIVERT command before the SOLU command.