## `linopt::plot_data` -- plot the feasible region of a linear program

#### Introduction

`linopt::plot_data(`[constr, obj], vars`)` returns a graphical description of the feasible region of the linear program [constr, obj], and the line vertical to the objective function vector through the corner with the maximal objective function value found.

#### Call(s)

`linopt::plot_data([constr, obj], vars)`
`linopt::plot_data([constr, obj <, NonNegative> <, seti>], vars)`
`linopt::plot_data([constr, obj <, NonNegative> <, All>], vars)`
`linopt::plot_data([constr, obj <, setn> <, seti>], vars)`
`linopt::plot_data([constr, obj <, setn> <, All>], vars)`

#### Parameters

`constr` | - | a set or list of linear constraints
`obj` | - | a linear expression
`seti` | - | a set which contains identifiers interpreted as indeterminates
`setn` | - | a set which contains identifiers interpreted as indeterminates
`vars` | - | a list containing the two variables of the linear program described by `constr` and `obj` and the existing options

#### Options

`All` | - | all variables are constrained to be integer
`NonNegative` | - | all variables are constrained to be nonnegative

#### Returns

an expression describing a graphical object which can be used by `plot2d`.

#### Related Functions

`linopt::maximize`, `linopt::minimize`, `linopt::corners`

#### Details

- [`constr`, `obj`] is a linear program with exactly two variables. The problem has the same structure like in `linopt::maximize`. The second parameter `vars` specifies which variable belongs to the horizontal and vertical axis.

#### Example 1

We plot the feasible region of the given linear program. Here the valid corners of the linear program are easy to see:

    >> k := [[2*x + 2*y >= 4, -2*x + 4*y >= -2, -2*x + y >= -8,
              -2*x + y <= -2, y <= 6], x + y, NonNegative]:
       g := linopt::plot_data(k, [x, y]):
       plot2d(g):

In this example there is no difference if the Option NonNegative is given for the linear program or not:

    >> k := [[2*x + 2*y >= 4, -2*x + 4*y >= -2, -2*x + y >= -8,
              -2*x + y <= -2, y <= 6], x + y]:
       g := linopt::plot_data(k, [x, y]):
       plot2d(g):

    >> delete k, g:

#### Example 2

Now we give an example where one can see a difference if the variables are constrained to be nonnegative:

    >> k := [[x + y >= -1, x + y <= 3], x + 2*y]:
       g := linopt::plot_data(k, [x, y]):
       plot2d(g):

    >> k := [[x + y >= -1, x + y <= 3], x + 2*y, NonNegative]:
       g := linopt::plot_data(k, [x, y]):
       plot2d(g):

    >> delete k, g:

#### Background

- References:

  Papadimitriou, Christos H; Steiglitz, Kenneth: Combinatorial Optimization; Algorithms and Complexity. Prentice-Hall, 1982.

  Nemhauser, George L; Wolsey, Laurence A: Integer and Combinatorial Optimization. New York, Wiley, 1988.

  Salkin, Harvey M; Mathur, Kamlesh: Foundations of Integer Programming. North-Holland, 1989.

  Neumann, Klaus; Morlock, Martin: Operations-Research. Munich, Hanser, 1993.

  Duerr, Walter; Kleibohm, Klaus: Operations Research; Lineare Modelle und ihre Anwendungen. Munich, Hanser, 1992.

  Suhl, Uwe H: MOPS - Mathematical OPtimization System. European Journal of Operational Research 72(1994)312-322. North-Holland, 1994.

  Suhl, Uwe H; Szymanski, Ralf: Supernode Processing of Mixed Integer Models. Boston, Kluwer Academic Publishers, 1994.

#### Changes

- new function
- The linopt library was completely rewritten in MuPAD version 2.0.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000