# Solution

The Solution entity represents the Vehicle Routing Problem solution which consists of three major parts: statistic, tours, and unassigned jobs.

## Statistic

Statistic represents the statistic of one or multiple tours and consists of the following properties:

• cost: total cost in abstract units rounded to three decimal places

"cost": 54.459

• distance: total driven distance in meters

"distance": 35277

• duration: total duration in seconds

duration": 5286

• times: times spent for driving, serving jobs, waiting for time window start, and break

  {
"times": {
"driving": 5106,
"serving": 180,
"waiting": 0,
"break": 0
}
}


The duration property in a solution's statistic represents the total sum of all tour durations for that specific solution.

## List of tours

Each item of the tour list provides detailed information about the used vehicle and the assigned jobs.

• typeId: specifies vehicle type id

"typeId": "myVehicle"

• vehicleId: specifies concrete id of the used vehicle. It consists of typeId and a sequential number separated by underscore

vehicleId": "myVehicle_1"

• stops: specifies the list of stops

• statistic: specifies tour statistic

### Stop

Stop specifies the list of activities performed at a specific time, at a specific place. It consists of the following properties:

• location: stop location represented via latitude/longitude

"location": {"lat": 52.52568, "lng": 13.45345}

• time: specifies expected arrival and departure time at/from stop

  {
"time": {
"arrival": "2020-07-04T09:19:01Z",
"departure": "2020-07-04T09:19:01Z"
}
}


"load": [1]

• activities: specifies list of activities to be performed at the stop

### Activity

In general, activity specifies a planned task to be performed at a specific location and time. It consists of the following properties:

• jobId: id of the job or marker (e.g. break, departure or arrival)

jobId": "myJob"

• type: specifies the activity type. It can be one of the following values: departure, arrival, break, pickup, delivery

"type": "delivery"

• jobTag (optional): a user defined value specified on the corresponding job place

"jobTag": "place 1"

• location (optional): the activity location represented via latitude/longitude. Omitted when it is the same as the one defined at the parent stop

"location": {"lat": 52.52568, "lng": 13.45345}

• time (optional) : specifies expected start/stop time. Omitted if there is only one activity in the stop

## List of unassigned jobs

The optional unassigned job list is populated with jobs which cannot be assigned due to specific constraints. Each item consists of a job id and possible unassignment reasons:

{
"unassigned": [
{
"jobId": "myJob",
"reasons": [
{
"code": "MAX_DISTANCE_CONSTRAINT",
"description": "cannot be assigned due to max distance constraint of vehicle"
}
]
}
]
}


# Example

{
"statistic": {
"cost": 54.459916,
"distance": 35277,
"duration": 5286,
"times": {
"driving": 5106,
"serving": 180,
"waiting": 0,
"break": 0
}
},
"tours": [
{
"vehicleId": "myVehicle_1",
"typeId": "myVehicle",
"stops": [
{
"location": {"lat": 52.52568, "lng": 13.45345},
"time": {
"arrival": "2020-07-04T09:19:01Z",
"departure": "2020-07-04T09:19:01Z"
},
"activities": [
{
"jobId": "departure",
"type": "departure"
}
]
},
{
"location": {"lat": 52.46642, "lng": 13.28124},
"time": {
"arrival": "2020-07-04T10:00:00Z",
"departure": "2020-07-04T10:03:00Z"
},
"activities": [
{
"jobId": "myJob",
"type": "delivery"
}
]
},
{
"location": {"lat": 52.52568, "lng": 13.45345},
"time": {
"arrival": "2020-07-04T10:47:07Z",
"departure": "2020-07-04T10:47:07Z"
},
"activities": [
{
"jobId": "arrival",
"type": "arrival"
}
]
}
],
"statistic": {
"cost": 54.459916,
"distance": 35277,
"duration": 5286,
"times": {
"driving": 5106,
"serving": 180,
"waiting": 0,
"break": 0
}
}
}
]
}