Add Vehicle Routing Problem Routes (Network Analyst)

Summary

Creates routes in a Vehicle Routing Problem (VRP) layer. This tool will append rows to the Routes sublayer and can add rows with specific settings while creating a unique name field.

Usage

  • The tool adds routes to the VRP layer with unique names starting with the Route Name Prefix parameter value.

  • The Start Depot Name and End Depot Name parameter values are based on the name in the Depots layer.

  • To delete all existing routes and create new routes, check the Append To Existing Routes parameter checkbox(append_to_existing_routes = "CLEAR" in Python).

Syntax

arcpy.na.AddVehicleRoutingProblemRoutes(in_vrp_layer, {number_of_routes}, {route_name_prefix}, {start_depot_name}, {end_depot_name}, {earliest_start_time}, {latest_start_time}, {max_order_count}, {capacities}, {route_constraints}, {costs}, {additional_route_time}, {append_to_existing_routes})
ParameterExplanationData Type
in_vrp_layer

The  vehicle routing problem analysis layer to which routes will be added.

Network Analyst Layer
number_of_routes
(Optional)

The number of routes to add.

Long
route_name_prefix
(Optional)

A qualifier added to the title of every route layer item. For example, a route name prefix WeekdayRoute would be used as the starting text for every route’s name with Object ID appended to it.

String
start_depot_name
(Optional)

The name of the starting depot for the route. If the Start Depot Name value is null, the route will begin from the first order assigned. Omitting the start depot is useful when the vehicle's starting location is unknown or irrelevant to your problem. However, when the Start Depot Name value is null, the End Depot Name value cannot also be null. Virtual start depots are not allowed if orders or depots are in multiple time zones.

String
end_depot_name
(Optional)

The name of the ending depot for the route. If the End Depot Name value is null, the route will end at the last order assigned. When the End Depot Name value is null, the Start Depot Name value cannot also be null.

String
earliest_start_time
(Optional)

The earliest allowable start time for the route.

This parameter is used by the solver in conjunction with the time window of the starting depot, provided in the Depots layer by the TimeWindowStart field, for determining feasible route start times. This parameter has a default time-only value of 8:00:00 a.m., interpreted as 8:00:00 a.m. on the date given by the Default Date property of the analysis layer. If no value is specified, the default value is used.

Date
latest_start_time
(Optional)

The latest allowable start time for the route. This parameter has a default time-only value of 10:00:00 a.m., interpreted as 10:00:00 a.m. on the date provided by the Default Date property of the analysis layer. If no value is specified, the default value is used.

Date
max_order_count
(Optional)

The maximum allowable number of orders on the route. The default value is 30. If no value is specified, the default value is used.

Long
capacities
[capacities,...]
(Optional)

The maximum amount (volume, weight, quantity, and so on) that can be carried by the vehicle. A null value is the same as zero. A maximum of nine capacity fields are allowed, but use only the number necessary to model the needs of the vehicles.

Value Table
route_constraints
[route_constraints,...]
(Optional)

The constraints placed on routes to limit total time, total travel time, and total distance.

  • Max Total Time—The maximum allowable route duration. The route duration includes travel times as well as service and wait times at orders, depots, and breaks.
  • Max Total Travel Time—The maximum allowable travel time for the route. The travel time includes only the time spent driving on the network and does not include service or wait times. This field value can't be larger than the MaxTotalTime  field value.
  • Max Total Distance—The maximum allowable travel distance for the route.

Value Table
costs
[costs,...]
(Optional)

The costs incurred by the route in a VRP solution.

  • Fixed Cost—A fixed monetary cost that is incurred only if the route is used in a solution (that is, it has orders assigned to it).
  • Cost Per Unit Time—The monetary cost incurred per unit of work time for the total route duration, including travel times and service and wait times at orders, depots, and breaks.
  • Cost Per Unit Distance—The monetary cost incurred per unit of distance traveled for the route length (total travel distance).
  • Overtime Start Time—The duration of regular work time before overtime computation begins.
  • Cost Per Unit Overtime—The monetary cost incurred per time unit of overtime work. This field can contain null values; a null value indicates that the Cost Per Unit Overtime value is the same as the Cost Per Unit Time value.

Value Table
additional_route_time
[additional_route_time,...]
(Optional)

Additional route time options.

  • Start Depot Service Time—The service time at the starting depot. This can be used to model the time spent loading the vehicle.
  • End Depot Service Time—The service time at the ending depot. This can be used to model the time spent unloading the vehicle.
  • Arrive/Depart Delay—The amount of travel time needed to accelerate the vehicle to normal travel speeds, decelerate it to a stop, and move it off and on the network (for example, in and out of parking). By including an Arrive/Depart Delay value, the VRP solver is deterred from sending many routes to service physically coincident orders.

Value Table
append_to_existing_routes
(Optional)

Specifies whether new routes will be appended to the existing routes attribute table.

  • APPENDNew routes will be appended to the existing set in the routes attribute table. This is the default.
  • CLEARExisting routes will be deleted and replaced with new routes. 
Boolean

Derived Output

NameExplanationData Type
out_vrp_layer

The updated network analyst layer.

Network Analyst Layer

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics