LINDO: Linear, Quadratic, and Integer Programming Software


LINDO 5.3 (Linear, Interactive, Discrete Optimizer) is an interactive linear, quadratic, and integer programming system useful to a wide range of users. LINDO can be used

  • to solve interactive linear, quadratic, general integer and zero-one integer programming programs up to 500 rows and 1,000 columns

  • to perform sensitivity analysis and parametric programming.

This document provides specific information on how to run LINDO on the central UNIX systems Strauss and Mahler. It also contains an example of an interactive session.

The LINDO User's Manual contains complete descriptions of all LINDO commands and many examples. The User Services Reference Library (in the RDMS Lab, 002C Smith Hall) has a non-circulating copy of the LINDO User's Manual.


How to Run LINDO

To start an interactive session, type

lindo
When the program is ready for you to type a LINDO command, it displays its prompt character ":". Commands may be typed in upper or lower case. The only exception is when you type a file name since UNIX filenames are case-sensitive.

To obtain interactive help, type

help
To terminate LINDO, type

quit
LINDO displays all of its output without stopping. If you want LINDO to pause after every 24 lines of output, type

page 24

Accessing UNIX Disk Files

Many LINDO commands, such as take, save, retr, dvrt, and rvrt, read from or write information to UNIX disk files. The general form of these commands is

LINDO-command-name    filename
When you omit the filename, LINDO prompts you with the message

FILE NAME=
The filename you type must match the name of the file exactly. Case is important, therefore you may not refer to a file named transport.model as TRANSPORT.MODEL. The filename cannot use name-expansion such as ~smith/LPmodels/prob1, since "~smith" will be rejected. However, if user "smith" were in his home directory, he could refer to that file as LPmodels/prob1.


Typical commands:

take xmplfile
reads a file named "xmplfile" in the current directory which contains LINDO commands or a model formulation. The "take" command is typically used to input files created by an editor like vi or pico. Long lines in this file that must continue on subsequent lines can be broken at at any place and immediately continued on the next line. For example,

max 2a + 3.5b + 4.1c  - 2.6d  + 3.3e - 6.2f + 8.3g + 4.6h -
   7.7j + 5.6k
st
a + b + c + d + e + f + g + h + j + k < 1
etc.
Lines in this file may not exceed 71 characters.

save model2
saves the current model formulation in the UNIX file named model2 in the current directory.

retr model2
retrieves the previously saved model stored in the UNIX file model2 in the current directory.

dvrt output3
diverts LINDO's subsequent output from the terminal screen to the UNIX file named output3. This is useful for saving the results for later printing using the qpr command. For this example, you would later type the UNIX command
qpr -q smips output3
to print the output in Smith Hall.

rvrt
("revert") causes the subsequent output to be directed to the screen again.


Sample Interactive Sessions

The following three examples illustrate how to

  • state and solve a linear programming problem, and save the formulation in a disk file;

  • recover the formulation in a later session, modify the model, and find the optimal solution; and

  • state and solve a zero-one integer programming problem.

LINDO's responses are displayed in upper-case text; the user commands and responses are in lower-case.


Example 1: Solve an LP problem.

% lindo
	 LINDO 5.3 (June 1993)
      LINDO Systems, Chicago, IL

	University of Delaware 
	 Single Site License   
	Licence LDW12 - 531000    
: max 2x + 3y
?st
?    4x + 3y < 10
?    3x + 5y < 12
?end


: go
LP OPTIMUM FOUND AT STEP      2

   OBJECTIVE FUNCTION VALUE

   1)      7.454545    

VARIABLE        VALUE          REDUCED COST
    X         1.272727          0.000000
    Y         1.636364          0.000000


  ROW   SLACK OR SURPLUS     DUAL PRICES
   2)         0.000000          0.090909
   3)         0.000000          0.545455

NO. ITERATIONS=       2

DO RANGE(SENSITIVITY) ANALYSIS?
?yes

RANGES IN WHICH THE BASIS IS UNCHANGED:

		      OBJ COEFFICIENT RANGES
VARIABLE         CURRENT        ALLOWABLE        ALLOWABLE
	      COEF          INCREASE         DECREASE
   X        2.000000         2.000000         0.200000
   Y        3.000000         0.333333         1.500000

		      RIGHTHAND SIDE RANGES
 ROW         CURRENT        ALLOWABLE        ALLOWABLE
	       RHS          INCREASE         DECREASE
   2       10.000000         6.000000         2.800000
   3       12.000000         4.666667         4.500000

: save linearprob  <--- Save the formulation in "linearprob"
: quit

Example 2: Retrieve the previous formulation, modify it, and resolve the problem.


% lindo
	 LINDO 5.3 (June 1993)
      LINDO Systems, Chicago, IL

	University of Delaware 
	 Single Site License   
	Licence LDW12 - 531000    
: retr linearprob  <-----Retrieve the earlier problem statement 
: look
ROW:
all                 <-----Look at the entire problem ("all" rows)

MAX     2 X + 3 Y
SUBJECT TO
    2)   4 X + 3 Y <=   10
    3)   3 X + 5 Y <=   12
END

: alter             <-----Modify the current formulation
ROW:
2
VAR:
rhs                  <-----by changing the first constraint's RHS
NEW COEFFICIENT:
?20
: alter
ROW:
3
VAR:
y                      <----and the second constraint's y-coeff.
NEW COEFFICIENT:
?10
: look all

MAX     2 X + 3 Y
SUBJECT TO
    2)   4 X + 3 Y <=   20
    3)   3 X + 10 Y <=   12
END

: go
LP OPTIMUM FOUND AT STEP      1

   OBJECTIVE FUNCTION VALUE

   1)      8.000000    

VARIABLE        VALUE          REDUCED COST
    X         4.000000          0.000000
    Y         0.000000          3.666667


  ROW   SLACK OR SURPLUS     DUAL PRICES
   2)         4.000000          0.000000
   3)         0.000000          0.666667

NO. ITERATIONS=       1

DO RANGE(SENSITIVITY) ANALYSIS?
?no
: quit

Example 3: State and solve an integer programming problem where each of the three variables may only have the values 0 or 1.


% lindo
	 LINDO 5.3 (June 1993)
      LINDO Systems, Chicago, IL

	University of Delaware 
	 Single Site License   
	Licence LDW12 - 531000    
: max 4x + 3y + 2z
?st
?2.5x + 3.1y       < 5
? .2x +  .7y + .4z < 1
?end

: integer x           <--- Define x, y, z to be 0/1 variables
: integer y
: integer z
: go
LP OPTIMUM FOUND AT STEP      3
OBJECTIVE VALUE =   7.71428585    
FIX ALL VARS.(    1)  WITH RC >   3.00000    

NEW INTEGER SOLUTION OF    6.00000000     AT BRANCH      0 PIVOT 
10
BOUND ON OPTIMUM:  6.000000    
ENUMERATION COMPLETE. BRANCHES=     0 PIVOTS=      10

LAST INTEGER SOLUTION IS THE BEST FOUND
RE-INSTALLING BEST SOLUTION...
					 
: solu                 <--- Inspect the final solution 

   OBJECTIVE FUNCTION VALUE

   1)      6.000000    

VARIABLE        VALUE          REDUCED COST
    X         1.000000         -4.000000
    Y         0.000000         -3.000000
    Z         1.000000         -2.000000


  ROW   SLACK OR SURPLUS     DUAL PRICES
   2)         2.500000          0.000000
   3)         0.400000          0.000000

NO. ITERATIONS=      10
BRANCHES=    0 DETERM.=  1.000E    0
: quit
%


Last modified: February 3, 2002
This page maintained by Richard Sacher.
Copyright (c) University of Delaware, 2002