Optimization

Optimized Trip (VRP)

Solves a capacitated vehicle routing problem (VROOM) for a fleet: multiple depots, multi-dimensional capacity, time windows, skills, priorities, per-vehicle costs, and pickup+delivery shipments. Travel times are straight-line haversine at 56 km/h.

POST
/api/optimized-trip

Solves a capacitated vehicle routing problem (VROOM) for a fleet: multiple depots, multi-dimensional capacity, time windows, skills, priorities, per-vehicle costs, and pickup+delivery shipments. Travel times are straight-line haversine at 56 km/h.

Query Parameters

apiKey*string

Your API key

Request Body

application/json
  1. body
vehicles*array<>

Fleet of vehicles. At least one required.

Items1 <= items
depots*array<>

Depot locations. At least one required.

Items1 <= items
customers?array<>

Delivery-only stops. At least one of customers or shipments is required.

shipments?array<>

Pickup-then-delivery pairs served by the same vehicle. At least one of customers or shipments is required.

Response Body

Raw VROOM output with sequenced routes and unassigned jobs.

application/json
  1. response
code?integer

0 = success.

summary?
routes?array<>
unassigned?array<>

Jobs/shipments that could not be assigned (capacity, skills, time windows, or vehicle limits).

curl -X POST 'https://mapapi.gebeta.app/api/optimized-trip?apiKey=token.token' \  -H 'Content-Type: application/json' \  -d '{  "vehicles": [    {      "name": "van-1",      "capacities": 10    }  ],  "depots": [    {      "id": "main",      "name": "Main depot",      "location": [        9.0108,        38.7613      ]    }  ],  "customers": [    {      "name": "cust-1",      "location": [        9.02,        38.77      ],      "demand": 3    },    {      "name": "cust-2",      "location": [        9.035,        38.75      ],      "demand": 4    }  ]}'
{  "code": 0,  "summary": {    "cost": 0,    "routes": 0,    "unassigned": 0,    "duration": 0,    "computing_times": {}  },  "routes": [    {      "vehicle": 0,      "cost": 0,      "duration": 0,      "steps": [        {          "type": "string",          "id": 0,          "arrival": 0,          "duration": 0,          "load": [            0          ]        }      ]    }  ],  "unassigned": [    {}  ]}