The routing without constraints app is available in one modeling languages as a Mixed Integer Problem (MIP). You can also choose to make customizations to the model by instantiating the app first.
- OR-Tools
- Default solver:
SCIP
- Marketplace subscription app IDs
- Python:
nextmv-routing.ortools
- Python:
- Default solver:
Once you have the code locally, you can customize the model, run it locally and deploy it to Nextmv Platform.
Input
The input schema is a JSON payload defining the distance matrix, number of available vehicles, and the index of the depot for the unconstrained vehicle routing problem. Nextmv's tools are designed to operate directly on business data (in JSON
) to produce decisions that are actionable by software systems. This makes decisions more interpretable and easier to test. It also makes integration with data warehouses and business intelligence platforms significantly easier. An input contains the following components:
Field name | Required | Data type | SI Unit | Description | Example |
---|---|---|---|---|---|
distance_matrix | Yes | array of array of int | NA | A matrix of distances from each stop to each stop. | {"distance_matrix": [[1, 4], [7, 8]]} |
num_vehicles | Yes | int | NA | The number of available vehicles. | {"num_vehicles": 50} |
depot | Yes | int | NA | The index of the depot in the stops used to generate the distance_matrix. | {"depot": 0} |
Here you can find a sample .json
with the input schema:
Output
The output schema defines the solution to the routing without constraints problem in JSON
format. The output schema contains the following components.
Field name | Always present | Data type | SI Unit | Description | Example |
---|---|---|---|---|---|
solutions | Yes | array of solution | NA | Solutions to the routing problem. | {"solutions": []} |
statistics | Yes | statistics | NA | Summary statistics of the solution. | {"statistics": {"total_cost": 123}} |
Solution
Field name | Always present | Data type | SI Unit | Description | Example |
---|---|---|---|---|---|
vehicles | Yes | array of vehicle | NA | Solution to the unconstrained vehicle routing problem | See vehicle |
Vehicle
Field name | Always present | Data type | SI Unit | Description | Example |
---|---|---|---|---|---|
vehicle | Yes | int | NA | The vehicle number | {"vehicle": 0} |
distance | Yes | int | NA | The distance traveled by the vehicle | {"distance": 1712} |
stops | Yes | array of int | NA | The route of the vehicle (represented as indices of the stops used to generate the distance_matrix) | {"stops": [0, 3, 9]} |
Statistics
Field name | Always present | Data type | SI Unit | Description | Example |
---|---|---|---|---|---|
result | No | result | NA | Final result of the solutions. | See result |
run | Yes | run | NA | Information about the run. | See run |
schema | Yes | string | NA | Schema of the statistics. | {"schema": "v1"} |
Here you can find additional definitions used in the statistics
schema:
result
Field name Always present Data type SI Unit Description Example duration
Yes float
seconds
Time duration to get to the final result. {"duration": 0.123}
value
Yes float
NA Value of the final result. {"value": 0.123}
custom
Yes any
NA Custom solver metrics. See custom
run
Field name Always present Data type SI Unit Description Example duration
Yes float
seconds
Time duration of the run. {"duration": 0.123}
custom
Field name Always present Data type SI Unit Description Example constraints
Yes int
NA Number of constraints. {"constraints": 123}
provider
Yes string
NA Solver provider. {"provider": "highs"}
status
Yes string
NA Solver status. {"status": "optimal"}
variables
Yes int
NA Number of variables. {"variables": 123}
Run options
These are the default options that are available with routing without constraints.