IBM ILOG Dispatcher User's Manual > The Basics > IBM ILOG Dispatcher Concepts > Solve |
Solve |
INDEX
![]() |
Dispatcher uses a two-phase approach for solving routing problems. The first phase consists of generating a solution that satisfies the problem. In phase two, you improve this first solution using local search.
Solving a routing problem can be translated into the simple question: "Who does what?" In the case of the routing problem, this question can be answered by giving the list of visits performed by each vehicle. This is a routing plan, which can be represented and accessed in several ways:
IloModel
, which contains all the objects of the routing plan, such as visits and vehicles;
IloDispatcher
, to access or modify the values of the model's variables during or after a search;
IloRoutingSolution
, to access the routing plan resulting from a search and stored in a solution.
To allow dynamic problem solving, optimization in Dispatcher is based on first generating a solution, and then improving it using local search methods. As its name implies, local search acts by locally modifying a given solution to decrease the cost using neighborhoods. The central idea of a neighborhood is to define a set of solution changes that represent alternative moves that can be taken. In the case of vehicle routing, this translates into modifying the next-variables of some visit variables.
To achieve this in Dispatcher, a double representation of the problem is used. A passive representation based on instances of IloRoutingSolution
, depicting the last valid solution encountered, is associated with each decision variable in the problem--the next-vars, prev-vars and performed-vars. The saved values of the passive representation can be accessed through member functions such as IloRoutingSolution::getNext(IloVisit)
, IloRoutingSolution::getPrev(IloVisit)
and IloRoutingSolution::isPerformed(IloVisit)
.
An active representation of the problem is used to search for a new, modified solution using neighborhoods.
Thus, the process for solving a problem using Dispatcher is:
IloRoutingSolution
.
In a normal Dispatcher application, you would generate a first solution using one of Dispatcher's predefined first solution generation functions. For more information, see Chapter 3, Solving a Vehicle Routing Problem and ïtò^ A Predefined First Solution Heuristics. You could also load a first solution from a file or write your own first solution generation method. For more information, see Chapter 17, Developing Your Own First Solution Heuristics.
To demonstrate the concepts involved in local search, imagine that you have a simple routing problem with one vehicle, one depot, and three customer visits.
You set the cost of the vehicle to be proportional to the distance traveled length
.
IloDimension2 length(env, IloEuclidean); w.setCost(length, 1); |
You input a first solution where the vehicle starts at the depot, makes visit 1, then visit 2, then visit 3, and finally returns to the depot. The cost of this routing plan would be 4.83 (). The following figure shows this routing plan.
You then use local search to modify the next-variables of some variables and search for a routing plan with a lower cost. To do this, you use Dispatcher's predefined neighborhoods and search heuristics to guide how the alternative moves in a neighborhood are taken. For more information, see Chapter 3, Solving a Vehicle Routing Problem and ïtò^ B Predefined Neighborhoods.
The improved solution has a cost of 4. The following figure shows this routing plan.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |