Google MAPS API - intermediate waypoints optimization grouped in pairs (origin and destination)

Viewed 40

I need to calculate a route by optimizing the intermediate waypoints. I find the Google Direction API but i need another feature.

The waypoints that i need to optimized should by group in pair of Origin and Destination because I need to organize a route for a sanitary transporter that shoud pick up and carry some patients.

I give an example:

(Initial) Origin and (Final) Destination : Address of transporter's garage

Intermediate waypoints :

  1. Address of first patient's house (fist origin)
  2. Address of hospital A ( first destination)
  3. Address of second patient's house (Second origin)
  4. Address of hospital B (second destination)

The destination point must be after his relative origin point.

Google directions API with Optimize = True could respond to me with the reordered list of waypoints where the destination point of a couple is before the relative origin waypoint. (so this means I should go to the hospital without first picking up the patient and that doesn't make sense ).

How can i solve this problem ?

0 Answers
Related