Quickstart
Vehicle Routing Problem (VRP)
Here’s an example JSON payload. When sent to the routing engine, these instructions will request the optimal route for a single vehicle, vehicle_1
, starting at Killarney, East Vancouver
and ending at VanDusen Botanical Gardens
that needs to visit locations ABC-123
, DEF-456
and GHI-789
in some order. The time windows, durations and location (latitude and longitude) of each visit are specified with the JSON object of each visit.
Create VRP Request
POST
https://routing-engine.afi.io/vrp-long
The vrp-long
endpoint finds an optimal assignment of visits to vehicles that minimizes the overall travel distance of the vehicle fleet while meeting constraints (capacities, time windows, shift times etc). This endpoint can solve both the Traveling Salesman (single vehicle) and Vehicle Routing (multiple vehicles) Problems.
Headers
access_token
string
YOUR_ACCESS_TOKEN
Content-Type
string
application/json
The /vrp-long
endpoint will trigger a long-running background task on our servers. This might take a while, so instead of returning the route solution immediately, the vrp-long
endpoint returns a job_id
:
which you can use to obtain the route solution when the background task is complete. To get the full route solution, use the job_id
and make a GET request to the following endpoint:
Retrieve route solution
GET
https://routing-engine.afi.io/jobs/141df046-2bb7-4a3c-93a5-1253274673a5
When the job is finished, the status is set to finished and the solution to the request is now in the output
object of the response. You can view the input, output, running time and error messages (if any) on the dashboard at https://dashboard.afi.io/requests. The dashboard also allows you to add or revoke API keys and generate an automated postman collection that you can use for testing.
The dashboard has a link (click the map icon on the right) to an interactive map based interface that you can use to explore your route solution in greater detail.
The map can also be accessed directly with this link: https://afi-viewer.herokuapp.com/jobs/141df046-2bb7-4a3c-93a5-1253274673a5?endpoint=https://routing-engine.afi.io. Both the dashboard and map interface come included with the out of the box installation of our routing engine and route optimization API (contact us for demo and pricing).
Last updated