|
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:
|