# Output

The output is a route solution - an assignment of **visits** (stops) to **fleet** objects (drivers). It essentially produces a schedule for each driver, giving him the order in which he should visit his stops (so as to be as efficient as possible while respecting time windows, capacity constraints etc)  and the estimated arrival time at each location. Below is the output for job `141df046-2bb7-4a3c-93a5-1253274673a5` that was used as an example in the [quickstart](/afi-routing-engine/-LtOZ1a-Ritq-iWagVx-/vrp-endpoint/quickstart.md) section.

{% code title="JSON" %}

```javascript
{
	"id": "141df046-2bb7-4a3c-93a5-1253274673a5",
	"status": "finished",
	"input": {
		"visits": {
			"ABC-123": {
				"location": {
					"name": "Brassneck Brewery",
					"lat": 49.2657714,
					"lng": -123.1017201,
					"id": "ABC-123"
				},
				"start": "18:00",
				"end": "19:00",
				"duration": 30,
				"load": 1
			},
			"DEF-456": {
				"location": {
					"name": "Zakkushi on Denman",
					"lat": 49.2912,
					"lng": -123.1384817,
					"id": "DEF-456"
				},
				"start": "18:00",
				"end": "20:00",
				"duration": 45,
				"load": 1
			},
			"GHI-789": {
				"location": {
					"name": "Granville Island Brewing",
					"lat": 49.2709294,
					"lng": -123.13623,
					"id": "GHI-789"
				},
				"start": "20:00",
				"end": "21:00",
				"duration": 15,
				"load": 1
			}
		},
		"fleet": {
			"vehicle_1": {
				"start_location": {
					"id": "driver_start",
					"name": "Killarney, East Vancouver",
					"lat": 49.2287301,
					"lng": -123.0421047
				},
				"end_location": {
					"id": "driver_end",
					"name": "VanDusen Botanical Gardens",
					"lat": 49.2385564,
					"lng": -123.1309102
				},
				"shift_start": "17:00",
				"shift_end": "23:00",
				"capacity": 10
			}
		},
		"options": {
			"polylines": true
		}
	},
	"output": {
		"status": "completed",
		"fitness": 0,
		"unserved": [],
		"solution": {
			"vehicle_1": [{
				"location_id": "driver_start",
				"location_name": "Killarney, East Vancouver",
				"arrival_time": "17:00",
				"finish_time": "17:59",
				"distance": 0
			}, {
				"location_id": "ABC-123",
				"location_name": "Brassneck Brewery",
				"arrival_time": "17:59",
				"finish_time": "18:29",
				"distance": 5976,
				"duration": 30,
				"travel_mins": 11.96,
				"waiting_mins": 48.04,
				"working_mins": 41.96
			}, {
				"location_id": "DEF-456",
				"location_name": "Zakkushi on Denman",
				"arrival_time": "18:37",
				"finish_time": "19:22",
				"distance": 3888,
				"duration": 45,
				"travel_mins": 7.78,
				"waiting_mins": 0,
				"working_mins": 52.78
			}, {
				"location_id": "GHI-789",
				"location_name": "Granville Island Brewing",
				"arrival_time": "20:00",
				"finish_time": "20:15",
				"distance": 2261,
				"duration": 15,
				"travel_mins": 4.52,
				"waiting_mins": 32.7,
				"working_mins": 19.52
			}, {
				"location_id": "driver_end",
				"location_name": "VanDusen Botanical Gardens",
				"arrival_time": "20:15",
				"distance": 0
			}]
		},
		"polylines": {
			"vehicle_1": ["i_nkHft~mV@h@OJgA@ApCub@KUEs@WeBeBUYa@pKSnCUdBQz@_C~Ig@~AiJpWwBtF}GxRyCbIiH~SqJvVy@hC_CxGeM`]wBlGsEzNoAtCyBtEi@pAwTlm@cDbJ{ElM_BvEYjAMx@c@dEU`A]`AcFnKmBvDmB`CwJxJoDfD}CdCyArAGLw@n@gEGSNA~Cq@Ap@@@_D}OSMO{N]s@OmB{@q@Wm@GsCGSnCO~DqBG{@@o@DiLjB_AVs@h@k@n@g@t@e@bAe@nBSxAy@dJMt@Or@Sn@q@|ASp@eNMaAzJWfBSRUh@I\\cAbB}BbE{BdE_QvZ{BxDiBzIWfAmDrQ{BvLmErTcBtHpA|BwKvRbJvOoDdGnDeGzIlOxGnLb~@y`BrEdIrAtBDVrAzBDPpGhKPd@zU`b@PJVd@z@lAt@v@x@h@jAh@LJ\\HvCThABb@RNTL\\F^@b@A`@G`@MZOVSNWHU?UIUOOUM]McA@_GS?gBZkAFu@c@c@Yw@_AuCqEy@uAhBwDaE{F_DnEHd@NN\\H@nCvACp@Rr@Bx@tAtCpEv@~@Vv@Zh@XZRCRKp@Qj@YlAUDeBBa@R_Af@cAZWf@}@^a@h@EJMfBBLKbr@z@BqHD}AFgAPkA|@uDzBoGTe@bBuBxAsApCeBVW`@m@ZuATkAJgADqCtD@tDJvWZ^NdA@f@IdIJdJ?fENhX`@jJFElDe@AWKO?IDIJCLIdH@R"]
		},
		"num_unserved": 0,
		"total_distance": 12124.173638711542,
		"total_distance_miles": 7.533612225901168,
		"total_travel_time": 1455.4830298573215,
		"total_cost": 12124.173638711542,
		"total_operation_time": 11700,
		"total_duration_time": 90,
		"summary": {
			"vehicle_1": {
				"distance": 12125,
				"travel_mins": 24.26,
				"waiting_mins": 80.74,
				"working_mins": 114.26,
				"working_percentage": 31.74,
				"visits": 3,
				"service_mins": 90
			}
		},
		"report": {
			"distance": 12125,
			"travel_mins": 24.26,
			"waiting_mins": 80.74,
			"working_mins": 114.26,
			"working_percentage": 31.74,
			"visits": 3,
			"service_mins": 90
		}
	},
	"fleet": 1,
	"visits": 3,
	"started_at": "2022-08-14T05:24:43.941Z",
	"finished_at": "2022-08-14T05:24:43.957Z",
	"type": "VRP",
	"network": {
		"driver_start": {
			"id": "driver_start",
			"name": "Killarney, East Vancouver",
			"lat": 49.2287301,
			"lng": -123.0421047
		},
		"driver_end": {
			"id": "driver_end",
			"name": "VanDusen Botanical Gardens",
			"lat": 49.2385564,
			"lng": -123.1309102
		},
		"ABC-123": {
			"name": "Brassneck Brewery",
			"lat": 49.2657714,
			"lng": -123.1017201,
			"id": "ABC-123"
		},
		"DEF-456": {
			"name": "Zakkushi on Denman",
			"lat": 49.2912,
			"lng": -123.1384817,
			"id": "DEF-456"
		},
		"GHI-789": {
			"name": "Granville Island Brewing",
			"lat": 49.2709294,
			"lng": -123.13623,
			"id": "GHI-789"
		}
	},
	"processing_time": "0.004"
}
```

{% endcode %}

| **Property** | **Type** | **Notes**                                                                                                                                                                                             |
| ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id           | String   | The `id` of the optimization job.                                                                                                                                                                     |
| status       | String   | When the optimization is first run, it will have the status of `pending`. When it is complete, it will show `finished`.                                                                               |
| input        | Object   | The raw json object that was sent as `input` for the optimization job.                                                                                                                                |
| output       | Object   | The `output` contains a `solution` object with the optimized schedule, where the keys reference the vehicle IDs and the values are ordered arrays of visits (and estimated arrival and finish times). |
| fleet        | Number   | The number of fleet objects in the route solution.                                                                                                                                                    |
| visits       | Number   | The number of visit objects in the route solution.                                                                                                                                                    |
| started\_at  | String   | The time in [ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601) that the optimization request was received by the server.                                                                        |
| finished\_at | String   | The time in [ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601) that a route solution was produced.                                                                                              |

When there are too many visits — or the time windows are too tight — and the fleet cannot possibly visit all locations, some visits will be unserved. We will return both those visit IDs in `unserved` as follows in the API response:

{% code title="JSON" %}

```javascript
{
	"unserved": [
		"order_2"
	]
}

```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://afi-labs.gitbook.io/afi-routing-engine/-LtOZ1a-Ritq-iWagVx-/vrp-endpoint/output.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
