Difference between revisions of "LpDefine"

(Listed parameters for Lpdefine)
(Full set of Parameters)
Line 24: Line 24:
 
** 'I' : Integer-valued
 
** 'I' : Integer-valued
 
** 'B' : Binary (0/1) valued
 
** 'B' : Binary (0/1) valued
 +
** 'G' : Group valued
 
* ''Group'' : optional number all[Vars]  
 
* ''Group'' : optional number all[Vars]  
 +
The group number for a group-integer-valued variable.
 
* ''Engine'' : optional text
 
* ''Engine'' : optional text
 
Used to select a third-party (non-default) solver engine.  Use [[SolverInfo]]("AvailEngines") to get a list of installed engines.
 
Used to select a third-party (non-default) solver engine.  Use [[SolverInfo]]("AvailEngines") to get a list of installed engines.
Line 30: Line 32:
 
* ''Setting'' : optional numeric
 
* ''Setting'' : optional numeric
 
Parameter and Setting are used together to change a search-control parameter from its default value.  To set multiple parameters, ensure that Parameter and Setting contain a common index.  For a list of parameters supported by a given engine, use [[SolverInfo]]("DefaultSettings",engine:engineName).
 
Parameter and Setting are used together to change a search-control parameter from its default value.  To set multiple parameters, ensure that Parameter and Setting contain a common index.  For a list of parameters supported by a given engine, use [[SolverInfo]]("DefaultSettings",engine:engineName).
 +
 +
= Mixed-Integer Linear Programs =
 +
 +
Each variables in a linear program may be continuous or integer-valued.  Integer-valued variables may be general integer, binary (0/1), or group-valued.  The ''CType'' parameter specifies the type of each variable, and may take on the following values:
 +
 +
* 'C' : Continuous (real-valued)
 +
* 'I' : Integer-valued
 +
* 'B' : Binary (0/1) valued
 +
* 'G' : Group valued
 +
 +
If you specify a single value, such as:
 +
LpDefine( ..., CType : 'I', ... )
 +
 +
then all variables will be of that type.  For a mixed-integer problem, where some variables are continuous and others are integer-valued, the parameter value should be indexed by the Vars index.
 +
 +
== Group Variables ==
 +
 +
An integer-valued variable may belong to a group.  A group of N variables take on the values 1..N, such that each variable in the group must have a different value.  For example, if x1, x2 and x3 are all in the same group, then x1=1, x2=3 and x3=2 would be a possible solution, but x1=2, x2=3, x3=2 would not.
 +
 +
A group-valued variable is specified by setting ''CType:'G''' for the variable and specifying the group number for the variable in the Group parameter.  If a variable does not belong to a group, ''Group'' should be zero.  (If not all variables belong to the same group, then the ''Group'' parameter must be indexed by ''Vars'').
 +
 +
= Specifying Search Control Parameters =
 +
 +
In complex problems, you may need to adjust search control parameters.  This is done using the parameters ''Parameter'' and ''Setting'', where parameter contains the parameter name and setting contains the value.  For example, to change the solution tolerance from its default value to 100n, use
 +
LpDefine(..., Parameter:"SolutionTol", Setting:100n )
 +
 +
To specify more than one parameter setting, the values for Parameter and Setting should have a common index.  Alternatively, ''Setting'' can be specified without Parameter, as long as Setting is a 1-D array, where the index values contain the parameter name.
  
 
= See Also =
 
= See Also =

Revision as of 00:26, 10 April 2007


Defines a linear programming problem.

LpDefine( Vars, Constraints, objCoef, Lhs, Rhs )

Full set of Parameters

LpDefine supports many optional parameters. The full set of parameters are as follows:

  • Vars : Index
  • Constraints : Index
  • objCoef : Numeric all[Vars]
  • Lhs : numeric all[Vars,Constraints]
  • Rhs : numeric all[Constraints]
  • Sense : optional Textual[Constraints]

One of: '<', '>' or '='

  • Maximize : optional Boolean

True for maximization problems, false (default) for minimization.

  • Lb : optional Numeric[Vars]
  • Ub : optional Numeric[Vars]
  • CType : optional Textual[Vars]
    • 'C' : Continuous (real-valued)
    • 'I' : Integer-valued
    • 'B' : Binary (0/1) valued
    • 'G' : Group valued
  • Group : optional number all[Vars]

The group number for a group-integer-valued variable.

  • Engine : optional text

Used to select a third-party (non-default) solver engine. Use SolverInfo("AvailEngines") to get a list of installed engines.

  • Parameter : optional Text
  • Setting : optional numeric

Parameter and Setting are used together to change a search-control parameter from its default value. To set multiple parameters, ensure that Parameter and Setting contain a common index. For a list of parameters supported by a given engine, use SolverInfo("DefaultSettings",engine:engineName).

Mixed-Integer Linear Programs

Each variables in a linear program may be continuous or integer-valued. Integer-valued variables may be general integer, binary (0/1), or group-valued. The CType parameter specifies the type of each variable, and may take on the following values:

  • 'C' : Continuous (real-valued)
  • 'I' : Integer-valued
  • 'B' : Binary (0/1) valued
  • 'G' : Group valued

If you specify a single value, such as:

LpDefine( ..., CType : 'I', ... )

then all variables will be of that type. For a mixed-integer problem, where some variables are continuous and others are integer-valued, the parameter value should be indexed by the Vars index.

Group Variables

An integer-valued variable may belong to a group. A group of N variables take on the values 1..N, such that each variable in the group must have a different value. For example, if x1, x2 and x3 are all in the same group, then x1=1, x2=3 and x3=2 would be a possible solution, but x1=2, x2=3, x3=2 would not.

A group-valued variable is specified by setting CType:'G' for the variable and specifying the group number for the variable in the Group parameter. If a variable does not belong to a group, Group should be zero. (If not all variables belong to the same group, then the Group parameter must be indexed by Vars).

Specifying Search Control Parameters

In complex problems, you may need to adjust search control parameters. This is done using the parameters Parameter and Setting, where parameter contains the parameter name and setting contains the value. For example, to change the solution tolerance from its default value to 100n, use

LpDefine(..., Parameter:"SolutionTol", Setting:100n )

To specify more than one parameter setting, the values for Parameter and Setting should have a common index. Alternatively, Setting can be specified without Parameter, as long as Setting is a 1-D array, where the index values contain the parameter name.

See Also

Comments


You are not allowed to post comments.