Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Integer Programming with AMPL | ||||||||
Line: 43 to 43 | ||||||||
![]() | ||||||||
Changed: | ||||||||
< < | Let's look at ways to reduce the size of this branch-and-bound tree.Looking at the LP RelaxationOften you can gain insight into the branch-and-bound process by considering the LP relaxation. You can relax integrality without reformulating using \begin{verbatim}
Priorities, Searching and DirectionsAMPL and CPLEX allow you to define a priority for your integer variables. This means that if more than one integer variable is fractional in a solution, CPLEX will branch on the highest priority variable first. Let’s add the priority {\tt suffix} to our run file (before solving): \begin{verbatim}
\begin{verbatim}
\begin{verbatim}
\begin{verbatim}
\begin{verbatim}
| |||||||
> > | Let's look at ways to reduce the size of this branch-and-bound tree.
Looking at the LP RelaxationOften you can gain insight into the branch-and-bound process by considering the LP relaxation. You can relax integrality without reformulating usingoption relax_integrality 1; .
If we look at the variables we can see where our solution is fractional:
![]() TotalWeight constraint (display TotalWeight.body;) we can see that the truck is at its weight limit.
It looks likely that we should only use 2 fridges. We can create some new suffixes to experiment with our hypothesis.
Priorities, Searching and DirectionsAMPL and CPLEX allow you to define a priority for your integer variables. This means that if more than one integer variable is fractional in a solution, CPLEX will branch on the highest priority variable first. Let's add the priority suffix to our run file (before solving):suffix priority IN, integer, >= 0, <= 9999;(now we can assign variables priorities ranging from 0 - least - to 9999 - most). Let's give the Fridges variable a priority of 100 and the Make variables a priority of 0:
let Fridges.priority := 100; let {s in SCULPTURES} Make[s].priority := 0; ![]() Fridges early in the branch-and-bound tree. However, we can try a breadth-first search of the tree, since this will try different values for Fridges before performing branching on other variables. Setting nodeselect to 2 (best estimate) and backtrack to 0 makes CPLEX perform a search very close to breadth-first (see The AMPL CPLEX User Guide![]() option cplex_options ('timing 1 mipdisplay 5 mipinterval 1 ' & 'presolve 0 mipcuts -1 cutpass -1 ' & 'heurfreq -1 ' & 'nodeselect 2 backtrack 0'); ![]() suffix direction IN, integer, >= -1, <= 1;We can force a down branch first on Fridges :
let Fridges.direction := -1; ![]() reset; model ice.mod; data ice.dat; option solver cplex; option presolve 0; option cplex_options ('timing 1 mipdisplay 5 mipinterval 1' & 'presolve 0 mipcuts -1 cutpass -1 ' & 'heurfreq -1'); suffix priority IN, integer, >= 0, <= 9999; suffix direction IN, integer, >= -1, <= 1; let Fridges.priority := 100; let {s in SCULPTURES} Make[s].priority := 0; let Fridges.direction := -1; solve; display Fridges, Make; ![]() | |||||||
-- MichaelOSullivan - 23 Apr 2008 |