linopt::plot_data
-- plot the
feasible region of a linear programlinopt::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.
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)
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 |
All |
- | all variables are constrained to be integer |
NonNegative |
- | all variables are constrained to be nonnegative |
an expression describing a graphical object which can be used by
plot2d
.
linopt::maximize
,
linopt::minimize
,
linopt::corners
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.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:
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:
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.