IBM ILOG Dispatcher User's Manual > Field Service Solutions > Dispatching Technicians II > Solve

The solution is computed, improved, and displayed by methods previously presented for the PDP problem, with the addition of one goal.

Step 14   -  

Add the goals

Add the following code after the comment //Add the goals.

  IloGoal instantiateCost =
    IloDichotomize(env, dispatcher.getCostVar(), IloFalse);
  IloGoal restoreSolution = IloRestoreSolution(env, _solution);
  IloGoal goal =
    IloInsertionGenerate(env) && instantiateCost ;

IloInsertionGenerate is an insertion heuristic algorithm used to build a first solution for a routing plan. An insertion heuristic builds a solution to the routing model using an algorithm which consists of inserting visits at the lowest cost position at the time of insertion. This insertion point will not necessarily be the visit's lowest cost position when the entire routing plan has been constructed.

Step 15   -  

Compile and run the program

The solution improvement phase finds a solution using 4 vehicles with a cost of 619.143 units

First Solution with cost: 735.716
Improving solution
***Improved Solution***
Number of fails               : 0
Number of choice points       : 1049
Number of variables           : 479
Number of constraints         : 108
Reversible stack (bytes)      : 68364
Solver heap (bytes)           : 333940
Solver global heap (bytes)    : 70960
And stack (bytes)             : 20124
Or stack (bytes)              : 44244
Search Stack (bytes)          : 4044
Constraint queue (bytes)      : 11160
Total memory used (bytes)     : 552836
Elapsed time since creation   : 0
Number of nodes               : 21
Number of visits              : 30
Number of vehicles            : 5
Number of dimensions          : 1
Number of accepted moves      : 13
===============
Cost         : 619.143
Number of vehicles used : 4