IBM ILOG Dispatcher User's Manual > Developing Dispatcher Applications > Developing Your Own First Solution Heuristics > Creating your own first solution heuristic > Building Routes |
Building Routes |
INDEX
![]() |
The goal that builds the route for a given vehicle is the central goal of the search. Given the addition heuristic approach described in the preceding section, the goal iteratively chooses visits and tests to see if the selected visit can extend the current partial route.
Visits are chosen in order to minimize the cost increase of the current partial route. This is done by iterating on the possible successors of the last visit of the current partial route. The heuristic selects the cheapest visit that is not a first or a last visit and the vehicle variable that contains the current vehicle.
An internal search tests if the visit can extend the current partial route by checking if the route can be closed with the addition of the newly selected visit. The goal used for this search constrains the selected visit to directly follow the last visit of the current route, using IloDispatcher::setNext(IloVisit, IloVisit)
, and closes the route using IloGenerateRoute(IloSolver, IloVehicle)
. Note that it is better to limit the search when closing the route to avoid spending too much time proving that the route cannot be closed.
If the selected visit can extend the route, it is constrained to do so, using IloDispatcher::setNext(IloVisit, IloVisit)
, and becomes the new last visit of the current partial route. The iteration ends when no more visits can be found to extend the partial route.
Here is the code for generating a route:
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |