Imposing priorities

Top  Previous  Next

In MIP models users can specify an order for picking variables to branch on during a branch and bound search.  This is done through the use of priorities.  Without priorities, the MIP algorithm will internally determine which variable is the most suitable to branch on.

Priorities are set for individual variables through the use of the .prior variable attribute as discussed in the Variables, Equations, Models, and Solves chapter.  The closer to one the setting of the .prior variable attribute, then the higher the priority the variable is given when it is one of the eligible candidates for branching upon in the MIP solver.  Priorities can be set to any real value or +inf.  The default value is 1.0. Functionally .prior establishes in what order variables are to be fixed to integral values while searching for a solution. Variables with a specific .prior value will remain relaxed until all variables with a lower .prior values have been fixed. The most important variables should be given the highest priority and this means they should have the closets to one nonzero values of the prior attribute.

For priorities other than the infinity one to be used the user must activate them through use of the GAMS model attribute statement

 

mymodel.prioropt = 1 ;

 

where mymodel is the name of the model specified in the model statement for the problem to be solved as discussed in the Model Attributes chapter.  The default value is 0 in which case priorities will not be used.

Example:

The following example illustrates its use,

 

mymodel.prioropt = 1 ;

z.prior(i,'small') = 3 ;

z.prior(i,'medium') = 2 ;

z.prior(i,'large') = 1 ;

 

In the above example, z(i,'large') variables are branched on before z(i, 'small') variables.

Notes:

The higher the value given to the .prior suffix, the lower the priority for branching.
Note that there is a prior variable attribute for each individual component of a multidimensional variable.
All members of any SOS1 or SOS2 set should be given the same priority value.
The .prior attribute of a discrete variable can be used to relax the discrete restriction on that variable.  Setting the .prior value to +inf will relax a variable permanently. This relaxation is done independent of the model attribute .prioropt.