Vehicle: Max Travel Cost and Max Tasks
In this example we will learn about some useful vehicle constraints. NextBillion.ai’s Route Optimization Flexible API 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:
-
A unique identifier for each task
-
Location indexes for each task
-
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 Flexible API can handle complex task schedules as well.
-
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.
-
Pick-up and delivery quantities for
shipments
andjobs
. Since we are adding capacities for thevehicles
, we are adding quantities for jobs aspickup=[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 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
{ "jobs": [ { "id": 1, "location_index": 0, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693386000, 1693386900 ] ] }, { "id": 2, "location_index": 1, "service": 180, "pickup": [ 0 ], "time_windows": [ [ 1693387800, 1693388700 ] ] }, { "id": 3, "location_index": 2, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693389600, 1693390500 ] ] }, { "id": 4, "location_index": 3, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693391400, 1693392300 ] ] }, { "id": 5, "location_index": 4, "service": 60, "pickup": [ 0 ], "time_windows": [ [ 1693393200, 1693394100 ] ] }, { "id": 6, "location_index": 5, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693396800, 1693397700 ] ] }, { "id": 7, "location_index": 6, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693398600, 1693399500 ] ] }, { "id": 8, "location_index": 7, "service": 150, "pickup": [ 0 ], "time_windows": [ [ 1693401300, 1693402200 ] ] }, { "id": 9, "location_index": 8, "service": 80, "pickup": [ 0 ], "time_windows": [ [ 1693404000, 1693404900 ] ] }, { "id": 10, "location_index": 9, "service": 120, "pickup": [ 0 ], "time_windows": [ [ 1693405800, 1693406700 ] ] } ], "shipments": [ { "pickup": { "description": "Shipment Pickup 1", "id": 1, "location_index": 10, "service": 120, "time_windows": [ [ 1693395000, 1693395900 ] ] }, "delivery": { "description": "Shipment Delivery 1", "id": 1, "location_index": 11, "service": 120, "time_windows": [ [ 1693397700, 1693398600 ] ] }, "amount": [ 2 ] }, { "pickup": { "description": "Shipment Pickup 2", "id": 2, "location_index": 12, "service": 120, "time_windows": [ [ 1693399500, 1693400400 ] ] }, "delivery": { "description": "Shipment Delivery 2", "id": 2, "location_index": 13, "service": 120, "time_windows": [ [ 1693402200, 1693403100 ] ] }, "amount": [ 2 ] }, { "pickup": { "description": "Shipment Pickup 3", "id": 3, "location_index": 14, "service": 120, "time_windows": [ [ 1693400400, 1693401300 ] ] }, "delivery": { "description": "Shipment Delivery 3", "id": 3, "location_index": 15, "service": 120, "time_windows": [ [ 1693407600, 1693408500 ] ] }, "amount": [ 2 ] } ] }
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:
-
A unique ID for each vehicle
-
Vehicle shift time or the time window
-
Capacity to denote the amount of load that the vehicle can take
-
Start_index to denote the point from where the vehicle would start.
-
Costs for all vehicles. We have specified
fixed
cost for all vehicles andper_hour
cost for two of the vehicles.-
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 -
cost here is in seconds, as we are not explicitly mentioning any
travel_cost
settings. Therefore, the solver goes with the default setting ofduration
for cost. -
the max_travel_cost applies only to the “traveling” cost of the vehicle. Individual vehicle’s costs -
per_hour
orfixed
- are outside the scope of this constraint. Therefore, the final cost may turn out to be more than that specified formax_travel_cost
. We are covering such a case in this example. Please refer to Analyzing the Solution section.
-
-
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 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
{ "vehicles": [ { "id": 1, "start_index": 16, "capacity": [ 20 ], "costs": { "fixed": 1000, "per_hour": 5400 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 2, "start_index": 17, "capacity": [ 20 ], "costs": { "fixed": 3000, "per_hour": 3600 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 3, "start_index": 18, "capacity": [ 20 ], "costs": { "fixed": 4000 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 4, "capacity": [ 20 ], "start_index": 19, "costs": { "fixed": 3000 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 } ] }
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 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
{ "locations": { "id": 1, "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" ] } }
Optimization POST Request
Now let’s put all these components together and create the final POST request that we will submit to the optimizer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
curl --location 'https://api.nextbillion.io/optimization/v2?key=<your_api_key>' \ --header 'Content-Type: application/json' \ --data '{ "description": "Vehicle MaxTravelCost & MaxTask Example", "jobs": [ { "id": 1, "location_index":0, "service": 120, "pickup":[0], "time_windows": [ [ 1693386000, 1693386900 ] ] }, { "id": 2, "location_index": 1, "service": 180, "pickup":[0], "time_windows": [ [ 1693387800, 1693388700 ] ] }, { "id": 3, "location_index": 2, "service": 120, "pickup":[0], "time_windows": [ [ 1693389600, 1693390500 ] ] }, { "id": 4, "location_index": 3, "service": 120, "pickup":[0], "time_windows": [ [ 1693391400, 1693392300 ] ] }, { "id": 5, "location_index": 4, "service": 60, "pickup":[0], "time_windows": [ [ 1693393200, 1693394100 ] ] }, { "id": 6, "location_index": 5, "service": 120, "pickup":[0], "time_windows": [ [ 1693396800, 1693397700 ] ] }, { "id": 7, "location_index": 6, "service": 120, "pickup":[0], "time_windows": [ [ 1693398600, 1693399500 ] ] }, { "id": 8, "location_index": 7, "service": 150, "pickup":[0], "time_windows": [ [ 1693401300, 1693402200 ] ] }, { "id": 9, "location_index": 8, "service": 80, "pickup":[0], "time_windows": [ [ 1693404000, 1693404900 ] ] }, { "id": 10, "location_index": 9, "service": 120, "pickup":[0], "time_windows": [ [ 1693405800, 1693406700 ] ] } ], "shipments": [ { "pickup":{ "description": "Shipment Pickup 1", "id":1, "location_index":10, "service":120, "time_windows":[[1693395000,1693395900]] }, "delivery":{ "description": "Shipment Delivery 1", "id":1, "location_index":11, "service":120, "time_windows":[[1693397700,1693398600]] }, "amount":[2] }, { "pickup":{ "description": "Shipment Pickup 2", "id":2, "location_index":12, "service":120, "time_windows":[[1693399500,1693400400]] }, "delivery":{ "description": "Shipment Delivery 2", "id":2, "location_index":13, "service":120, "time_windows":[[1693402200,1693403100]] }, "amount":[2] }, { "pickup":{ "description": "Shipment Pickup 3", "id":3, "location_index":14, "service":120, "time_windows":[[1693400400,1693401300]] }, "delivery":{ "description": "Shipment Delivery 3", "id":3, "location_index":15, "service":120, "time_windows":[[1693407600,1693408500]] }, "amount":[2] } ], "vehicles": [ { "id": 1, "start_index": 16, "capacity":[20], "costs":{ "fixed":1000, "per_hour":5400 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 2, "start_index": 17, "capacity":[20], "costs":{ "fixed":3000, "per_hour": 3600 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 3, "start_index": 18, "capacity":[20], "costs":{ "fixed":4000 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 }, { "id": 4, "capacity":[20], "start_index": 19, "costs":{ "fixed":3000 }, "time_window": [ 1693382400, 1693418400 ], "max_tasks": 5, "max_travel_cost": 5000 } ], "locations": { "id": 1, "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"] } } '
Optimization POST Response
Once the request is made, we get a unique ID in the API response:
1 2 3 4 5
{ "id": "96ba15bf2ef178053929bedd3b0f7d56", "message": "Optimization job created", "status": "Ok" }
Optimization GET Request
We take the ID and use the Optimization GET request to retrieve the result. Here is the GET request:
1 2
curl --location 'https://api.nextbillion.io/optimization/v2/result?id=96ba15bf2ef178053929bedd3b0f7d56 &key=<your_api_key>'
Optimization GET Response
Following is the optimized route plan:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
{ "description": "Vehicle MaxTravelCost & MaxTask Example", "result": { "code": 0, "summary": { "cost": 21899, "routes": 4, "unassigned": 0, "setup": 0, "service": 1910, "duration": 10502, "waiting_time": 25569, "priority": 0, "delivery": [ 6 ], "pickup": [ 6 ], "distance": 141270.5 }, "routes": [ { "vehicle": 1, "cost": 2191, "steps": [ { "type": "start", "arrival": 1693388364, "duration": 0, "service": 0, "waiting_time": 0, "location": [ 34.057106, -118.361326 ], "location_index": 16, "load": [ 0 ] }, { "type": "job", "arrival": 1693388700, "duration": 336, "service": 180, "waiting_time": 0, "location": [ 34.054927, -118.323726 ], "location_index": 1, "id": 2, "load": [ 0 ] }, { "type": "job", "arrival": 1693389206, "duration": 662, "service": 120, "waiting_time": 2194, "location": [ 34.07635, -118.338519 ], "location_index": 3, "id": 4, "load": [ 0 ] }, { "type": "job", "arrival": 1693391652, "duration": 794, "service": 60, "waiting_time": 1548, "location": [ 34.090425, -118.338933 ], "location_index": 4, "id": 5, "load": [ 0 ] }, { "type": "end", "arrival": 1693393260, "duration": 794, "service": 0, "waiting_time": 0, "location": [ 34.090425, -118.338933 ], "location_index": 4, "load": [ 0 ] } ], "service": 360, "duration": 794, "waiting_time": 3742, "priority": 0, "delivery": [ 0 ], "pickup": [ 0 ], "distance": 8868.1, "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???" }, { "vehicle": 4, "cost": 5171, "steps": [ { "type": "start", "arrival": 1693400619, "duration": 0, "service": 0, "waiting_time": 0, "location": [ 33.97406, -118.246945 ], "location_index": 19, "load": [ 0 ] }, { "type": "pickup", "arrival": 1693401300, "duration": 681, "service": 120, "waiting_time": 0, "location": [ 33.916595, -118.240132 ], "location_index": 14, "id": 3, "load": [ 2 ], "description": "Shipment Pickup 3" }, { "type": "job", "arrival": 1693402236, "duration": 1497, "service": 80, "waiting_time": 1764, "location": [ 33.945884, -118.325628 ], "location_index": 8, "id": 9, "load": [ 2 ] }, { "type": "delivery", "arrival": 1693404754, "duration": 2171, "service": 120, "waiting_time": 2846, "location": [ 33.946275, -118.385486 ], "location_index": 15, "id": 3, "load": [ 0 ], "description": "Shipment Delivery 3" }, { "type": "end", "arrival": 1693407720, "duration": 2171, "service": 0, "waiting_time": 0, "location": [ 33.946275, -118.385486 ], "location_index": 15, "load": [ 0 ] } ], "service": 320, "duration": 2171, "waiting_time": 4610, "priority": 0, "delivery": [ 2 ], "pickup": [ 2 ], "distance": 24304.5, "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@@x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Z?PAJAP?HEl@Gr@?RAH?^Al@?p@?L?X?nB@bB?tA?\\?zA?rB?r@?^?jB?fD?P?|B?F?X?T?r@?L@fB?v@c@AgAA?aAz@?BA@A?E@uCc@?Y?C?ABA@@hB??" }, { "vehicle": 2, "cost": 6989, "steps": [ { "type": "start", "arrival": 1693385864, "duration": 0, "service": 0, "waiting_time": 0, "location": [ 34.016137, -118.253523 ], "location_index": 17, "load": [ 0 ] }, { "type": "job", "arrival": 1693386900, "duration": 1036, "service": 120, "waiting_time": 0, "location": [ 34.08395, -118.31864 ], "location_index": 0, "id": 1, "load": [ 0 ] }, { "type": "job", "arrival": 1693387567, "duration": 1583, "service": 120, "waiting_time": 2033, "location": [ 34.075525, -118.361588 ], "location_index": 2, "id": 3, "load": [ 0 ] }, { "type": "pickup", "arrival": 1693389978, "duration": 1841, "service": 120, "waiting_time": 5022, "location": [ 34.076646, -118.376969 ], "location_index": 10, "id": 1, "load": [ 2 ], "description": "Shipment Pickup 1" }, { "type": "delivery", "arrival": 1693396078, "duration": 2799, "service": 120, "waiting_time": 1622, "location": [ 34.094986, -118.300885 ], "location_index": 11, "id": 1, "load": [ 0 ], "description": "Shipment Delivery 1" }, { "type": "job", "arrival": 1693399010, "duration": 3989, "service": 120, "waiting_time": 6790, "location": [ 34.000895, -118.204929 ], "location_index": 9, "id": 10, "load": [ 0 ] }, { "type": "end", "arrival": 1693405920, "duration": 3989, "service": 0, "waiting_time": 0, "location": [ 34.000895, -118.204929 ], "location_index": 9, "load": [ 0 ] } ], "service": 600, "duration": 3989, "waiting_time": 15467, "priority": 0, "delivery": [ 2 ], "pickup": [ 2 ], "distance": 47755.7, "geometry": "uwrnEbkwpUSKkBcAoAq@aB_AeAk@a@SsA{@{A{@g@a@a@_@mAeAmAkAmAgAmAiAoAgAsAgAUS_BoAkAy@w@m@SOGE{BcBqAaAOKm@c@[Ww@m@GHc@h@IJIJOTs@pAuAdCINS^OZQXO\\_@bAEv@CNKf@Sz@GTMb@Y~@Wx@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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??" }, { "vehicle": 3, "cost": 7548, "steps": [ { "type": "start", "arrival": 1693396392, "duration": 0, "service": 0, "waiting_time": 0, "location": [ 33.940407, -118.265196 ], "location_index": 18, "load": [ 0 ] }, { "type": "job", "arrival": 1693397700, "duration": 1308, "service": 120, "waiting_time": 0, "location": [ 34.037925, -118.459842 ], "location_index": 5, "id": 6, "load": [ 0 ] }, { "type": "job", "arrival": 1693398290, "duration": 1778, "service": 120, "waiting_time": 310, "location": [ 34.004364, -118.42117 ], "location_index": 6, "id": 7, "load": [ 0 ] }, { "type": "pickup", "arrival": 1693399596, "duration": 2654, "service": 120, "waiting_time": 0, "location": [ 34.01878, -118.317919 ], "location_index": 12, "id": 2, "load": [ 2 ], "description": "Shipment Pickup 2" }, { "type": "job", "arrival": 1693399918, "duration": 2856, "service": 150, "waiting_time": 1382, "location": [ 34.000215, -118.318803 ], "location_index": 7, "id": 8, "load": [ 2 ] }, { "type": "delivery", "arrival": 1693402142, "duration": 3548, "service": 120, "waiting_time": 58, "location": [ 33.996658, -118.261708 ], "location_index": 13, "id": 2, "load": [ 0 ], "description": "Shipment Delivery 2" }, { "type": "end", "arrival": 1693402320, "duration": 3548, "service": 0, "waiting_time": 0, "location": [ 33.996658, -118.261708 ], "location_index": 13, "load": [ 0 ] } ], "service": 630, "duration": 3548, "waiting_time": 1750, "priority": 0, "delivery": [ 2 ], "pickup": [ 2 ], "distance": 60342.2, "geometry": "q~cnEftypUr@?hD@xA?h@?X?PAJ?N?h@?^?dB?X?lA?r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KEsAEgBGcBEq@r@ANAH?XCJE~@?rA?T?dB?vAAP?jA?b@?rA?h@?p@?`C?pCAb@?T?R?j@?b@?L?l@?v@?lA?d@?|@?jB?dDA`@?z@?n@?h@?vAAf@?L?h@?j@?^?T?X?r@?n@?rB?h@AhA@nA?fE@R?fH@X?dA?bA?N?b@?J?L@F@F?HB??D@FDHBHFFD\\VTPJHFBDBHBFBJBLBPBH?B@N?@?l@?|@?pD?nJ?nRAj@?tA?Z?T?L?L?T?T?pB?v@?dA?zB?nB?tBAxB?hF?`B?\\?fB?^?r@?RAP?j@CLA^Cf@CNAlB?nF?P@zAAh@?B?lA@?`B?`@?a@?aBAgB@eB?_@?kAAY?e@?m@?[?qA?eA?e@?c@?iA?aAAk@@e@?gAA}I?g@?a@?y@AgG?U?e@?I?u@?U?[?e@?]@{D?yA?g@?k@?mH?i@?s@?g@?e@C}H?i@?e@?_H?g@AM?u@p@?V@R?TAfA?vA?z@?b@?f@?r@?rD??mLA{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??" } ] }, "status": "Ok", "message": "" }
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:
-
summary
section:-
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.
-
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 ofduration
. -
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.
-
-
routes
section:-
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.
-
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:-
Vehicle 1: This vehicle was configured for both
fixed
andper_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 theper_hour
cost for this vehicle comes out to be 1191 seconds. The total cost of the route, 2191 seconds, is then calculated by addingper_hour
cost to the fixed cost of using the vehicle. Overall cost incurred for this vehicle is less than 5000 seconds, as specified by themax_travel_cost
constraint. -
Vehicle 2: This vehicle was configured for both
fixed
andper_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 theper_hour
cost for this vehicle comes out to be 3989 seconds. The total cost of the route, 6989 seconds, is then calculated by addingper_hour
cost to the fixed cost of using the vehicle. It looks like that this vehicle did not adhere to themax_travel_cost
constraint and incurred a total cost of more than 5000 seconds. But, it is important to note thatmax_travel_cost
does not consider fixed cost in its calculations. Themax_travel_cost
applies to the travel_cost only, which in this case is theper_hour
cost of 3989 seconds, which is well within the given cap of 5000 seconds. -
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 offixed
cost andtravel_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. -
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 offixed
cost andtravel_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. -
It is recommended to also refer to the Vehicle Costs example to understand more about cost calculations.
-
-
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 Flexible API 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 Flexible API.
We hope this example was helpful. Check out some more use cases that Route Optimization Flexible API can handle for you!