GraphHopper.com | Forum | GitHub | Maps | Blog

How to optimize base on custom optimization options


#1

Let’s assume there are three optimization options ‘Less Vehicle’, ‘Less Time’ and ‘Less Distance’.
When user optimize with ‘Less Vehicle’, need to optimize using minimum vehicles. With ‘Less Time’, total working hours need to be lesser than other options. With ‘Less Distance’, total distance need to be shorter than other options.
Currently I tried using the following objectives for three options:

Less Vehicle - objectves: [{
type: ‘min’,
value: ‘vehicles’
},{
type: ‘min’,
value: ‘completion’
}]

Less Time - objectves: [{
type: ‘min’,
value: ‘completion_time’
}]

Less Distance - objectves: [{
type: ‘min’,
value: ‘transport_time’
}]

But, mostly Less Vehicle and Less Time is getting same result. How can I do to get the correct result for these three options.

Thanks