Variable Priorities
The time required for branch-and-bound algorithm to converge is highly dependent on the order in which the solver branches on the integer variables. Some integer variables impact the solution more than others. An example would be a plant location model, where we are deciding a) which plants to open, and b) which customers to assign to which plants. Clearly, the decision of opening a plant influences the solution considerably more than the decision of which plant to assign a given customer to. In general, performance will improve if the solver branches on the more critical integer variables first, while branching on the less critical variables later. LINGO provides the @PRIORITY function for controlling the branching priority of the variables.
The syntax of the @PRIORITY function is:
@PRIORITY( variable_name, relative_priority);
where variable_name is the name of the variable and relative_priority is a non-negative integer representing the relative priority of the variable. The @PRIORITY function may be used in a model anywhere you would normally enter a constraint. The @PRIORITY function can be embedded in an @FOR statement to allow you to easily set the priority of all, or selected, variables of an attribute. If a variable is not assigned a priority, it is assumed to have the lowest priority level of 0.
Some examples of @PRIORITY are:
Example 1: @PRIORITY( X, 100);
assigns variable X a priority of 100,
Example 2: @PRIORITY( PRODUCE( 5), 10);
assigns variable PRODUCE( 5) a priority of 10,
Example 3: @FOR( DAYS( I): @PRIORITY( START( I), 30));
assigns all the variables of the START a priority of 30.