3 Employing Linear Programming Solvers

3.1 The Module LP

The module LP is provided as contribution (being part of the Mozart Oz 3 distribution) and can be accessed either by

declare [LP] = {Module.link ['x-oz://contrib/LP']}

or by

import RI at 'x-oz://contrib/LP'

as part of a functor definition.

{LP.solve $RIs +ObjFn +Constrs ?OptSol ?RetVal}

Invoke the LP solver. Use LP.config for configuring the solver.

VECTOR_OF(X) ::= tuple of X
 | record of X
 | list of X

RIs ::=  VECTOR_OF(RI)

RI ::= float | real interval variable

The first parameter is a vector of real-interval variables. The current bounds of the real-intervals are used as bound constraints by the LP solver. The second parameter determines the objective function:

ObjFn ::=  objfn(row:  <VECTOR_OF(float)>
      opt: min | max)

The value at opt stands for minimize (min) resp. maximize (max). The third parameter introduces the constraints to the LP solver.

Constrs ::=  VECTOR_OF(Constr)

Constr ::=  constr(row:   <VECTOR_OF(float)>
       type: '=<' | '==' | '>="
       rhs:   float )

The fourth parameter OptSol is constrained to the optimal solution. In case it is already constrained to a real-interval variable, the LP solver derives an additional constraint which makes sure that no greater (minimize) resp. smaller (maximize) solution is found. The last parameter indicates the success of the LP solvers.

RetVal ::= optimal
 | infeasable
 | unbounded
 | failure

{LP.config +put +ConfigDirection}

Set configuration of module LP. One can set mode and solver.

{LP.config +get ?CurrentConfig}

Read current configuration of module LP.

CurrentConfig ::=  config(avail:  <AVAIL_SOLVERS>
 |        mode:   <MODES>
 |        solver: <SOLVER>)      % takes a value of MODES

The solvers available depend on the machine your are on. The solver LP_SOLVE 2.0 (lpsolve) is the default solver. 1

AVAIL_SOLVERS ::= lpsolve
 | cplex_primopt
 | cplex_dualopt

The solver may run in two modes:

MODES ::= quiet
 | verbose

The verbose mode is intended for debugging and outputs whether an optimal was found (resp. if not what was the problem) and if so the optimal solution.


1. Note for users at PS Lab Saarbrücken: On orca you may be able to use optional solvers provided by CPLEX 5.0 (namely cplex_primopt and cplex_dualopt).

Tobias Müller
Version 1.0.1 (19990218)