Vehicle: Max Travel Cost and Max Tasks

In this example we will learn about some useful vehicle constraints. NextBillion.ai’s Route Optimization V2 provides options to control the maximum number of tasks that a vehicle can serve and also the maximum travel cost that it can incur. These parameters can be used to limit the usage of vehicles and prevent them against unexpected high costs, potential breakdowns or just control the fuel consumptions.

Get Started

Readers would need a valid NextBillion API key to try this example out. If you don’t have one, please contact us to get your API key now!

Setup

Once you have a valid API Key, you can start setting up the components to be used in this example. Let’s take a look at them below.

Jobs & Shipments

We start by defining 10 jobs and 3 shipments. For these tasks we add:

  1. A unique identifier for each task

  2. Location indexes for each task

  3. The schedule of tasks. This is done by adding time windows within which a task must be completed. We have added a 15 min time window for all tasks for the sake of simplicity, but Route Optimization V2 can handle complex task schedules as well.

  4. The actual time taken to complete the tasks once the driver/vehicle is at the task’s location i.e. the service time for each task.

  5. Pick-up and delivery quantities for shipments and jobs. Since we are adding capacities for the vehicles, we are adding quantities for jobs as pickup=[0]. Please refer to the Basic Route Optimization example to know more.

Let’s take a look at the jobs JSON after the above properties are configured:

1{
2  "jobs": [
3    {
4      "id": 1,
5      "location_index": 0,
6      "service": 120,
7      "pickup": [
8        0
9      ],
10      "time_windows": [
11        [
12          1693386000,
13          1693386900
14        ]
15      ]
16    },
17    {
18      "id": 2,
19      "location_index": 1,
20      "service": 180,
21      "pickup": [
22        0
23      ],
24      "time_windows": [
25        [
26          1693387800,
27          1693388700
28        ]
29      ]
30    },
31    {
32      "id": 3,
33      "location_index": 2,
34      "service": 120,
35      "pickup": [
36        0
37      ],
38      "time_windows": [
39        [
40          1693389600,
41          1693390500
42        ]
43      ]
44    },
45    {
46      "id": 4,
47      "location_index": 3,
48      "service": 120,
49      "pickup": [
50        0
51      ],
52      "time_windows": [
53        [
54          1693391400,
55          1693392300
56        ]
57      ]
58    },
59    {
60      "id": 5,
61      "location_index": 4,
62      "service": 60,
63      "pickup": [
64        0
65      ],
66      "time_windows": [
67        [
68          1693393200,
69          1693394100
70        ]
71      ]
72    },
73    {
74      "id": 6,
75      "location_index": 5,
76      "service": 120,
77      "pickup": [
78        0
79      ],
80      "time_windows": [
81        [
82          1693396800,
83          1693397700
84        ]
85      ]
86    },
87    {
88      "id": 7,
89      "location_index": 6,
90      "service": 120,
91      "pickup": [
92        0
93      ],
94      "time_windows": [
95        [
96          1693398600,
97          1693399500
98        ]
99      ]
100    },
101    {
102      "id": 8,
103      "location_index": 7,
104      "service": 150,
105      "pickup": [
106        0
107      ],
108      "time_windows": [
109        [
110          1693401300,
111          1693402200
112        ]
113      ]
114    },
115    {
116      "id": 9,
117      "location_index": 8,
118      "service": 80,
119      "pickup": [
120        0
121      ],
122      "time_windows": [
123        [
124          1693404000,
125          1693404900
126        ]
127      ]
128    },
129    {
130      "id": 10,
131      "location_index": 9,
132      "service": 120,
133      "pickup": [
134        0
135      ],
136      "time_windows": [
137        [
138          1693405800,
139          1693406700
140        ]
141      ]
142    }
143  ],
144  "shipments": [
145    {
146      "pickup": {
147        "description": "Shipment Pickup 1",
148        "id": 1,
149        "location_index": 10,
150        "service": 120,
151        "time_windows": [
152          [
153            1693395000,
154            1693395900
155          ]
156        ]
157      },
158      "delivery": {
159        "description": "Shipment Delivery 1",
160        "id": 1,
161        "location_index": 11,
162        "service": 120,
163        "time_windows": [
164          [
165            1693397700,
166            1693398600
167          ]
168        ]
169      },
170      "amount": [
171        2
172      ]
173    },
174    {
175      "pickup": {
176        "description": "Shipment Pickup 2",
177        "id": 2,
178        "location_index": 12,
179        "service": 120,
180        "time_windows": [
181          [
182            1693399500,
183            1693400400
184          ]
185        ]
186      },
187      "delivery": {
188        "description": "Shipment Delivery 2",
189        "id": 2,
190        "location_index": 13,
191        "service": 120,
192        "time_windows": [
193          [
194            1693402200,
195            1693403100
196          ]
197        ]
198      },
199      "amount": [
200        2
201      ]
202    },
203    {
204      "pickup": {
205        "description": "Shipment Pickup 3",
206        "id": 3,
207        "location_index": 14,
208        "service": 120,
209        "time_windows": [
210          [
211            1693400400,
212            1693401300
213          ]
214        ]
215      },
216      "delivery": {
217        "description": "Shipment Delivery 3",
218        "id": 3,
219        "location_index": 15,
220        "service": 120,
221        "time_windows": [
222          [
223            1693407600,
224            1693408500
225          ]
226        ]
227      },
228      "amount": [
229        2
230      ]
231    }
232  ]
233}

Vehicles

Next, we add 4 vehicles that are going to fulfill the tasks within the defined constraints. To describe the vehicles and their properties we add:

  1. A unique ID for each vehicle

  2. Vehicle shift time or the time window

  3. Capacity to denote the amount of load that the vehicle can take

  4. Start_index to denote the point from where the vehicle would start.

  5. Costs for all vehicles. We have specified fixed cost for all vehicles and per_hourcost for two of the vehicles.

    1. max_travel_cost to put a cap on the traveling cost that a vehicle can incur. We are going with 5000 seconds as the maximum cost per vehicle. Please observe that

    2. cost here is in seconds, as we are not explicitly mentioning any travel_cost settings. Therefore, the solver goes with the default setting of duration for cost.

    3. the max_travel_cost applies only to the “traveling” cost of the vehicle. Individual vehicle’s costs - per_hour or fixed - are outside the scope of this constraint. Therefore, the final cost may turn out to be more than that specified for max_travel_cost. We are covering such a case in this example. Please refer to Analyzing the Solution section.

  6. max_tasks to limit the number of tasks that each vehicle can take. We set this constraint to 5 tasks for each vehicle. It needs to be highlighted here that a job represents 1 task whereas a shipment represents 2 tasks (1 each for the pickup and the delivery step).

Once the vehicle and their properties are defined, the resulting vehicles JSON is:

1{
2  "vehicles": [
3    {
4      "id": 1,
5      "start_index": 16,
6      "capacity": [
7        20
8      ],
9      "costs": {
10        "fixed": 1000,
11        "per_hour": 5400
12      },
13      "time_window": [
14        1693382400,
15        1693418400
16      ],
17      "max_tasks": 5,
18      "max_travel_cost": 5000
19    },
20    {
21      "id": 2,
22      "start_index": 17,
23      "capacity": [
24        20
25      ],
26      "costs": {
27        "fixed": 3000,
28        "per_hour": 3600
29      },
30      "time_window": [
31        1693382400,
32        1693418400
33      ],
34      "max_tasks": 5,
35      "max_travel_cost": 5000
36    },
37    {
38      "id": 3,
39      "start_index": 18,
40      "capacity": [
41        20
42      ],
43      "costs": {
44        "fixed": 4000
45      },
46      "time_window": [
47        1693382400,
48        1693418400
49      ],
50      "max_tasks": 5,
51      "max_travel_cost": 5000
52    },
53    {
54      "id": 4,
55      "capacity": [
56        20
57      ],
58      "start_index": 19,
59      "costs": {
60        "fixed": 3000
61      },
62      "time_window": [
63        1693382400,
64        1693418400
65      ],
66      "max_tasks": 5,
67      "max_travel_cost": 5000
68    }
69  ]
70}

Locations

And lastly, we would define the locations object by adding all the locations used in the problem along with a valid id. The locations object with all the points used in this example:

1{
2  "locations": {
3    "id": 1,
4    "location": [
5      "34.083950,-118.318640",
6      "34.054927,-118.323726",
7      "34.075525,-118.361588",
8      "34.076350,-118.338519",
9      "34.090425,-118.338933",
10      "34.037925,-118.459842",
11      "34.004364,-118.421170",
12      "34.000215,-118.318803",
13      "33.945884,-118.325628",
14      "34.000895,-118.204929",
15      "34.076646,-118.376969",
16      "34.094986,-118.300885",
17      "34.018780,-118.317919",
18      "33.996658,-118.261708",
19      "33.916595,-118.240132",
20      "33.946275,-118.385486",
21      "34.057106,-118.361326",
22      "34.016137,-118.253523",
23      "33.940407,-118.265196",
24      "33.974060,-118.246945"
25    ]
26  }
27}

Optimization POST Request

Now let’s put all these components together and create the final POST request that we will submit to the optimizer.

1curl --location 'https://api.nextbillion.io/optimization/v2?key=<your_api_key>' \
2--header 'Content-Type: application/json' \
3--data '{
4   "description": "Vehicle MaxTravelCost & MaxTask Example",
5   "jobs": [
6       {
7           "id": 1,
8           "location_index":0,
9           "service": 120,
10           "pickup":[0],
11           "time_windows": [
12               [
13                   1693386000,
14                   1693386900
15               ]
16           ]
17       },
18       {
19           "id": 2,
20           "location_index": 1,
21           "service": 180,
22           "pickup":[0],
23           "time_windows": [
24               [
25                   1693387800,
26                   1693388700
27               ]
28           ]
29       },
30       {
31           "id": 3,
32           "location_index": 2,
33           "service": 120,
34           "pickup":[0],
35           "time_windows": [
36               [
37                   1693389600,
38                   1693390500
39               ]
40           ]
41       },
42       {
43           "id": 4,
44           "location_index": 3,
45           "service": 120,
46           "pickup":[0],
47           "time_windows": [
48               [
49                   1693391400,
50                   1693392300
51               ]
52           ]
53       },
54       {
55           "id": 5,
56           "location_index": 4,
57           "service": 60,
58           "pickup":[0],
59           "time_windows": [
60               [
61                   1693393200,
62                   1693394100
63               ]
64           ]
65       },
66       {
67           "id": 6,
68           "location_index": 5,
69           "service": 120,
70           "pickup":[0],
71           "time_windows": [
72               [
73                   1693396800,
74                   1693397700
75               ]
76           ]
77       },
78       {
79           "id": 7,
80           "location_index": 6,
81           "service": 120,
82           "pickup":[0],
83           "time_windows": [
84               [
85                   1693398600,
86                   1693399500
87               ]
88           ]
89       },
90       {
91           "id": 8,
92           "location_index": 7,
93           "service": 150,
94           "pickup":[0],
95           "time_windows": [
96               [
97                   1693401300,
98                   1693402200
99               ]
100           ]
101       },
102       {
103           "id": 9,
104           "location_index": 8,
105           "service": 80,
106           "pickup":[0],
107           "time_windows": [
108               [
109                   1693404000,
110                   1693404900
111               ]
112           ]
113       },
114       {
115           "id": 10,
116           "location_index": 9,
117           "service": 120,
118           "pickup":[0],
119           "time_windows": [
120               [
121                   1693405800,
122                   1693406700
123               ]
124           ]
125       }
126   ],
127   "shipments": [
128       {
129        "pickup":{
130           "description": "Shipment Pickup 1",
131           "id":1,
132           "location_index":10,
133           "service":120,
134           "time_windows":[[1693395000,1693395900]]
135        },
136        "delivery":{
137           "description": "Shipment Delivery 1",
138           "id":1,
139           "location_index":11,
140           "service":120,
141           "time_windows":[[1693397700,1693398600]]
142        },
143        "amount":[2]
144        },
145        {
146         "pickup":{
147           "description": "Shipment Pickup 2",
148           "id":2,
149           "location_index":12,
150           "service":120,
151           "time_windows":[[1693399500,1693400400]]
152        },
153        "delivery":{
154           "description": "Shipment Delivery 2",
155           "id":2,
156           "location_index":13,
157           "service":120,
158           "time_windows":[[1693402200,1693403100]]
159        },
160        "amount":[2]
161       },
162       {
163         "pickup":{
164           "description": "Shipment Pickup 3",
165           "id":3,
166           "location_index":14,
167           "service":120,
168           "time_windows":[[1693400400,1693401300]]
169        },
170        "delivery":{
171           "description": "Shipment Delivery 3",
172           "id":3,
173           "location_index":15,
174           "service":120,
175           "time_windows":[[1693407600,1693408500]]
176        },
177        "amount":[2]
178       }
179   ],
180   "vehicles": [
181       {
182           "id": 1,
183           "start_index": 16,
184           "capacity":[20],
185           "costs":{
186               "fixed":1000,
187               "per_hour":5400
188            },
189           "time_window": [
190               1693382400,
191                   1693418400
192           ],
193           "max_tasks": 5,
194           "max_travel_cost": 5000
195       },
196       {
197           "id": 2,
198           "start_index": 17,
199           "capacity":[20],
200           "costs":{
201               "fixed":3000,
202               "per_hour": 3600
203            },
204           "time_window": [
205               1693382400,
206                   1693418400
207           ],
208           "max_tasks": 5,
209           "max_travel_cost": 5000
210       },
211       {
212           "id": 3,
213           "start_index": 18,
214           "capacity":[20],
215           "costs":{
216               "fixed":4000
217            },
218           "time_window": [
219            1693382400,
220                1693418400
221           ],
222           "max_tasks": 5,
223           "max_travel_cost": 5000
224       },
225       {
226           "id": 4,
227           "capacity":[20],
228           "start_index": 19,
229           "costs":{
230               "fixed":3000
231            },
232           "time_window": [
233           1693382400,
234                   1693418400
235           ],
236           "max_tasks": 5,
237           "max_travel_cost": 5000
238       }
239   ],
240    "locations":
241        {
242            "id": 1,
243            "location": ["34.083950,-118.318640", "34.054927,-118.323726","34.075525,-118.361588","34.076350,-118.338519","34.090425,-118.338933","34.037925,-118.459842","34.004364,-118.421170", "34.000215,-118.318803","33.945884,-118.325628","34.000895,-118.204929", "34.076646,-118.376969","34.094986,-118.300885","34.018780,-118.317919","33.996658,-118.261708", "33.916595,-118.240132", "33.946275,-118.385486","34.057106,-118.361326", "34.016137,-118.253523", "33.940407,-118.265196","33.974060,-118.246945"]
244        }
245}
246'

Optimization POST Response

Once the request is made, we get a unique ID in the API response:

1{
2"id": "96ba15bf2ef178053929bedd3b0f7d56",
3"message": "Optimization job created",
4"status": "Ok"
5}

Optimization GET Request

We take the ID and use the Optimization GET request to retrieve the result. Here is the GET request:

1curl --location 'https://api.nextbillion.io/optimization/v2/result?id=96ba15bf2ef178053929bedd3b0f7d56
2&key=<your_api_key>'

Optimization GET Response

Following is the optimized route plan:

1{
2  "description": "Vehicle MaxTravelCost & MaxTask Example",
3  "result": {
4    "code": 0,
5    "summary": {
6      "cost": 21899,
7      "routes": 4,
8      "unassigned": 0,
9      "setup": 0,
10      "service": 1910,
11      "duration": 10502,
12      "waiting_time": 25569,
13      "priority": 0,
14      "delivery": [
15        6
16      ],
17      "pickup": [
18        6
19      ],
20      "distance": 141270.5
21    },
22    "routes": [
23      {
24        "vehicle": 1,
25        "cost": 2191,
26        "steps": [
27          {
28            "type": "start",
29            "arrival": 1693388364,
30            "duration": 0,
31            "service": 0,
32            "waiting_time": 0,
33            "location": [
34              34.057106,
35              -118.361326
36            ],
37            "location_index": 16,
38            "load": [
39              0
40            ]
41          },
42          {
43            "type": "job",
44            "arrival": 1693388700,
45            "duration": 336,
46            "service": 180,
47            "waiting_time": 0,
48            "location": [
49              34.054927,
50              -118.323726
51            ],
52            "location_index": 1,
53            "id": 2,
54            "load": [
55              0
56            ]
57          },
58          {
59            "type": "job",
60            "arrival": 1693389206,
61            "duration": 662,
62            "service": 120,
63            "waiting_time": 2194,
64            "location": [
65              34.07635,
66              -118.338519
67            ],
68            "location_index": 3,
69            "id": 4,
70            "load": [
71              0
72            ]
73          },
74          {
75            "type": "job",
76            "arrival": 1693391652,
77            "duration": 794,
78            "service": 60,
79            "waiting_time": 1548,
80            "location": [
81              34.090425,
82              -118.338933
83            ],
84            "location_index": 4,
85            "id": 5,
86            "load": [
87              0
88            ]
89          },
90          {
91            "type": "end",
92            "arrival": 1693393260,
93            "duration": 794,
94            "service": 0,
95            "waiting_time": 0,
96            "location": [
97              34.090425,
98              -118.338933
99            ],
100            "location_index": 4,
101            "load": [
102              0
103            ]
104          }
105        ],
106        "service": 360,
107        "duration": 794,
108        "waiting_time": 3742,
109        "priority": 0,
110        "delivery": [
111          0
112        ],
113        "pickup": [
114          0
115        ],
116        "distance": 8868.1,
117        "geometry": "ywznEjmlqUBG@G@GAEEEMIw@[q@WLoA@KB[JmAB_@?U@[?a@?iABiD?u@@c@@aB@iB@g@?S@_ABsF@aB?s@?k@@o@?m@@g@?UBgBB{EDcF@s@@qD@aB@[@gA?y@?]BuB?}@?W@m@?Q?W@{@?]?K@M?kA?Q?U?I@_@BuE@qA@W?c@DcB?u@?y@?M@}B@mA?]@g@@y@@s@@c@@aA?S?U@aB@g@?e@@s@?c@@uA?m@@o@?cC@u@@{@@o@?sA?Y?Q?I?Y@m@@g@AG?A?g@@[BUBUDUFYVmA@GH_@RgAb@}B\\mB`@sBX{ADUFUNy@ZgBReABQTgADSFYBKFc@BWD[F}@@IHaBZqFLaCPuCDo@D}@BS_@C^BCRE|@En@QtCM`C[pFI`BAHG|@EZCVGb@CJGXERUfACPSdA[fBOx@GTETYzAa@rB]lBc@|BSfAI^AFWlAGXETCTCTAZ?f@?@@FAf@Al@?X?H?P?X?rAAn@Az@At@?bCAn@?l@AtA?b@Ar@?d@Af@A`B?T?RA`AAb@a@Ii@MWG[IkA[cA[]Ia@Ma@MuCy@kBg@e@Mc@MmCu@]KW?KAI@K@M@KDGBC?MDWHE?M@QIM?O@O?}@@mB?cAAoC@w@?c@?c@@mB@Q?gE?_@?_@?_D?cAAkB@a@?g@?gAA}B@_E?kA?cF?iE?{A?gA@gCAM?s@@yBA]?a@?M?Q?{B?iF@iDAY?gEB_IAaFA[@[?_@?i@?{@?[?m@?cB?G?E?QLw@?sA@S?M?W?oA?U?W?aA?]?c@?y@?[?eB?W?S?i@?s@?oA?U?M?eA?U?q@@Y@U???"
118      },
119      {
120        "vehicle": 4,
121        "cost": 5171,
122        "steps": [
123          {
124            "type": "start",
125            "arrival": 1693400619,
126            "duration": 0,
127            "service": 0,
128            "waiting_time": 0,
129            "location": [
130              33.97406,
131              -118.246945
132            ],
133            "location_index": 19,
134            "load": [
135              0
136            ]
137          },
138          {
139            "type": "pickup",
140            "arrival": 1693401300,
141            "duration": 681,
142            "service": 120,
143            "waiting_time": 0,
144            "location": [
145              33.916595,
146              -118.240132
147            ],
148            "location_index": 14,
149            "id": 3,
150            "load": [
151              2
152            ],
153            "description": "Shipment Pickup 3"
154          },
155          {
156            "type": "job",
157            "arrival": 1693402236,
158            "duration": 1497,
159            "service": 80,
160            "waiting_time": 1764,
161            "location": [
162              33.945884,
163              -118.325628
164            ],
165            "location_index": 8,
166            "id": 9,
167            "load": [
168              2
169            ]
170          },
171          {
172            "type": "delivery",
173            "arrival": 1693404754,
174            "duration": 2171,
175            "service": 120,
176            "waiting_time": 2846,
177            "location": [
178              33.946275,
179              -118.385486
180            ],
181            "location_index": 15,
182            "id": 3,
183            "load": [
184              0
185            ],
186            "description": "Shipment Delivery 3"
187          },
188          {
189            "type": "end",
190            "arrival": 1693407720,
191            "duration": 2171,
192            "service": 0,
193            "waiting_time": 0,
194            "location": [
195              33.946275,
196              -118.385486
197            ],
198            "location_index": 15,
199            "load": [
200              0
201            ]
202          }
203        ],
204        "service": 320,
205        "duration": 2171,
206        "waiting_time": 4610,
207        "priority": 0,
208        "delivery": [
209          2
210        ],
211        "pickup": [
212          2
213        ],
214        "distance": 24304.5,
215        "geometry": "iqjnElbvpU?nCj@?bA?Z?R?~C@fA?t@?\\?NAdA?L?xA?p@?pB?h@?N?\\?L?|@@t@ArBA|@B\\?X?j@?J?N@h@AZ?pAA|C?`DAP?z@?pA@dBAlA?`@?d@?^?V?nA?fB?fB?`A?Z?JAH?HAH?BALABADAFCFCNKHEFGNKLINGFADAPAJA??Z?@?r@@R@~DFzDFjA@rBB`@BvDDvABr@@`@?R@h@@n@?p@?^BF??_@@g@?U?U@_@@_@@_@Dw@@]bFFJ?hABz@@d@@xABT?xFJtABT?P?R@pBBt@@bA@lB@t@?^?Z?h@@X?v@?T?p@?R?j@?F?NAR?T?Z?VAj@?lA?^?bB@d@?l@@hA?^?J?fAAlA?l@@P?X?vA?xA?rA?jD?jC@~@?v@@R?pA?h@@lA?`@?d@@r@?\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        "cost": 6989,
220        "steps": [
221          {
222            "type": "start",
223            "arrival": 1693385864,
224            "duration": 0,
225            "service": 0,
226            "waiting_time": 0,
227            "location": [
228              34.016137,
229              -118.253523
230            ],
231            "location_index": 17,
232            "load": [
233              0
234            ]
235          },
236          {
237            "type": "job",
238            "arrival": 1693386900,
239            "duration": 1036,
240            "service": 120,
241            "waiting_time": 0,
242            "location": [
243              34.08395,
244              -118.31864
245            ],
246            "location_index": 0,
247            "id": 1,
248            "load": [
249              0
250            ]
251          },
252          {
253            "type": "job",
254            "arrival": 1693387567,
255            "duration": 1583,
256            "service": 120,
257            "waiting_time": 2033,
258            "location": [
259              34.075525,
260              -118.361588
261            ],
262            "location_index": 2,
263            "id": 3,
264            "load": [
265              0
266            ]
267          },
268          {
269            "type": "pickup",
270            "arrival": 1693389978,
271            "duration": 1841,
272            "service": 120,
273            "waiting_time": 5022,
274            "location": [
275              34.076646,
276              -118.376969
277            ],
278            "location_index": 10,
279            "id": 1,
280            "load": [
281              2
282            ],
283            "description": "Shipment Pickup 1"
284          },
285          {
286            "type": "delivery",
287            "arrival": 1693396078,
288            "duration": 2799,
289            "service": 120,
290            "waiting_time": 1622,
291            "location": [
292              34.094986,
293              -118.300885
294            ],
295            "location_index": 11,
296            "id": 1,
297            "load": [
298              0
299            ],
300            "description": "Shipment Delivery 1"
301          },
302          {
303            "type": "job",
304            "arrival": 1693399010,
305            "duration": 3989,
306            "service": 120,
307            "waiting_time": 6790,
308            "location": [
309              34.000895,
310              -118.204929
311            ],
312            "location_index": 9,
313            "id": 10,
314            "load": [
315              0
316            ]
317          },
318          {
319            "type": "end",
320            "arrival": 1693405920,
321            "duration": 3989,
322            "service": 0,
323            "waiting_time": 0,
324            "location": [
325              34.000895,
326              -118.204929
327            ],
328            "location_index": 9,
329            "load": [
330              0
331            ]
332          }
333        ],
334        "service": 600,
335        "duration": 3989,
336        "waiting_time": 15467,
337        "priority": 0,
338        "delivery": [
339          2
340        ],
341        "pickup": [
342          2
343        ],
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g@jB`AlGdDj@VRm@Pe@Nc@Vw@h@}ARm@Rg@nAuDNFTNn@`@^Tj@VNHJFXNZNZPj@ZPH~@f@hAj@lAl@jAl@X@X?J?Z?ZAP?h@Ah@AZAXCHAHCLEPGPIXMr@_@b@S~Au@ZOPINGPKRMHEHGJIFKHKN[JUJQBGHMBGFOFIHKLKTMLGL@RANAHAT?n@?j@AHALANCXEHCNETINKrAo@XMn@Sl@SXIxBm@dA]HEv@]fAm@ZSXUXSRQX[z@y@d@a@TQZSVO\\ONEj@Qb@I@?VCNCH?b@C~@A^Al@Ar@CFAHAHIfAAhAAjBA\\?T?PAd@?d@Ap@?dCAZAh@?PAxA?T?f@?fCC\\?fAAf@A^?dFEL?lAAP?z@A@\\@b@?@@pA?`@@|A?R?b@?\\@rA@TmBB[?A?e@ACA?AEaDCuA?K?kCBGHGPAVK??"
346      },
347      {
348        "vehicle": 3,
349        "cost": 7548,
350        "steps": [
351          {
352            "type": "start",
353            "arrival": 1693396392,
354            "duration": 0,
355            "service": 0,
356            "waiting_time": 0,
357            "location": [
358              33.940407,
359              -118.265196
360            ],
361            "location_index": 18,
362            "load": [
363              0
364            ]
365          },
366          {
367            "type": "job",
368            "arrival": 1693397700,
369            "duration": 1308,
370            "service": 120,
371            "waiting_time": 0,
372            "location": [
373              34.037925,
374              -118.459842
375            ],
376            "location_index": 5,
377            "id": 6,
378            "load": [
379              0
380            ]
381          },
382          {
383            "type": "job",
384            "arrival": 1693398290,
385            "duration": 1778,
386            "service": 120,
387            "waiting_time": 310,
388            "location": [
389              34.004364,
390              -118.42117
391            ],
392            "location_index": 6,
393            "id": 7,
394            "load": [
395              0
396            ]
397          },
398          {
399            "type": "pickup",
400            "arrival": 1693399596,
401            "duration": 2654,
402            "service": 120,
403            "waiting_time": 0,
404            "location": [
405              34.01878,
406              -118.317919
407            ],
408            "location_index": 12,
409            "id": 2,
410            "load": [
411              2
412            ],
413            "description": "Shipment Pickup 2"
414          },
415          {
416            "type": "job",
417            "arrival": 1693399918,
418            "duration": 2856,
419            "service": 150,
420            "waiting_time": 1382,
421            "location": [
422              34.000215,
423              -118.318803
424            ],
425            "location_index": 7,
426            "id": 8,
427            "load": [
428              2
429            ]
430          },
431          {
432            "type": "delivery",
433            "arrival": 1693402142,
434            "duration": 3548,
435            "service": 120,
436            "waiting_time": 58,
437            "location": [
438              33.996658,
439              -118.261708
440            ],
441            "location_index": 13,
442            "id": 2,
443            "load": [
444              0
445            ],
446            "description": "Shipment Delivery 2"
447          },
448          {
449            "type": "end",
450            "arrival": 1693402320,
451            "duration": 3548,
452            "service": 0,
453            "waiting_time": 0,
454            "location": [
455              33.996658,
456              -118.261708
457            ],
458            "location_index": 13,
459            "load": [
460              0
461            ]
462          }
463        ],
464        "service": 630,
465        "duration": 3548,
466        "waiting_time": 1750,
467        "priority": 0,
468        "delivery": [
469          2
470        ],
471        "pickup": [
472          2
473        ],
474        "distance": 60342.2,
475        "geometry": "q~cnEftypUr@?hD@xA?h@?X?PAJ?N?h@?^?dB?X?lA?rA?|C?x@?nB?jA?X?jA@`A@B?zBAbB?`@?ZAf@?b@?R@d@?^?d@?L?@kB?W?k@?c@?w@?y@@mEAiA@cADeF?m@@yA@yE?G?IBO@OBINk@JSJSf@s@~@qAf@q@b@m@d@s@BGDIBG@GDO@M@GD[?M?G@g@@qD?[?W?M?_A?K?KL?J?d@?P?L?N?T?l@?@N@NDT@JBRBTDR@TJp@Df@DZD\\@NBTBL@PDTN`ADZF^BRBVHZF\\Jl@PfABv@Bx@HrD@|A?dD?vA?n@?n@?bB?v@A~B?rA?rA?jA?pD?H?fFAzH@bFAtACdAA|@Ch@Cb@GnAIjAEd@AVCPa@|DAFAHWrBKbAE^]nCQrAUzBCVKpAM|AIdBElAGnBA^CzB@lA?x@@nAAN?\\?`@?f@?J?P?`@?l@?R?f@@~@AV?b@?N?f@?Z@L?J?N?L?hF?jBBjL@pA?H?zD?hA?fC?`@?r@@`@?ZAlBAdE?t@?t@?R?bC?xA@`ABhABdABl@B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LA{H@sB?oB@}H?eB@gB@k@?eA?eB?Sv@?^??i@?_A?K?iGAcFA_CAgC?uCGyS?q@?U?_A?eAA]BYCgC?O?y@?MAG?I?S@i@?_@?gG?_@?u@?Y?k@?a@?O?a@?uB?[?k@?wK?s@?e@A]?w@?w@?g@?e@?_@AmBAiBAaI?_@?y@?U?y@?EAI?A?iDA_BA_BC_H?i@?S?W?_A@gA?o@AMAwP??"
476      }
477    ]
478  },
479  "status": "Ok",
480  "message": ""
481}

Following is a visual representation of the initial locations of tasks, vehicles and the routes suggested after optimization as per the given constraints.

Analyzing the Solution

Looking at the result we can observe some interesting insights:

  1. summary section:

    1. We get an overview of the overall result with a total distance of 141270 meters covered within a total duration of 10502 seconds (~ 3 hrs) to complete all the assigned tasks.

    2. Optimizer was able to assign all tasks using 4 routes with a total cost of 21899. This cost is in seconds as we did not explicitly specify any travel_cost, so the solver went with the default setting of duration.

    3. Other fields in summary provide details about total service time of all the assigned tasks, total waiting_time for the assigned tasks among other details.

  2. routes section:

    1. It can be observed that the max_tasks constraint for all vehicles has been successfully implemented in the solution - vehicle 1 is taking care of jobs 2, 4 and 5; vehicle 2 is assigned to shipment 1 and jobs 1,3 and 10; vehicle 3 is assigned to jobs 6, 7, 8 along with shipment 2; and lastly, vehicle 4 is assigned to job 9 and shipment 3.

    2. In our example, the cost is calculated using the default metric - duration. Therefore, all costs in the solution are in seconds. Let’s take a look at the costs for each vehicle:

      1. Vehicle 1: This vehicle was configured for both fixed and per_hour type of cost. When used, this vehicle incurs a cost of 1000 seconds along with additional 5400 seconds for every hour of operation. The total duration for which this vehicle operates is 794 seconds (~14 mins) and hence the per_hour cost for this vehicle comes out to be 1191 seconds. The total cost of the route, 2191 seconds, is then calculated by adding per_hour cost to the fixed cost of using the vehicle. Overall cost incurred for this vehicle is less than 5000 seconds, as specified by the max_travel_cost constraint.

      2. Vehicle 2: This vehicle was configured for both fixed and per_hour type of cost. When used, this vehicle incurs a cost of 3000 seconds along with additional 3600 seconds for every hour of operation. The total duration for which this vehicle operates is 3989 seconds (~72 mins) and hence the per_hour cost for this vehicle comes out to be 3989 seconds. The total cost of the route, 6989 seconds, is then calculated by adding per_hour cost to the fixed cost of using the vehicle. It looks like that this vehicle did not adhere to the max_travel_cost constraint and incurred a total cost of more than 5000 seconds. But, it is important to note that max_travel_cost does not consider fixed cost in its calculations. The max_travel_cost applies to the travel_cost only, which in this case is the per_hour cost of 3989 seconds, which is well within the given cap of 5000 seconds.

      3. Vehicle 3: This vehicle was configured for fixed cost considerations only. When used, this vehicle incurs a cost of 4000 seconds. The total duration that this vehicle operates for is 3548 seconds (~1 hr). The total cost for this vehicle is the sum of fixed cost and travel_cost, which comes out to be 7548 seconds. Similar to vehicle 2, the total cost for this vehicle also exceeds the given cap of 5000 seconds, but that can be attributed to the higher fixed cost. The travel_cost incurred is 3548 seconds only.

      4. Vehicle 4: This vehicle was also configured for fixed cost considerations only. When used, this vehicle incurs a cost of 3000 seconds. The total duration that this vehicle operates for is 2171 seconds (~36 mins). The total cost for this vehicle is the sum of fixed cost and travel_cost, which comes out to be 5171 seconds. Similar to vehicle 2 and 3, the total cost for this vehicle also exceeds the given cap of 5000 seconds, but that can be attributed to the higher fixed cost. The travel_cost incurred is 2171 seconds only.

      5. It is recommended to also refer to the Vehicle Costs example to understand more about cost calculations.

    3. The total cost of solution, 21899 seconds, is arrived by adding up the costs of each individual route.

As demonstrated, NextBillion.ai’s Route Optimization V2 works within the provided constraints and suggests the best solution within those constraints. We encourage you to try out different configurations of vehicle or task locations, time window constraints, skills, number of tasks and explore how different routes, task distributions are returned when different scenarios are presented to Route Optimization V2 API.

We hope this example was helpful. Check out some more use cases that Route Optimization V2 can handle for you!

DIDN'T FIND WHAT YOU LOOKING FOR?