IBM ILOG Dispatcher User's Manual > The Basics > Adding Visit Disjunctions > Solve > Define the improveWithNHood function |
Define the improveWithNHood function |
INDEX
![]() |
After you have found a first solution, you create the neighborhoods you will use in the solution improvement phase. You use the constructor IloNHoodArray
to create an array of six neighborhoods called nhoodArray
. Five of these neighborhoods are the predefined neighborhoods IloRelocate
, IloExchange
, IloCross
, IloTwoOpt
, and IloOrOpt
. The neighborhood nhoodArray[2]
is created using the function IloConcatenate
to join together the array of swap neighborhoods you created in the section "Define the createVisits function". You also use the function IloConcatenate
to join together all the neighborhoods in nHoodArray
and create nhood
.
For more information about how predefined neighborhoods work, see ïtò^ B Predefined Neighborhoods.
Add the following code after the comment //Create the neighborhoods
The rest of the function is defined as in Chapter 3, Solving a Vehicle Routing Problem. You use the function IloSingleMove
to return a goal that makes a single local move as defined by a neighborhood and a search heuristic. The following code is provided for you:
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |