Output from Solve Vehicle Routing Problem

Upon successful execution, the service returns the solution to the specified vehicle routing problem. The solution is composed of the output parameters described below.

out_stops

This provides information about stops made at depots, orders, and breaks. The information includes which routes make the stops, the arrival and departure times, and the stop sequence.

Note:

When the Populate Stop Shapes parameter is set to True, this parameter is a feature class;. otherwise, it is a table.

The parameter supports the following fields:

FieldDescription

Name

The name of the stop. The value of this field is the same as the Name field from the input orders, depots, or breaks. You can use the StopType field to determine whether the Name field value refers to a depot, an order, or a break.

StopType

Specifies whether the stop represents a depot, an order, or a break. The field value is an integer that can be interpreted in the following ways:

  • 0—The stop is an order.
  • 1—The stop is a depot.
  • 2—The stop is a break.

PickupQuantities

The amount of cargo or number of people to be picked up from a stop. If multiple dimensions are to be picked up from a stop, each quantity is separated by a space.

The units for the value of this field aren't stored. Interpret the units according to the way you specified the Capacities field on the input routes and the PickupQuantities and DeliveryQuantities fields on the input orders.

DeliveryQuantities

The amount of cargo or number of people to be delivered to a stop. If multiple dimensions are delivered to a stop, each quantity is separated by a space.

The units for the value of this field aren't stored. Interpret the units according to the way you specified the Capacities field on the input routes and the PickupQuantities and DeliveryQuantities fields on the input orders.

RouteName

The name of the route to which the stop is assigned.

Sequence

The relative sequence the assigned route visits the stop.

FromPrevTravelTime

The elapsed travel time from the previous stop to the current stop.

The value is in the units specified by the Time Units parameter.

FromPrevDistance

The distance along the route from the previous stop to the current stop.

The value is in the units specified by the Distance Units parameter.

ArriveCurbApproach

The side of the vehicle the curb is on when arriving at the stop. A value of 1 means the right side of the vehicle; a value of 2 means the left side.

DepartCurbApproach

The side of the vehicle the curb is on when departing from the stop. A value of 1 means the right side of the vehicle; a value of 2 means the left side.

ArriveTime

The time of day the route arrives at the stop. The time of day value for this field is in the time zone in which the stop is located.

DepartTime

The time of day the route departs from the stop. The time of day value for this field is in the time zone in which the stop is located.

ArriveTimeUTC

The time of day the route arrives at the stop. This value is in coordinated universal time (UTC).

DepartTimeUTC

The time of day the route departs from the stop. This value is in coordinated universal time (UTC).

WaitTime

The wait time or layover at the stop. For example, a wait time is incurred when a route must wait at an order for a time window to open.

The value is in the units specified by the Time Units parameter.

ViolationTime

The amount of time elapsed from the end of the stop's time window to the arrival of the route vehicle.

The value is in the units specified by the Time Units parameter.

ORIG_FID

The ObjectID value of the input order, depot, or break. This field can be used to join attributes from input features.

out_routes

This provides access to the drivers, vehicles, and route paths of a vehicle routing problem analysis.

The Populate Route Lines and Route Line Simplification Tolerance parameters influence the shape of the output routes.

The parameter supports the following fields:

FieldDescription

Name

The name of the route. The values for this field are copied from the Name field on the input routes.

ViolatedConstraints

Legacy:

This field is deprecated and is replaced by the four individual fields ViolatedConstraint_1 through ViolatedConstraint_4.

  • ViolatedConstraint_1
  • ViolatedConstraint_2
  • ViolatedConstraint_3
  • ViolatedConstraint_4

These fields contain a summary of violated constraints and are set after a solve operation. Each field will contain one violation. If an order has more than one violation, the next ViolatedConstraint_# field will be used.

These show a single violated constraint per field.

  • MaxOrderCount exceeded (0)—The preassigned orders cannot be assigned to the route since assigning the orders would exceed the maximum number of orders that can be assigned to the route as specified by the route's MaxOrderCount field value.
  • Capacities exceeded (1)—The preassigned orders cannot be assigned to the route since assigning the orders would exceed the total route capacity as specified by the route's Capacities field value.
  • MaxTotalTime exceeded (2)—The travel time from the start depot to the end depot plus the service and wait times at both depots and any break exceeds the total time for the route as specified by the route's MaxTotalTime field value.
  • MaxTotalTravelTime exceeded (3)—The travel time from the start depot to the end depot exceeds the total travel time for the route as specified by the route's MaxTotalTravelTime field value.
  • MaxTotalDistance exceeded (4)—The travel distance from the start depot to the end depot exceeds the total travel distance for the route as specified by the route's MaxTotalDistance field value.
  • Hard time window (5)—There is a hard time window violation on the start depot, end depot, or break associated with the route.
  • Unmatched specialty (6)—The specialties required by an order are not found on the target route.
  • Hard route zone (7)—An order that was preassigned to the route does not fall within a hard route zone.
  • Order pair MaxTransitTime exceeded (8)—There is an order pair preassigned to the route, and assigning the orders in the order pair would exceed the maximum transit time for the order pair as specified by the order pair's MaxTransitTime field value.
  • Order pair violation (9)—An order belongs to an order pair and cannot be assigned to the preassigned route.
  • Unreachable (10)—A preassigned order is located on a network element that cannot be reached by the route.
  • Cannot insert required break (11)—A break for the route has a null sequence value in the presence of preassigned orders, and the break cannot be inserted anywhere without introducing other violations.
  • Cannot insert required renewal (12)—A route exceeds its capacity and needs to visit a route renewal; however, the associated route renewal has a null sequence value in the presence of preassigned orders and cannot be inserted anywhere without introducing other violations.
  • MaxTravelTimeBetweenBreaks exceeded (13)—The solver was unable to insert a break within the time specified by the break's MaxTravelTimeBetweenBreaks field. This is often caused by preassigning a sequence to a break such that it cannot be reached within the maximum travel time.

  • Break MaxCumulWorkTime exceeded (14)—The solver was unable to insert a break within the time specified by the break's MaxCumulWorkTime field. This is often caused by preassigning a sequence to a break such that it cannot be reached within the maximum work time.
  • InboundArriveTime or OutboundDepartTime order violation (15)—The order couldn't be serviced within the inbound arrive time or outbound depart time constraints. This violation occurs when all the routes' LatestStartTime field values precede the InboundArriveTime values or none of the routes can reach a depot before the order's OutboundDepartTime value.
  • Cannot anchor first/last (16)—The order has an Anchor first or Anchor last assignment rule, but the solver was not able to honor this constraint. This violation occurs when the number of Anchor first orders or the number of Anchor last orders is greater than the number of available routes.

OrderCount

The number of orders assigned to the route.

TotalCost

The total operating cost of the route, which is the sum of the following field values: FixedCost, RegularTimeCost, OvertimeCost, and DistanceCost.

RegularTimeCost

The cost of regular work time, excluding any unpaid breaks.

OvertimeCost

The cost of overtime work, excluding any unpaid breaks.

DistanceCost

The distance cost component obtained by multiplying the TotalDistance and CostPerUnitDistance field values.

TotalTime

The total route duration. This includes travel times as well as service and wait times at orders, depots, and breaks. The TotalTime value is the sum of the following attribute fields:

  • StartDepotServiceTime
  • EndDepotServiceTime
  • TotalOrderServiceTime
  • TotalBreakServiceTime
  • TotalRenewalServiceTime
  • TotalWaitTime
  • TotalTravelTime

The value is in the units specified by the Time Units parameter.

TotalOrderServiceTime

The total service time spent at all orders on the route.

The value is in the units specified by the Time Units parameter.

TotalBreakServiceTime

The total service time spent at all breaks on the route.

The value is in the units specified by the Time Units parameter.

TotalTravelTime

The total travel time for the route.

The value is in the units specified by the Time Units parameter.

TotalDistance

The total travel distance for the route.

The value is in the units specified by the Distance Units parameter.

StartTime

The starting time of the route. The route may start before the beginning of its start depot's time window, in which case there is a wait time at the starting depot. The time of day value for this attribute is in the time zone in which the starting depot is located.

EndTime

The ending time of the route. The route ends upon completion of service at the ending depot. The time of day value for this attribute is in the time zone in which the ending depot is located.

StartTimeUTC

The start time of the route in coordinated universal time (UTC).

EndTimeUTC

The end time of the route in coordinated universal time (UTC).

TotalWaitTime

The total wait time at all orders, depots, and breaks on the route.

The value is in the units specified by the Time Units parameter.

TotalViolationTime

The total violation time at all orders and breaks on the route.

The value is in the units specified by the Time Units parameter.

RenewalCount

For a route with renewals, this is equal to the number of visits to depots for the purpose of renewing a vehicle, that is, loading or unloading a vehicle.

TotalRenewalServiceTime

For a route with renewals, this is the total service time spent at all renewal visits on the route.

The value is in the units specified by the Time Units parameter.

out_directions

This provides access to the turn-by-turn directions for each resulting route.

The Directions Language, Directions Distance Units, and Directions Style Name parameters influence the travel directions. The parameter returns empty features if the Populate Directions parameter is set to False.

The following table lists the fields that are returned for output directions:

FieldDescription

RouteName

The name of the route to which the driving action applies. This value is the same as the Name field of the output routes.

ArriveTime

The time of day to initiate the given driving action. If the route spans multiple days, the date and time of day are displayed.

Type

The type of maneuver that the directions feature represents or the type of the directions text. To determine whether Type refers to a maneuver type or a directions string type, review the SubItemType field value.

Type can be used, for example, to assign an icon for direction text based on the maneuver type, or it can use a formatting style based on the directions string type when displaying the driving directions in the application.

The Type value is an integer from the Maneuver Types or Directions String Types lists below.

Maneuver Types

  • 0: Unknown
  • 1: Arrive at Stop
  • 2: Go straight
  • 3: Bear left
  • 4: Bear right
  • 5: Turn left
  • 6: Turn right
  • 7: Make sharp left
  • 8: Make sharp right
  • 9: Make U-turn
  • 10: Take ferry
  • 11: Take roundabout
  • 12: Merge to highway
  • 13: Exit highway
  • 14: Go on another highway
  • 15: At fork keep center
  • 16: At fork keep left
  • 17: At fork keep right
  • 18: Depart stop
  • 19: Trip planning item
  • 20: End of ferry
  • 21: Ramp right
  • 22: Ramp left
  • 23: Turn left and immediately turn right
  • 24: Turn right and immediately turn left
  • 25: Turn right and immediately turn right
  • 26: Turn left and immediately turn left
  • 27: Pedestrian ramp
  • 28: Elevator
  • 29: Escalator
  • 30: Stairs
  • 31: Door passage

Directions String Types

  • 0: General directions string type
  • 1: Depart directions string type
  • 2: Arrive directions string type
  • 3: Length directions string type
  • 4: Time directions string type
  • 5: Time summary directions string type
  • 6: Time Window directions string type
  • 7: Violation Time directions string type
  • 8: Wait Time directions string type
  • 9: Service Time directions string type
  • 10: Estimated Arrival Time directions string type
  • 11: Cumulative Length directions string type
  • 12: Street name directions string type
  • 13: Alternate street name directions string type
  • 14: Sign branch information directions string type
  • 15: Sign toward information directions string type
  • 16: Cross street name directions string type
  • 17: Sign exit number directions string type

SubItemType

Specifies whether the Type field refers to an integer from the Directions String Types table or the Maneuver Types table.

  • If the SubItemType value is 1, the Type field refers to the values from the Maneuver Types table.
  • If the SubItemType value is 2, the Type field refers to the values from the Directions String Types table.
  • If the SubItemType value is 3, the Type field refers to the values from the Directions String Types table.

Text

A text description of the travel directions.

ElaspsedTime

The time elapsed in minutes from when the current driving direction starts until the next one starts, or until the route ends for the last driving direction.

DriveDistance

The distance from where the current driving direction occurs to where the next one occurs, or to where the route ends for the last driving direction.

The value is in the units specified by the Directions_Distance_Units parameter.

This value is zero for driving directions that occur at the same location where the next one begins. For example, the DriveDistance value is 0 for the directions text at the start of the route.

out_unassigned_stops

This provides access to the orders that couldn't be visited by any routes. You can also determine why the orders couldn't be visited and make the necessary changes to correct the problem.

Note:

When the Populate Stop Shapes parameter is set to True, this parameter is a feature class. Otherwise, it is a table.

The parameter supports the following fields:

FieldDescription

StopType

Indicates whether the stop represents a depot, an order, or a break. The field value is an integer that can be interpreted in the following ways:

  • 0—The stop is an order.
  • 1—The stop is a depot.
  • 2—The stop is a break.

Name

The name of the stop. The value of this field is the same as the Name field from input orders, depots, or breaks. You can use the StopType field to determine if the Name field value refers to a depot, an order, or a break.

ViolatedConstraints

Legacy:

This field is deprecated and is replaced by the four individual fields ViolatedConstraint_1 through ViolatedConstraint_4.

  • ViolatedConstraint_1
  • ViolatedConstraint_2
  • ViolatedConstraint_3
  • ViolatedConstraint_4

These fields contain a summary of violated constraints and are set after a solve operation. Each field will contain one violation. If an order has more than one violation, the next ViolatedConstraint_# field will be used.

These show a single violated constraint per field.

  • MaxOrderCount exceeded (0)—The preassigned orders cannot be assigned to the route since assigning the orders would exceed the maximum number of orders that can be assigned to the route as specified by the route's MaxOrderCount field value.
  • Capacities exceeded (1)—The preassigned orders cannot be assigned to the route since assigning the orders would exceed the total route capacity as specified by the route's Capacities field value.
  • MaxTotalTime exceeded (2)—The travel time from the start depot to the end depot plus the service and wait times at both depots and any break exceeds the total time for the route as specified by the route's MaxTotalTime field value.
  • MaxTotalTravelTime exceeded (3)—The travel time from the start depot to the end depot exceeds the total travel time for the route as specified by the route's MaxTotalTravelTime field value.
  • MaxTotalDistance exceeded (4)—The travel distance from the start depot to the end depot exceeds the total travel distance for the route as specified by the route's MaxTotalDistance field value.
  • Hard time window (5)—There is a hard time window violation on the start depot, end depot, or break associated with the route.
  • Unmatched specialty (6)—The specialties required by an order are not found on the target route.
  • Hard route zone (7)—An order that was preassigned to the route does not fall within a hard route zone.
  • Order pair MaxTransitTime exceeded (8)—There is an order pair preassigned to the route, and assigning the orders in the order pair would exceed the maximum transit time for the order pair as specified by the order pair's MaxTransitTime field value.
  • Order pair violation (9)—An order belongs to an order pair and cannot be assigned to the preassigned route.
  • Unreachable (10)—A preassigned order is located on a network element that cannot be reached by the route.
  • Cannot insert required break (11)—A break for the route has a null sequence value in the presence of preassigned orders, and the break cannot be inserted anywhere without introducing other violations.
  • Cannot insert required renewal (12)—A route exceeds its capacity and needs to visit a route renewal; however, the associated route renewal has a null sequence value in the presence of preassigned orders and cannot be inserted anywhere without introducing other violations.
  • MaxTravelTimeBetweenBreaks exceeded (13)—The solver was unable to insert a break within the time specified by the break's MaxTravelTimeBetweenBreaks field. This is often caused by preassigning a sequence to a break such that it cannot be reached within the maximum travel time.

  • Break MaxCumulWorkTime exceeded (14)—The solver was unable to insert a break within the time specified by the break's MaxCumulWorkTime field. This is often caused by preassigning a sequence to a break such that it cannot be reached within the maximum work time.
  • InboundArriveTime or OutboundDepartTime order violation (15)—The order couldn't be serviced within the inbound arrive time or outbound depart time constraints. This violation occurs when all the routes' LatestStartTime field values precede the InboundArriveTime values or none of the routes can reach a depot before the order's OutboundDepartTime value.
  • Cannot anchor first/last (16)—The order has an Anchor first or Anchor last assignment rule, but the solver was not able to honor this constraint. This violation occurs when the number of Anchor first orders or the number of Anchor last orders is greater than the number of available routes.

Status

Specifies the status of the point with respect to its location on the network and the outcome of the analysis. The possible values are the following:

  • 0 (OK)—The point was located on the network.
  • 1 (Not Located)—The point was not located on the network and was not included in the analysis.
  • 2 (Network element not located)—The network element identified by the point's network location fields can't be found. This can occur when a network element where the point should be was deleted, and the network location was not recalculated.
  • 3 (Element not traversable)—The network element that the point is located on is not traversable. This can occur when the element is restricted by a restriction attribute.
  • 4 (Invalid Field Values)—Field values fall outside a range or coded-value domain. For example, a negative number exists where positive numbers are required.
  • 5 (Not Reached)—The point can't be reached by the solver. The point may be on a separate, disconnected area of the network from the other inputs, or barriers or restrictions prevent travel to or from the point.
  • 6 (Time window violation)—The point could not be reached within the designated time windows. This status only applies to network analysis types that support time windows.
  • 7 (Not located on closest)—The closest network location to the point is not traversable because of a restriction or barrier, so the point has been located on the closest traversable network feature instead.

solve_succeeded

Use this parameter to determine if the analysis was successful.

output_result_file

Use this parameter to access the results from the analysis as a .zip file containing one or more files for each output. The format of the individual file is specified by the Output Format parameter. The parameter value is not populated when the Output Format parameter is set to Feature Set.

When a file-based output format—such as JSON File or GeoJSON File—is specified, no outputs are added to the display, since the application (such as ArcMap or ArcGIS Pro) does not draw the contents of the result file. Instead, the result file is downloaded to a temporary directory on your machine. In ArcGIS Pro, the location of the downloaded file can be determined by viewing the Output Result File parameter value in the entry corresponding to the tool operation in the geoprocessing history of the project. In ArcMap, the location of the file can be determined by accessing the Copy Location option in the shortcut menu of the Output Result File parameter in the entry corresponding to the tool operation in the Geoprocessing Results window.

output_route_data

Use this parameter to access a .zip file that contains a file geodatabase containing the inputs and outputs of the analysis in a format that can be used to share route layers with ArcGIS Online or Portal for ArcGIS. The parameter value is populated only when the Save Route Data parameter is set to True.

The file is downloaded to a temporary directory on your machine. In ArcGIS Pro, the location of the downloaded file can be determined by viewing the Output Route Data parameter value in the entry corresponding to the tool operation in the geoprocessing history of the project. In ArcMap, the location of the file can be determined by accessing the Copy Location option in the shortcut menu of the Output Route Data parameter in the entry corresponding to the tool operation in the Geoprocessing Results window.

output_network_analysis_layer

Use this parameter to access the network analysis layer file that stores the analysis settings and the inputs and outputs used for the analysis. The parameter value is populated only when the Save Output Network Analysis Layer parameter is set to True.

The file is downloaded to a temporary directory on your machine. In ArcGIS Pro, the location of the downloaded file can be determined by viewing the Output Network Analysis Layer parameter value in the entry corresponding to the tool operation in the geoprocessing history of the project. In ArcMap, the location of the file can be determined by accessing the Copy Location option in the shortcut menu of the Output Network Analysis Layer parameter in the entry corresponding to the tool operation in the Geoprocessing Results window.

Note:

You cannot work directly with this file even when you open the file in an ArcGIS Desktop application such as ArcMap since its data source will not be valid. The file is meant to be sent to Esri Technical Support to diagnose the quality of results returned from the tool.