PICTURE Command

The PICTURE command displays the model in matrix form. For small to medium sized models, the PICTURE command is a useful way to obtain a visual impression of the model and to hunt for formulation errors.

The following letter codes are used to represent the linear coefficients in the PICTURE output:

Letter Code

Coefficient Range

Z

 ( .000000, .000001 ]

Y

 ( .000001, .00001 ]

X

 ( .00001, .0001 ]

W

 ( .0001, .001 ]

V

 ( .001, .01 ]

U

 ( .01, .1 ]

T

 ( .1, 1 )

A

 ( 1, 10 ]

B

 ( 10, 100 ]

C

 ( 100, 1000 ]

D

 ( 1000, 10000 ]

E

 ( 10000, 100000 ]

F

 ( 100000, 1000000 ]

G

 > 1000000

Single digit integers are shown explicitly rather than being displayed as a code. This is especially handy, because many models have a large number of coefficients of positive or negative 1, which can affect the solution procedure. If a variable appears nonlinearly in a row, then the PICTURE command will represent its coefficient with a question mark.

In this next example, we read in a copy of the small transportation model supplied with LINGO and use the PICTURE command to view the logical structure of the model.

: take \lingo\samples\tran.lg4

: pic

 

          V V V V V V V V V V V V

          O O O O O O O O O O O O

          L L L L L L L L L L L L

          U U U U U U U U U U U U

          M M M M M M M M M M M M

          E E E E E E E E E E E E

          ( ( ( ( ( ( ( ( ( ( ( (

          W W W W W W W W W W W W

          H H H H H H H H H H H H

          1 1 1 1 2 2 2 2 3 3 3 3

          , , , , , , , , , , , ,

          C C C C C C C C C C C C

          1 2 3 4 1 2 3 4 1 2 3 4

          ) ) ) ) ) ) ) ) ) ) ) )

 

     OBJ: 6 2 6 7 4 9 5 3 8 8 1 5  MIN

 DEM(C1): 1     ' 1   '   1 '      > B

 DEM(C2): ' 1'  '  '1 '  '  1  '   > B

 DEM(C3): '   1 '     1     ' 1    > B

 DEM(C4): '     1     ' 1   '   1  > B

SUP(WH1): 1 1'1 1  '  '  '  '  '   < B

SUP(WH2): '     ' 1 1 1 1   '      < B

SUP(WH3): '     '     '   1 1 1 1  < B

In this model all the right-hand side values are in the range [12,30]. Thus, they are all represented using the letter B. Row names are displayed running down the left-hand side of the matrix, while variable names are displayed along the top. The sense of the objective row and each of the constraints are shown. Spaces stand in for zero coefficients, and single quote marks are inserted to give a grid-like background.

Note:The PICTURE command is best used on small models. The amount of output generated for large models can be cumbersome. For larger models, the Solver|Picture command in Windows versions of LINGO can compress the matrix picture of large models into a single screen for easier viewing.