/SolveVehicleRoutingProblem

GETGETPOST
Use dark colors for code blocksCopy
1
GET  https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRoutingProblem/GPServer/SolveVehicleRoutingProblem/submitJob

The /SolveVehicleRoutingProblem job request can be used in determining the most effective routes for a set of vehicles that need to visit a set of locations. It creates the overall minimum transportation cost.

Parameters

NameRequiredTypeDefaultDescription
string

The request response format, either json or pjson

string

An access token with the required privileges.

feature

One or more locations that the routes of the VRP analysis will visit.

feature

One or more depots for the given vehicle routing problem.

table

One or more routes that describe vehicle and driver characteristics.

object

The mode of transportation for the analysis provided as a JSON object.

object

Determines how input data are located.

string

Region in which to perform the analysis.

string

GEO_LOCAL

Time zone for the input date-time fields

datetime

The date on which all the routes start.

feature

Rest periods, or breaks, for the routes in a given fleet routing problem.

string

Minutes

Time units for all time-based attribute values

string

Miles

Units for all distance-based attribute values

string

Medium

Importance of honoring time windows without causing violations.

boolean

true

Orders assigned to an individual route are spatially clustered.

feature

Delineates work territories for given routes.

feature

Intermediate depots that routes can visit to reload or unload the cargo they are delivering or picking up.

feature

Pair pickup and delivery orders so they are serviced by the same route.

string

Medium

Rate the importance of reducing excess transit time of order pairs.

string

Allowed only at Intersections and Dead Ends

Restricts or allows a route to make U-turns at junctions.

feature

One or more points that act as temporary restrictions, additional time, or distance.

feature

One ore more lines that prohibit travel anywhere the lines intersect the streets.

feature

Polygons that either prohibit travel or proportionately scale the time or distance required to travel on the streets.

boolean

true

Hierarchy used when finding the shortest paths.

[string]

The restrictions that should be honored by the service.

table

Additional values required by an attribute or restriction.

string

Time-based impedance.

string

Miles

Distance-based impedance.

string

Type of impedance.

boolean

true

Specify shape of the output routes.

number

10

Simplification level for the route geometry returned by the service.

boolean

false

Generates the driving directions for each route.

string

en

The language used when generating driving directions.

string

NA Desktop

The formatting style for the directions. Used ifpopulate_directions=true.

boolean

false

Route data will be saved as a .zip file.

boolean

false

Save the analysis settings as a network analysis layer file.

boolean

false

Create the shapes for the output assigned and unassigned stops.

string

Feature Set

Format in which the output features will be returned.

object

Additional settings that affect task operation

string

For internal use only.

boolean

true

Ignores invalid input locations.

Required parameters

f

The response format.

Use dark colors for code blocksCopy
1
f=json

token

An access token with the required privileges.

  • ArcGIS Location Platform: premium:user:networkanalysis:routing or premium:user:networkanalysis:optimizedrouting
  • ArcGIS Online: premium:user:networkanalysis
Use dark colors for code blocksCopy
1
token=<ACCESS_TOKEN>

Learn more about access tokens and privileges in the Security and authentication developer guide.

orders

Specify one or more locations that the routes of the VRP analysis will visit. An order can represent a delivery (for example, furniture delivery), a pickup (such as an airport shuttle bus picking up a passenger), or some type of service or inspection (a tree trimming job or building inspection, for instance).

When specifying the orders, you can set attributes for each as follows:

Show attributes for orders

Attributes for orders

  • ObjectIDinteger

    The system-managed ID field.

  • Namestring (length: 500)nullable

    The name of the order. The name must be unique. If the name is left null, a name is automatically generated at solve time.

  • Descriptionstring (length: 500)

    The descriptive information about the order. This can contain any textual information for the order and has no restrictions for uniqueness. You may want to store a client's ID number in the Name field and the client's actual name or address in the Description field.

  • ServiceTimenumber (non-negative)nullable

    The amount of time that will be spent at the network location when the route visits it; that is, it stores the impedance value for the network location. A zero or null value indicates that the network location requires no service time.

    The unit for this field value is specified by the time_units parameter.

  • TimeWindowStart1datetimenullable

    The beginning time of the first time window for the network location. This field can contain a null value; a null value indicates no beginning time.

    A time window only states when a vehicle can arrive at an order; it doesn't state when the service time must be completed. To account for service time and departure before the time window ends, subtract ServiceTime from the TimeWindowEnd1 field.

    The time window fields (TimeWindowStart1, TimeWindowEnd1, TimeWindowStart2, and TimeWindowEnd2) must be specified in a date field as an integer that represents the number of milliseconds since epoch (January 1, 1970) and not as date-time values. The time zone for time window fields is specified using the time_zone_usage_for_time_fields parameter. For example, if the orders are located in the Pacific standard time zone and you want to specify that the time window should start at 8:00 a.m. (local time) on November 18, 2019, the value for the TimeWindowStart1 field should be specified as milliseconds since epoch for this date and time, which is 1574064000000. You also should specify the time_zone_usage_for_time_fields parameter value as GEO_LOCAL.

    When solving a problem that spans multiple time zones, each order's time-window values refer to the time zone in which the order is located.

  • TimeWindowEnd1datetimenullable

    The ending time of the first window for the network location. This field can contain a null value; a null value indicates no ending time.

  • TimeWindowStart2datetimenullable

    The beginning time of the second time window for the network location. This field can contain a null value; a null value indicates that there is no second time window.

    If the first time window is null as specified by the TimeWindowStart1 and TimeWindowEnd1 fields, the second time window must also be null. If both time windows are non null, they can't overlap. Also, the second time window must occur after the first.

  • TimeWindowEnd2datetimenullable

    The ending time of the second time window for the network location. This field can contain a null value.

    When TimeWindowStart2 and TimeWindowEnd2 are both null, there is no second time window. When TimeWindowStart2 is not null but TimeWindowEnd2 is null, there is a second time window that has a starting time but no ending time. This is valid.

  • MaxViolationTime1number (non-negative)nullable

    A time window is considered violated if the arrival time occurs after the time window has ended. This field specifies the maximum allowable violation time for the first time window of the order. It can contain a zero value but can't contain negative values. A zero value indicates that a time window violation at the first time window of the order is unacceptable; that is, the first time window is hard. Conversely, a null value indicates that there is no limit on the allowable violation time. A nonzero value specifies the maximum amount of lateness; for example, a route can arrive at an order up to 30 minutes beyond the end of its first time window.

    The unit for this field value is specified by the time_units parameter.

    Time window violations can be tracked and weighted by the solver. Consequently, you can direct the VRP solver to do one of the following:

    • Minimize the overall violation time regardless of the increase in travel cost for the fleet.
    • Find a solution that balances overall violation time and travel cost.
    • Ignore the overall violation time and minimize the travel cost for the fleet.

    By assigning an importance level for the time_window_factor parameter, you are essentially choosing one of these options. In any case, however, the solver will return an error if the value set for MaxViolationTime1 is surpassed.

  • MaxViolationTime2number (non-negative)nullable

    The maximum allowable violation time for the second time window of the order. This field is analogous to the MaxViolationTime1 field.

  • InboundArriveTimedatetimenullable

    Defines when the item to be delivered to the order will be ready at the starting depot.

    The order can be assigned to a route only if the inbound arrive time precedes the route's latest start time value; this way, the route cannot leave the depot before the item is ready to be loaded onto it.

    This field can help model scenarios involving inbound-wave transshipments. For example, a job at an order requires special materials that are not currently available at the depot. The materials are being shipped from another location and will arrive at the depot at 11:00 a.m. To ensure a route that leaves before the shipment arrives isn't assigned to the order, the order's inbound arrive time is set to 11:00 a.m. The special materials arrive at 11:00 a.m., they are loaded onto the vehicle, and the vehicle departs from the depot to visit its assigned orders.

  • OutboundDepartTimedatetimenullable

    Defines when the item to be picked up at the order must arrive at the ending depot.

    The order can be assigned to a route only if the route can visit the order and reach its end depot before the specified outbound depart time.

  • DeliveryQuantitiesstring (length: 500)

    The size of the delivery. You can specify size in any dimension, such as weight, volume, or quantity. You can also specify multiple dimensions, for example, weight and volume.

    Enter delivery quantities without indicating units. For example, if a 300-pound object needs to be delivered to an order, enter 300. You will need to remember that the value is in pounds.

    If you are tracking multiple dimensions, separate the numeric values with a space. For example, if you are recording the weight and volume of a delivery that weighs 2,000 pounds and has a volume of 100 cubic feet, enter 2000 100. Again, you need to remember the units—in this case, pounds and cubic feet. You also need to remember the sequence in which the values and their corresponding units are entered.

    Make sure that Capacities for Routes and DeliveryQuantities and PickupQuantities for Orders are specified in the same manner; that is, the values must be in the same units. If you are using multiple dimensions, the dimensions must be listed in the same sequence for all parameters. For example, if you specify weight in pounds, followed by volume in cubic feet for DeliveryQuantities , the capacity of your routes and the pickup quantities of your orders must be specified the same way: weight in pounds, then volume in cubic feet. If you combine units or change the sequence, you will get unwanted results with no warning messages.

    An empty string or null value is equivalent to all dimensions being infinity. If the string has an insufficient number of values in relation to the capacity count or dimensions being tracked, the remaining values are treated as infinity. Delivery quantities can't be negative.

  • PickupQuantitiesstring (length: 500)

    The size of the pickup. You can specify size in any dimension, such as weight, volume, or quantity. You can also specify multiple dimensions, for example, weight and volume. You cannot, however, use negative values. This field is analogous to the DeliveryQuantities field of Orders.

    In the case of an exchange visit, an order can have both delivery and pickup quantities.

  • Revenuenumber (non-negative)nullable

    The income generated if the order is included in a solution. This field can contain a null value—a null value indicates zero revenue—but it can't have a negative value.

    Revenue is included in optimizing the objective function value but is not part of the solution's operating cost; that is, the TotalCost field in the routes never includes revenue in its output. However, revenue weights the relative importance of servicing orders.

  • SpecialtyNamesstring (length: 500)

    A space-separated string containing the names of the specialties required by the order. A null value indicates that the order doesn't require specialties.

    The spelling of any specialties listed in the Orders and Routes classes must match exactly so that the VRP solver can link them together.

    To illustrate what specialties are and how they work, assume a lawn care and tree trimming company has a portion of its orders that requires a bucket truck to trim tall trees. The company enters BucketTruck in the SpecialtyNames field for these orders to indicate their special need. SpecialtyNames is left null for the other orders. Similarly, the company also enters BucketTruck in the SpecialtyNames field of routes that are driven by trucks with hydraulic booms. It leaves the field null for the other routes. At solve time, the VRP solver assigns orders without special needs to any route, but it only assigns orders that need bucket trucks to routes that have them.

  • AssignmentRuleint enumnot nullabledefault:Override

    Allowed values: 0, 1, 2, 3, 4, 5

    This attribute specifies the rule for the order's route assignment options. It is constrained by a domain of values, that are listed below:

    • 0: Exclude—The order will be excluded from the subsequent solve operation.
    • 1: Preserve Route and Relative Sequence—The solver must always assign the order to the preassigned route at the preassigned relative sequence during the solve operation. If this assignment rule can't be followed, it results in an order violation. With this setting, only the relative sequence is maintained, not the absolute sequence. To illustrate what this means, imagine there are two orders: A and B. They have sequence values of 2 and 3, respectively. If you set their AssignmentRule field values to Preserve Route and Relative Sequence, the sequence values for A and B may change after solving because other orders, breaks, and depot visits can be sequenced before, between, or after A and B. However, B cannot be sequenced before A.
    • 2: Preserve Route—The solver must always assign the order to the preassigned route during the solve operation. A valid sequence must also be set even though the sequence may or may not be preserved. If the order can't be assigned to the specified route, it results in an order violation.
    • 3: Override—The solver tries to preserve the route and sequence preassignment for the order during the solve operation. However, a new route or sequence for the order may be assigned if it helps minimize the overall value of the objective function.
    • 4: Anchor first—The solver ignores the route and sequence preassignment (if any) for the order during the solve operation. It assigns a route to the order and makes it the first order on that route to minimize the overall value of the objective function.
    • 5: Anchor last—The solver ignores the route and sequence preassignment (if any) for the order during the solve operation. It assigns a route to the order and makes it the last order on that route to minimize the overall value of the objective function.

    This field can't contain a null value.

  • CurbApproachint enumdefault:0

    Allowed values: 0, 1, 2, 3

    Specify the direction a vehicle may arrive at and depart from the order. The options are as following:

    • 0: Either side of vehicle. The vehicle can approach and depart the order in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the order or if it can pull into a driveway or parking lot and turn around.
    • 1: Right side of vehicle. When the vehicle approaches and departs the order, the curb must be on the right side of the vehicle. A U-turn is prohibited.
    • 2: Left side of vehicle. When the vehicle approaches and departs the order, the curb must be on the left side of the vehicle. A U-turn is prohibited.
    • 3: No U-turn. When the vehicle approaches the order, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around. Learn more about U-turn policies
    Show illustration
    SettingCoded valueDescription

    Either side of vehicle

    0

    The vehicle can approach and depart the order in either direction, so a U-turn is allowed at the order. This setting can be chosen if it is possible and desirable for your vehicle to turn around at the order. This decision may depend on the width of the road and the amount of traffic or whether the order has a parking lot where vehicles can pull in and turn around.

    Either side of vehicle

    All arrival and departure combinations are allowed with the Either side of vehicle curb approach.

    Right side of vehicle

    1

    When the vehicle approaches and departs the order, the order must be on the right side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the right side.

    Right side of vehicle

    The allowed arrival and departure combination for the Right side of vehicle curb approach is shown.

    Left side of vehicle

    2

    When the vehicle approaches and departs the order, the order must be on the left side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the left side.

    Left side of vehicle

    The allowed arrival and departure combination for the Left side of vehicle curb approach is shown.

    No U-Turn

    3

    When the vehicle approaches the order, the order can be on either side of the vehicle; however, when it departs, the vehicle must continue in the same direction it arrived in. A U-turn is prohibited.

    No U-turns

    The allowed arrival and departure combinations for the No U-Turn curb approach are shown.

    The CurbApproach attribute is designed to work with both kinds of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider an order on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach an order from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, if you want to arrive at an order and not have a lane of traffic between the vehicle and the order, choose 1 (Right side of vehicle) in the United States and 2 (Left side of vehicle) in the United Kingdom.

    Right side of vehicle with right-hand traffic

    With right-hand traffic, the curb approach that leaves the vehicle closest to the stop is Right side of vehicle.

    Left side of vehicle with left-hand traffic

    With left-hand traffic, the curb approach that leaves the vehicle closest to the stop is Left side of vehicle.

  • RouteNamestring (length: 1024)

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

    This field is used to preassign an order to a specific route. It can contain a null value, indicating that the order is not preassigned to any route, and the solver identifies the best possible route assignment for the order. If this is set to null, the Sequence field must also be set to null.

    After a solve operation, if the order is routed, the RouteName field contains the name of the route to which the order is assigned.

  • Sequenceinteger

    Indicates the sequence of the order on its assigned route.

    This field is used to specify the relative sequence of an order on the route. This field can contain a null value specifying that the order can be placed anywhere along the route. A null value can only occur together with a null RouteName value.

    The input sequence values are positive and unique for each route (shared across renewal depot visits, orders, and breaks) but do not need to start from 1 or be contiguous.

    After a solve operation, the Sequence field contains the sequence value of the order on its assigned route. Output sequence values for a route are shared across depot visits, orders, and breaks; start from 1 (at the starting depot); and are consecutive. The smallest possible output sequence value for a routed order is 2, since a route always begins at a depot.

  • Bearingnumber (non-negative)nullable

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north.

    This attribute is used in conjunction with the BearingTol attribute. Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle. Using this attribute tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the solver determine the side of the street that the point is on.

    Learn more about bearing and bearing tolerance

  • BearingTolnumber (range: 0 - 180)default:30nullable

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing attribute.

    If the Bearing attribute value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated. The units are in degrees. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatencynumber (non-negative)nullable

    Indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    This attribute is only used in the solve process if the Bearing and BearingTol fields also have values; however, providing a NavLatency attribute value is optional, even when values are present in the Bearing and BearingTol.

Example

This example shows how to specify attributes for the orders.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  "features": [
    {
      "geometry": {
        "x": -0.1891,
        "y": 51.5254
      },
      "attributes": {
        "Name": "Order 1",
        "TimeWindowStart1": null,
        "TimeWindowEnd1": 1562061600000,
        "MaxViolationTime1": 0,
        "DeliveryQuantities": "2000 100"
      }
    },
    {
      "geometry": {
        "x": -0.1744,
        "y": 51.5353
      },
Expand

depots

Specify one or more depots for the given vehicle routing problem. A depot is a location that a vehicle departs from at the beginning of its workday and returns to at the end of the workday. Vehicles are loaded (for deliveries) or unloaded (for pickups) at depots. In some cases, a depot can also act as a renewal location whereby the vehicle can unload or reload and continue performing deliveries and pickups. A depot has open and close times, as specified by a hard time window. Vehicles can't arrive at a depot outside of this time window.

When specifying the depots, you can set attributes for each as follows:

Show attributes for depots

Attributes for depots

  • ObjectIDinteger

    The system-managed ID field.

  • Namestring (length: 500)

    The name of the depot. The StartDepotName and EndDepotName fields on routes reference the names you specify here. It is also referenced by the route renewals, when used.

    Depot names are not case sensitive but must be nonempty and unique.

  • Descriptionstring (length: 500)

    The descriptive information about the depot location. This can contain any textual information and has no restrictions for uniqueness. For example, if you want to note which region a depot is in or the depot's address and telephone number, you can enter the information here rather than in the Name field.

  • TimeWindowStart1datetimenullable

    The beginning time of the first time window for the network location. This field can contain a null value; a null value indicates no beginning time.

    The time window fields (TimeWindowStart1, TimeWindowEnd1, TimeWindowStart2, and TimeWindowEnd2) must be specified in a date field as an integer that represents the number of milliseconds since epoch (January 1, 1970) and not as date-time values. The time zone for time window fields is specified using the time_zone_usage_for_time_fields parameter. For example, if the orders are located in the Pacific standard time zone and you want to specify that the time window should start at 8:00 a.m. (local time) on November 18, 2019, the value for the TimeWindowStart1 field should be specified as milliseconds since epoch for this date and time, which is 1574064000000. You also should specify the time_zone_usage_for_time_fields parameter value as GEO_LOCAL.

    When solving a problem that spans multiple time zones, each depot's time-window values refer to the time zone in which the depot is located.

  • TimeWindowEnd1datetimenullable

    The ending time of the first window for the network location. This field can contain a null value; a null value indicates no ending time.

  • TimeWindowStart2datetimenullable

    The beginning time of the second time window for the network location. This field can contain a null value; a null value indicates that there is no second time window.

    If the first time window is null, as specified by the TimeWindowStart1 and TimeWindowEnd1 fields, the second time window must also be null.

    If both time windows are not null, they can't overlap. Also, the second time window must occur after the first.

  • TimeWindowEnd2datetimenullable

    The ending time of the second time window for the network location. This field can contain a null value. When TimeWindowStart2 and TimeWindowEnd2 are both null, there is no second time window. When TimeWindowStart2 is not null but TimeWindowEnd2 is null, there is a second time window that has a starting time but no ending time. This is valid.

  • CurbApproachint enumdefault:0

    Allowed values: 0, 1, 2, 3

    Specify the direction a vehicle may arrive at and depart from the depot. The options are as following:

    • 0: Either side of vehicle. The vehicle can approach and depart the depot in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the depot or if it can pull into a driveway or parking lot and turn around.
    • 1: Right side of vehicle. When the vehicle approaches and departs the depot, the curb must be on the right side of the vehicle. A U-turn is prohibited.
    • 2: Left side of vehicle. When the vehicle approaches and departs the depot, the curb must be on the left side of the vehicle. A U-turn is prohibited.
    • 3: No U-turn. When the vehicle approaches the depot, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around. Learn more about U-turn policies
    Show illustration
    SettingCoded valueDescription

    Either side of vehicle

    0

    The vehicle can approach and depart the depot in either direction, so a U-turn is allowed at the depot. This setting can be chosen if it is possible and desirable for your vehicle to turn around at the depot. This decision may depend on the width of the road and the amount of traffic or whether the depot has a parking lot where vehicles can pull in and turn around.

    Either side of vehicle

    All arrival and departure combinations are allowed with the Either side of vehicle curb approach.

    Right side of vehicle

    1

    When the vehicle approaches and departs the depot, the depot must be on the right side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the right side.

    Right side of vehicle

    The allowed arrival and departure combination for the Right side of vehicle curb approach

    Left side of vehicle

    2

    When the vehicle approaches and departs the depot, the depot must be on the left side of the vehicle. A U-turn is prohibited. This is typically used for vehicles such as buses that must arrive with the bus stop on the left side.

    Left side of vehicle

    The allowed arrival and departure combination for the Left side of vehicle curb approach

    No U-Turn

    3

    When the vehicle approaches the depot, the depot can be on either side of the vehicle; however, when it departs, the vehicle must continue in the same direction it arrived in. A U-turn is prohibited.

    No U-turns

    The allowed arrival and departure combinations for the No U-Turn curb approach

    The CurbApproach attribute is designed to work with both kinds of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider a depot on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach a depot from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, if you want to arrive at a depot and not have a lane of traffic between the vehicle and the depot, choose 1 (Right side of vehicle) in the United States and 2 (Left side of vehicle) in the United Kingdom.

    Right side of vehicle with right-hand traffic

    With right-hand traffic, the curb approach that leaves the vehicle closest to the stop is Right side of vehicle.

    Left side of vehicle with left-hand traffic

    With left-hand traffic, the curb approach that leaves the vehicle closest to the stop is Left side of vehicle.

  • Bearingnumber (non-negative)nullable

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north.

    This attribute is used in conjunction with the BearingTol attribute. Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle. Using this attribute tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the solver determine the side of the street that the point is on.

    Learn more about bearing and bearing tolerance

  • BearingTolnumber (range: 0 - 180)default:30nullable

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing attribute.

    If the Bearing attribute value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated. The units are in degrees. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatencynumber (non-negative)nullable

    Indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    This attribute is only used in the solve process if the Bearing and BearingTol fields also have values; however, providing a NavLatency attribute value is optional, even when values are present in the Bearing and BearingTol.

Example

This example shows how to specify attributes for the depots.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  "features": [
    {
      "geometry": {
        "x": -0.1891,
        "y": 51.5254
      },
      "attributes": {
        "Name": "Depot1",
        "TimeWindowStart1": null,
        "TimeWindowEnd1": "1358362800000"
      }
    },
    {
      "geometry": {
        "x": -0.1744,
        "y": 51.5353
      },
      "attributes": {
        "Name": "Depot2",
Expand

routes

Specify one or more routes that describe vehicle and driver characteristics. A route can have start and end depot service times, a fixed or flexible starting time, time-based operating costs, distance-based operating costs, multiple capacities, various constraints on a driver's workday, and so on.

You can specify additional properties for routes with the following attributes:

Show attributes for routes

Attributes for routes

  • Namestring (length: 1024)

    The name of the route. The name must be unique.

    The service generates a unique name if the attribute value is null. Therefore, specifying a value is optional in most cases. However, you must specify a name if your analysis includes breaks, route renewals, route zones, or orders that are preassigned to a route because the route name is used as a foreign key in these cases. Note that route names are case insensitive.

  • StartDepotNamestring (length: 500)

    The name of the starting depot for the route. This attribute is a foreign key to the Name attribute in the depots parameter, so the values must match.

    If the StartDepotName 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 StartDepotName is null, EndDepotName cannot also be null.

    Virtual start depots are not allowed if orders or depots are in multiple time zones.

    If the route is making deliveries and StartDepotNameis null, it is assumed the cargo is loaded on the vehicle at a virtual depot before the route begins. For a route that has no renewal visits, its delivery orders (those with nonzero DeliveryQuantities values in the orders parameter) are loaded at the start depot or virtual depot. For a route that has renewal visits, only the delivery orders before the first renewal visit are loaded at the start depot or virtual depot.

  • EndDepotNamestring (length: 500)

    The name of the ending depot for the route. This attribute is a foreign key to the Name attribute in the depots parameter, so the values must match.

  • StartDepotServiceTimenumber (non-negative)

    The service time at the starting depot. This can be used to model the time spent loading the vehicle. This attribute can contain a null value; a null value indicates zero service time. The unit for this attribute value is specified by the time_units parameter.

  • EndDepotServiceTimenumber (non-negative)

    The service time at the ending depot. This can be used to model the time spent unloading the vehicle. This attribute can contain a null value; a null value indicates zero service time. The unit for this attribute value is specified by the time_units parameter.

    The service times at the start and end depots are fixed values (given by the StartDepotServiceTime and EndDepotServiceTime attribute values) and do not take into account the actual load for a route. For example, the time taken to load a vehicle at the starting depot may depend on the size of the orders. Therefore, the depot service times could be given values corresponding to a full truckload or an average truckload, or you could make your own time estimate.

  • EarliestStartTimedatetimenullable

    The earliest allowable starting time for the route. This is used by the service in conjunction with the time window of the starting depot for determining feasible route start times.

    This attribute can't contain null values and has a default time-only value of 8:00 AM on the date given by the default_date parameter or the current date if unspecified.

  • LatestStartTimedatetimenullable

    The latest allowable starting time for the route. This attribute can't contain null values and has a default time-only value of 10:00 AM; the default value is interpreted as 10:00 a.m. on the date given by the default_date parameter.

    The value for the EarliestStartTime and LatestStartTime attributes is specified in a date field as an integer that represents the number of milliseconds since epoch (January 1, 1970).

    The time zone is specified using the time_zone_usage_for_time_fields parameter. If set to GEO_LOCAL, the time is in the time zone where the route's depot is located. This is useful if your routes span multiple time zones but they all start at a consistent time (for example, 8:00 a.m. in the depot's time zone). If the parameter is set to UTC, the time is based on UTC time. This is useful if you don't know the time zone of an individual route's depot but know its absolute time (for example, the time window starts an hour from now).

  • ArriveDepartDelaynumber (non-negative)

    Stores 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 ArriveDepartDelay value, the service is deterred from sending many routes to service physically coincident orders.

    The cost for this attribute is incurred between visits to noncoincident orders, depots, and route renewals. For example, when a route starts from a depot and visits the first order, the total arrive/depart delay is added to the travel time. The same is true when traveling from the first order to the second order. If the second and third orders are coincident, the ArriveDepartDelay value is not added between them because the vehicle doesn't need to move. If the route travels to a route renewal, the value is added to the travel time again.

    Although a vehicle needs to slow down and stop for a break and accelerate afterward, the service cannot add the ArriveDepartDelay value for breaks. This means that if a route leaves an order, stops for a break, and continues to the next order, the arrive/depart delay is added only once, not twice.

    To illustrate, assume there are five coincident orders in a high-rise building, and they are serviced by three different routes. This means three arrive/depart delays would be incurred; that is, three drivers would need to separately find parking places and enter the same building. However, if the orders could be serviced by just one route instead, only one driver would need to park and enter the building—only one arrive/depart delay would be incurred. Since the service tries to minimize cost, it will try to limit the arrive/depart delays and thus choose the single-route option. (Note that multiple routes may need to be sent when other constraints—such as specialties, time windows, or capacities—require it.)

    The unit for this attribute value is specified by the time_units parameter.

  • Capacitiesstring (length: 128)

    The maximum capacity of the vehicle. You can specify capacity in any dimension you want, such as weight, volume, or quantity. You can even specify multiple dimensions, for example, weight and volume.

    Specify capacities without indicating units. For example, assume your vehicle can carry a maximum of 40,000 pounds; you would specify 40000 as the value for the Capacities attribute. You need to remember for future reference that the value is in pounds.

    If you are tracking multiple dimensions, separate the numeric values with a space. For instance, if you are recording both weight and volume and your vehicle can carry a maximum weight of 40,000 pounds and a maximum volume of 2,000 cubic feet, Capacities should be specified as 40000 2000. Again, you need to remember the units. You also need to remember the sequence in which the values and their corresponding units are specified (pounds followed by cubic feet in this case).

    Remembering the units and the unit sequence is important for a couple of reasons: first, so you can reinterpret the information later, and second, so you can properly enter values for the DeliveryQuantities and PickupQuantities attributes in the orders parameter. To elaborate on the second point, note that the service simultaneously refers to Capacities, DeliveryQuantities, and PickupQuantities attributes to make sure that a route doesn't become overloaded. Since units can't be entered in the field, the service can't make unit conversions, so you need to specify the values for the three attributes using the same units and the same unit sequence to ensure the values are correctly interpreted. If you mix units or change the sequence in any of the three attributes, you will get unwanted results without receiving any warning messages. Thus, it is a good idea to set up a unit and unit-sequence standard beforehand and continually refer to it whenever specifying values for these three attributes.

    If the Capacities string has an insufficient number of values in relation to the DeliveryQuantities or PickupQuantities attributes in the orders parameter, the unspecified values are treated as infinity.

  • FixedCostnumber (non-negative)

    A fixed monetary cost that is incurred only if the route is used in a solution (that is, it has orders assigned to it). This attribute can contain null values; a null value indicates zero fixed cost. This cost is part of the total route operating cost.

  • CostPerUnitTimenumber (non-negative)

    The monetary cost incurred (per unit of work time) for the total route duration, including travel times as well as service times and wait times at orders, depots, and breaks. This attribute can't contain a null value and has a default value of 1.0. The unit for this attribute value is specified by the time_units parameter.

  • CostPerUnitDistancenumber (non-negative)

    The monetary cost incurred—per unit of distance traveled—for the route length (total travel distance). This attribute can contain null values; a null value indicates zero cost. The unit for this attribute value is specified by the distance_units parameter.

  • OverTimeStartTimenumber (non-negative)

    The duration of regular work time before overtime computation begins. This attribute can contain null values; a null value indicates that overtime does not apply. The unit for this attribute value is specified by the time_units parameter.

    For example, if the driver is to be paid overtime pay when the total route duration extends beyond eight hours, OvertimeStartTime is specified as 480 (8 hours * 60 minutes/hour), given the time_units parameter is set to Minutes.

  • CostPerUnitOvertimenumber (non-negative)

    The monetary cost incurred per time unit of overtime work. This attribute can contain null values; a null value indicates that the CostPerUnitOvertime value is the same as the CostPerUnitTime value. The unit for this attribute value is specified by the time_units parameter.

  • MaxOrderCountinteger

    The maximum allowable number of orders on the route. This attribute can't contain null values and has a default value of 30.

  • MaxTotalTimenumber (non-negative)

    The maximum allowable route duration. The route duration includes travel times as well as service and wait times at orders, depots, and breaks. This attribute can contain null values; a null value indicates that there is no constraint on the route duration. The unit for this attribute value is specified by the time_units parameter.

  • MaxTotalTravelTimenumber (non-negative)

    The maximum allowable travel time for the route. The travel time includes only the time spent driving on the streets and does not include service or wait times. This attribute can contain null values; a null value indicates there is no constraint on the maximum allowable travel time. This attribute value can't be larger than the MaxTotalTime attribute value. The unit for this attribute value is specified by the time_units parameter.

  • MaxTotalDistancenumber (non-negative)

    The maximum allowable travel distance for the route. This attribute can contain null values; a null value indicates that there is no constraint on the maximum allowable travel distance. The unit for this attribute value is specified by the distance_units parameter.

  • SpecialtyNamesstr (length: 1024)

    A space-separated string containing the names of the specialties supported by the route. A null value indicates that the route does not support any specialties. This attribute is a foreign key to the SpecialtyNames attribute in the orders parameter, so the values must match.

    To illustrate what specialties are and how they work, assume a lawn care and tree trimming company has a portion of its orders that requires a bucket truck to trim tall trees. The company would specify BucketTruck as the value for the SpecialtyNames attribute for these orders to indicate their special need. SpecialtyNames would be left as null for the other orders. Similarly, the company would also specify BucketTruck as the value for the SpecialtyNames attribute for the routes that are driven by trucks with hydraulic booms. It would leave the attribute value as null for the other routes. When finding the solution, the service assigns orders without special needs to any route, but it only assigns orders that need bucket trucks to routes that have them.

  • AssignmentRuleint enumdefault:1

    Allowed values: 0, 1

    Specifies whether the route can be used or not when solving the problem. The attribute value should be specified as one of the following integer values:

    • 0 —The route is excluded from the solution.
    • 1 —The route is included when finding the solution.

Example

This example shows how to specify attributes for the routes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "features": [
    {
      "attributes": {
        "Name": "Truck1",
        "Capacities": "40000 2000",
        "StartDepotName": "Depot1",
        "EndDepotName": "Depot1",
        "SpecialtyNames": "BucketTruck"
      }
    },
    {
      "attributes": {
        "Name": "Truck2",
        "Capacities": "30000 2500",
        "StartDepotName": "Depot2",
        "EndDepotName": "Depot2",
        "SpecialtyNames": null
      }
    }
Expand

Optional parameters

travel_modes

Choose the mode of transportation for the analysis.

Travel modes are managed and configured in ArcGIS Online by the administrator of your organization to better reflect the organization's workflows.

In the example below, the following is a string representing the Walking Time travel mode as returned by the GetTravelModes tool:

Use dark colors for code blocksCopy
1
"{\"attributeParameterValues\": [{\"attributeName\": \"Avoid Private Roads\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_MEDIUM\"}, {\"attributeName\": \"Walking\", \"parameterName\": \"Restriction Usage\", \"value\": \"PROHIBITED\"}, {\"attributeName\": \"Preferred for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"PREFER_LOW\"}, {\"attributeName\": \"WalkTime\", \"parameterName\": \"Walking Speed (km/h)\", \"value\": 5}, {\"attributeName\": \"Avoid Roads Unsuitable for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_HIGH\"}], \"description\": \"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.\", \"distanceAttributeName\": \"Kilometers\", \"id\": \"caFAgoThrvUpkFBW\", \"impedanceAttributeName\": \"WalkTime\", \"name\": \"Walking Time\", \"restrictionAttributeNames\": [\"Avoid Private Roads\", \"Avoid Roads Unsuitable for Pedestrians\", \"Preferred for Pedestrians\", \"Walking\"], \"simplificationTolerance\": 2, \"simplificationToleranceUnits\": \"esriMeters\", \"timeAttributeName\": \"WalkTime\", \"type\": \"WALK\", \"useHierarchy\": false, \"uturnAtJunctions\": \"esriNFSBAllowBacktrack\"}"

The value above should be converted to a valid JSON object and passed as the value for the travel_mode parameter as shown below.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "attributeParameterValues": [
    {
      "attributeName": "Avoid Private Roads",
      "parameterName": "Restriction Usage",
      "value": "AVOID_MEDIUM"
    },
    {
      "attributeName": "Walking",
      "parameterName": "Restriction Usage",
      "value": "PROHIBITED"
    },
    {
      "attributeName": "Preferred for Pedestrians",
      "parameterName": "Restriction Usage",
      "value": "PREFER_LOW"
    },
    {
      "attributeName": "WalkTime",
      "parameterName": "Walking Speed (km/h)",
Expand

locate_Settings

Specify settings that affect how inputs are located, such as the maximum search distance to use when locating the inputs on the network or the network sources being used for locating.

The default value is as follows:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 20000,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "main.Routing_Streets"
      }
    ]
  }
}

You can specify locate settings and can override locate settings for individual features such as, orders, depots, point_barriers, line_barriers, and polygon_barriers through locator JSON object.

Show examples

Example for locate_settings

Example 1: Specify locate settings using a JSON structure

This example shows how to specify locate settings so inputs are only located within 500 meters of the specified location. A small search tolerance like this can be helpful if you are solving using a walking travel mode and don't want inputs to be located farther than 500 meters from the original point location.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 500,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "Routing_Streets"
      }
    ]
  }
}

analysis_region

Allowed values: Europe, Japan, Korea, MiddleEast MiddleEastAndAfrica, NorthAmerica, SouthAmerica, SouthAsia, Thailand

Specify the region in which to perform the analysis. If a value is not specified for this parameter, the service will automatically calculate the region name based on the location of the input points. Setting the name of the region is recommended to speed up the analysis.

The data coverage page lists the countries that are grouped into each of these regions.

time_zone_usage_for_time_fields

Allowed values: GEO_LOCAL, UTC

Specify the time zone for the input date-time fields. This parameter specifies the time zone for the following fields: TimeWindowStart1, TimeWindowEnd1, TimeWindowStart2, TimeWindowEnd2, InboundArriveTime, and OutboundDepartTime on orders; TimeWindowStart1, TimeWindowEnd1, TimeWindowStart2, and TimeWindowEnd2 on depots; EarliestStartTime and LatestStartTime on routes; and TimeWindowStart and TimeWindowEnd on breaks .

  • GEO_LOCAL—The date-time values associated with the orders or depots are in the time zone in which the orders and depots are located. For routes, the date-time values are based on the time zone in which the starting depot for the route is located. If a route does not have a starting depot, all orders and depots across all the routes must be in a single time zone. For breaks, the date-time values are based on the time zone of the routes. For example, if your depot is located in an area that follows eastern standard time and has the first time window values (specified as TimeWindowStart1 and TimeWindowEnd1) of 8 AM and 5 PM, the time window values will be treated as 8:00 a.m. and 5:00 p.m. in eastern standard time.
  • UTC—The date-time values associated with the orders or depots are in the in coordinated universal time (UTC) and are not based on the time zone in which the orders or depots are located. For example, if your depot is located in an area that follows eastern standard time and has the first time window values (specified as TimeWindowStart1 and TimeWindowEnd1) of 8 AM and 5 PM, the time window values will be treated as 3:00 a.m. and 12:00 p.m. in eastern standard time.

default_date

Specify the date on which all the routes start.

The parameter value should be specified as a numeric value representing the milliseconds since midnight, January 1, 1970.

Only the date portion of this value will be used; the time-specific portion of the value will be ignored.

You can use the same value that you have specified for the EarliestStartTime attribute for each route feature in the routes parameter. If your routes start on different dates, you can pick any date from one of them.

breaks

Specify the rest periods, or breaks, for the routes in a given fleet routing problem. A break is associated with exactly one route, and it can be taken after completing an order, while en route to an order, or prior to servicing an order. It has a start time and a duration, for which the driver may or may not be paid. There are three options for establishing when a break begins: using a time window, a maximum travel time, or a maximum work time.

  • Time window break—To set up a time window break, enter two time-of-day values to delimit a time range in which the break should begin. The TimeWindowStart and TimeWindowEnd attributes hold the bounding time-of-day values. The duration, or service time, of the break is independent of the time window and, therefore, can extend beyond the end of the time window. For instance, if the time window for an hour-long break spans from 10:00 a.m. to 10:15 a.m., the break should start after 10:00 a.m. but before 10:15 a.m. If it starts at 10:10 a.m., the break will end at 11:10 a.m.
  • Maximum travel time break—With this kind of break, you specify how long a person can drive before the break is required. (Note that only travel time is limited, not other times such as wait and service times.) If you enter four hours into the first break's MaxTravelTimeBetweenBreaks property, for example, the driver will receive a break before the accumulated travel time from the start of the route exceeds four hours. For any subsequent breaks, the travel time is accumulated from the previous break. So if you have a second break with a MaxTravelTimeBetweenBreaks value of two hours, the second break will be taken before two hours of travel time have been accumulated from the previous break, not from the start depot. A route's final maximum travel time break not only limits the amount of accumulated travel time from the previous break or start of the route but also limits the travel time from the final break to the end depot. This is true even if there is only one break. The fleet routing service is designed this way to prevent a route from taking all its breaks and then traveling for an extended period without taking another break. In the last example, MaxTravelTimeBetweenBreaks was set to two hours. If this is the route's final break, the route must be able to reach the end depot within two hours of travel time from the final break; otherwise, the service will return an error.
  • Maximum work time break—This break specifies how long a person can work before a break is required. Unlike maximum travel time breaks, which can accumulate travel time from the end of the last break, maximum work time breaks always accumulate work time from the beginning of the route, including any service time at the start depot. Note that this break limits the accumulated work time, which includes travel time and all service times; it excludes wait time, however.
Show attributes for breaks

Attributes for breaks

  • RouteNamestring (length: 1024)

    The name of the route that the break applies to. Although a break is assigned to exactly one route, many breaks can be assigned to the same route. This attribute is a foreign key to the Name attribute in the routes parameter, so the values must match. The attribute cannot have a null value.

  • Precedenceintegerdefault:1

    Specify the values to sequence the breaks of a given route. Breaks with a precedence value of 1 occur before those with a value of 2, and so on. All breaks must have a precedence value, regardless of whether they are time window, maximum travel time, or maximum work time breaks.

  • ServiceTimenumber (non-negative)default:60

    The duration of the break. The units for this attribute value are specified by the time_units parameter. This attribute can't contain a null value.

  • TimeWindowStartdatetimedefault:null

    The starting time of the break's time window. Specifying this attribute indicates that the service should consider the breaks as time window breaks. The attribute value is specified as a numeric value representing the milliseconds since midnight, January 1, 1970.

    If this attribute is null and the TimeWindowEnd attribute has a valid time-of-day value, the break is allowed to start anytime before the TimeWindowEnd value.

  • TimeWindowEnddatetimedefault:null

    The ending time of the break's time window. Specifying this attribute indicates that the service should consider the breaks as time window breaks. The attribute value is specified as a numeric value representing the milliseconds since midnight, January 1, 1970.

    If this attribute is null and the TimeWindowStart attribute has a valid time-of-day value, the break is allowed to start anytime after the TimeWindowStart value.

    For both the TimeWindowStart and TimeWindowEnd attributes, the time zone is specified by the time_zone_usage_for_time_fields parameter. If the parameter is set to GEO_LOCAL , the time is in the time zone where the route's depot is located. This is useful if your routes span multiple time zones but they all break at a consistent time (for example, 12:00 p.m. in the depot's time zone). If the parameter is set to UTC, the time is based on UTC time. This is useful if you don't know the time zone of an individual route's depot but know the absolute time for each break (for example, the break starts an hour from now).

  • MaxViolationTimenumber (non-negative)default:null

    The maximum allowable violation time for a time window break. A time window is considered violated if the arrival time falls outside of the time range. The units for this attribute value are specified by the time_units parameter.

    A zero value indicates the time window cannot be violated; that is, the time window is hard. A nonzero value specifies the maximum amount of lateness; for example, the break can begin up to 30 minutes beyond the end of its time window, but the lateness is penalized as per the time_window_factor parameter. A null value indicates that there is no limit on the allowable violation time.

  • MaxTravelTimeBetweenBreaksnumber (non-negative)default:null

    The maximum amount of travel time that can be accumulated before the break is taken. Specifying this attribute indicates that the service should consider the breaks as travel time breaks. The travel time is accumulated either from the end of the previous break or, if a break has not yet been taken, from the start of the route. If this is the route's final break, this attribute also indicates the maximum travel time that can be accumulated from the final break to the end depot.

    The MaxTravelTimeBetweenBreaks attribute is designed to limit how long a person can drive until a break is required. For instance, if the time_units parameter is set to Minutes , and MaxTravelTimeBetweenBreaks has a value of 120, the driver will get a break after two hours of driving. To assign a second break after two more hours of driving, the second break's MaxTravelTimeBetweenBreaks attribute value should be 120.

    The units for this attribute value are specified by the time_units parameter.

  • MaxCumulWorkTimenumber (non-negative)default:null

    The maximum amount of work time that can be accumulated before the break is taken. Specifying this attribute indicates that the service should consider the breaks as work time breaks. Work time is always accumulated from the beginning of the route. Work time is the sum of travel time and service times at orders, depots, and breaks. Note, however, that this excludes wait time, which is the time a route (or driver) spends waiting at an order or depot for a time window to begin.

    The MaxCumulWorkTime attribute is designed to limit how long a person can work until a break is required. For instance, if the time_units parameter is set to Minutes, the MaxCumulWorkTime attribute has a value of 120, and the ServiceTime attribute has a value of 15, the driver will get a 15-minute break after two hours of work. If a second break is needed after three more hours of work, you would specify 315 (five hours and 15 minutes) as the second break's MaxCumulWorkTime value. This number includes the MaxCumulWorkTime and ServiceTime values of the preceding break, along with the three additional hours of work time before granting the second break. To avoid taking maximum work time breaks prematurely, remember that they accumulate work time from the beginning of the route and that work time includes the service time at previously visited depots, orders, and breaks.

    The units for this attribute value are specified by the time_units parameter.

  • IsPaidintegerdefault:1

    Specifies whether the break is paid or unpaid. The attribute value is specified as an integer with possible values being 0 or 1. A value of 1 indicates that the time spent at the break is included in the route cost computation and overtime determination. A value of 0 indicates otherwise.

  • Sequenceintegerdefault:null

    Indicates the relative sequence of the break on its route. The attribute values must be positive and unique for each route but need not start from 1 or be contiguous. In the service output, the Sequence attribute of the out_stops parameter contains the sequence value of the break on its route. This attribute can have null values specifying that the break can be placed anywhere along the route.

Example

This example shows how to specify time-window-based breaks by specifying the values for the TimeWindowStart and the TimeWindowEnd attributes. The input fleet routing problem requires that each of three routes have one 30-minute paid break between 12:30 p.m. and 1:30 p.m. The break time window is rigid, so the break has to start between 12:30 p.m. and 1:30 p.m. and cannot start after 1:30 p.m.

You need to specify one break for each route, so you have a total of three features. Specify the appropriate milliseconds since January 1, 1970, for 12:30 p.m. Pacific time on April 23, 2013, as the value for the TimeWindowStart attribute and the appropriate milliseconds since January 1, 1970, for 1:30 p.m. on April 23, 2013, as the value for the TimeWindowEnd attribute. Because the break time window is rigid, specify a value of 0 for the MaxViolationTime attribute. Because the break duration is 30 minutes, specify a value of 30 for the ServiceTime attribute assuming the time_units parameter is set to Minutes. For each break, only specify the attribute values required to model the input scenario. The other attribute values are not specified because their default values are adequate in this scenario.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  "features": [
    {
      "attributes": {
        "RouteName": "Truck1",
        "TimeWindowStart": 1366745400000,
        "TimeWindowEnd": 1366749000000,
        "ServiceTime": 30,
        "MaxViolationTime": 0
      }
    },
    {
      "attributes": {
        "RouteName": "Truck2",
        "TimeWindowStart": 1366745400000,
        "TimeWindowEnd": 1366749000000,
        "ServiceTime": 30,
        "MaxViolationTime": 0
      }
    },
Expand

time_units

Allowed values: Seconds, Minutes, Hours, Days

Specify the time units for all time-based attribute values specified with different parameters.

Many parameters in the vehicle routing problem request have attributes for storing time values, such as ServiceTime for the orders parameter and CostPerUnitTime for the routes parameter. To minimize data entry requirements, these attribute values don't include units. Instead, all time-based attribute values must be entered in the same units, and the time_units parameter is used to specify the units of those values.

distance_units

Allowed values: Miles, Kilometers, Meters, Feet, Yards, NauticalMiles

Specify the units for all distance-based attribute values specified with different parameters.

Many parameters in the vehicle routing problem request have attributes for storing distance values, such as MaxTotalDistance and CostPerUnitDistance for the routes parameter. To minimize data entry requirements, these attribute values don't include units. Instead, all distance-based attribute values must be entered in the same units, and the distance_units parameter is used to specify the units of those values.

time_window_factor

Allowed values: Low, Medium, High

Specify the importance of honoring time windows without causing violations. A time window violation occurs when a route arrives at an order, depot, or break after a time window has closed. The parameter is specified using one of the following values:

  • Low—Places more importance on minimizing drive times and less on arriving at stops on time. You may want to use this value if you have a growing backlog of service requests. For the purpose of servicing more orders in a day and reducing the backlog, you can choose Low even though customers might be inconvenienced with your late arrivals.
  • Medium—Balances the importance of minimizing drive times and arriving within time windows.
  • High—Places more importance on arriving at stops on time than on minimizing drive times. Organizations that make time-critical deliveries or that are very concerned with customer service would choose a value of High.

The vehicle routing problem solution can change according to the value you choose for the time_window_factor parameter. The next two images show the same set of orders and depots; however, the routes are not the same because different time_window_factor values were used. The image on the left shows the route that resulted from the time_window_factor parameter set to Low. The route is short, but it has a time window violation. If time_window_factor is set to High, the route meets all the time windows, but it is longer because it services the order with a time window first.

Low importance

Low importance

High importance

High importance

spatially_cluster_routes

Specify if orders assigned to an individual route are spatially clustered.

  • true—Indicates that the orders assigned to an individual route are spatially clustered by automatically creating dynamic seed points for all the routes. Clustering orders usually results in routes that cover a smaller area and don't intersect other routes as much, but the overall cost of the solution could be more. You might want to cluster orders to keep drivers in general neighborhoods or regions that they are familiar with, or you might want to have compartmentalized routes if they are easier for your organization to manage.
  • false—Indicates that the orders assigned to an individual route are not spatially clustered. Use this value if you have predefined work territories for the routes that are specified using the route_zones parameter.

route_zones

Delineates work territories for given routes. A route zone is a polygon feature used to constrain routes to servicing only those orders that fall within or near the specified area. The following are examples of when route zones may be useful:

  • Some of your employees don't have the required permits to perform work in certain states or communities. You can create a hard route zone so they only visit orders in areas where they meet the requirements.
  • One of your vehicles breaks down frequently and you want to minimize response time by having it only visit orders that are close to your maintenance garage. You can create a soft or hard route zone to keep the vehicle nearby.

You can specify additional information about route zones with the following attributes:

Show attributes for route zones

Attributes for route zones

  • RouteNamestring (length: 1024)

    The name of the route to which this zone applies. A route zone can have a maximum of one associated route. This attribute is a foreign key to the Name attribute in the routes parameter, so the values must match. The attribute cannot have a null value.

  • IsHardZoneint enumdefault:null

    Allowed values: 0, 1

    Specify if the route zone is hard or soft. The attribute value is specified as an integer with possible values being 0 or 1. A value of 1 indicates that the route zone is hard; that is, an order that falls outside of the route zone area can't be assigned to the route. A value of 0 indicates that such orders can still be assigned, but the cost of servicing the order is weighted by a function that is based on the Euclidean distance from the route zone. Basically, this means that as the straight-line distance from the soft zone to the order increases, the likelihood of the order being assigned to the route decreases.

Example

The example shows how to add route zones associated with the routes in a fleet routing problem. The two routes in the input fleet routing problem are operated by vans that are only licensed to service orders in a predetermined area and so cannot service orders that are outside of the route zone. Therefore, the IsHardZone attribute value is set to 1 to ensure that the vans are only assigned orders that are within the route zones.

The first zone is a single-part polygon feature made up of four points. The second zone is a two-part polygon feature in which both parts are made up of four points. The barrier geometries are in the spatial reference of the network dataset. Therefore, the spatialReference property is not required.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  "features": [
    {
      "geometry": {
        "rings": [
          [
            [-97.0634, 32.8442],
            [-97.0554, 32.84],
            [-97.0558, 32.8327],
            [-97.0638, 32.83],
            [-97.0634, 32.8442]
          ]
        ]
      },
      "attributes": {
        "RouteName": "East Bay Route",
        "IsHardZone": 1
      }
    },
    {
Expand

route_renewals

Specify the intermediate depots that routes can visit to reload or unload the cargo they are delivering or picking up. Specifically, a route renewal links a route to a depot. The relationship indicates the route can renew (reload or unload while en route) at the associated depot.

Route renewals can be used to model scenarios in which a vehicle picks up a full load of deliveries at the starting depot, services the orders, returns to the depot to renew its load of deliveries, and continues servicing more orders. For example, in propane gas delivery, the vehicle may make several deliveries until its tank is nearly or completely depleted, visit a refueling point, and make more deliveries.

Here are a few rules and options to consider:

  • The reload/unload point, or renewal location, can be different from the start or end depot.
  • Each route can have one or many predetermined renewal locations.
  • A renewal location can be used more than once by a single route.
  • In cases where there may be several potential renewal locations for a route, the closest available renewal location is identified by the solver.
Show attributes for route renewals

Attributes for route renewals

  • RouteNamestring (length: 1024)

    The name of the route that this renewal applies to. This attribute is a foreign key to the Name attribute in the routes parameter, so the values must match. The attribute cannot have a null value.

  • DepotNamestring (length: 1024)

    The name of the depot where this renewal takes place. This attribute is a foreign key to the Name attribute in the depots parameter, so the values must match. The attribute cannot have a null value.

  • ServiceTimenumber (non-negative)default:60

    The service time for the renewal. This attribute can contain a null value; a null value indicates zero service time. The units for this attribute value are specified by the time_units parameter.

  • Sequenceintegerdefault:null

Specify one or more sequences of visits to the renewal depot. This attribute can be used to preassign visits to the renewal depot. The attribute value is specified as a space-separated string of sequence values. The attribute can contain a null value; a null value indicates that the service will determine the best sequence to visit the renewal depot.

Example

In this example, a distribution company makes deliveries from a central depot using two trucks. Over time, the distribution company also acquired two additional satellite distribution centers. These centers can be used by the trucks to renew their truckload while making their deliveries instead of returning to the main distribution center for renewal. So the new distribution centers are specified as route renewals when solving the fleet routing problem, and the service selects the best renewal locations that minimize the total cost.

You need to specify two route renewal locations for each route, so you have a total of four route renewal features. You identify the depot location that can be used for renewal using the DepotName attribute. You specify the name of the route the renewal applies to using the RouteName attribute. Because it takes 15 minutes to load the truck at the renewal location, specify 15 as the value for the ServiceTime attribute assuming the time_units parameter is set to Minutes . The other attribute values are not specified because their default values are adequate in this scenario.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "features": [
    {
      "attributes": {
        "RouteName": "Truck1",
        "DepotName": "800 Brush St",
        "ServiceTime": 15
      }
    },
    {
      "attributes": {
        "RouteName": "Truck1",
        "DepotName": "100 Old County Rd",
        "ServiceTime": 15
      }
    },
    {
      "attributes": {
        "RouteName": "Truck2",
        "DepotName": "800 Brush St",
Expand

order_pairs

Use this parameter to pair pickup and delivery orders so they are serviced by the same route.

Sometimes it is necessary for the pick up and delivery of orders to be paired. For example, a courier company may need to have a route pick up a high-priority package from one order and deliver it to another without returning to a depot, or sorting station, to minimize delivery time. These related orders can be assigned to the same route with the appropriate sequence using order pairs. Restrictions on how long the package can stay in the vehicle can also be assigned; for example, the package might be a blood sample that must be transported from the doctor's office to the lab within two hours.

Some situations may require two pairs of orders. For example, suppose you want to transport a senior citizen from her home to the doctor and then back home. The ride from her home to the doctor is one pair of orders with a desired arrival time at the doctor, while the ride from the doctor to her home is another pair with a desired pickup time.

Show attributes for order pairs

Attributes for order pairs

  • FirstOrderNamestring (length: 500)

    The name of the first order of the pair. This attribute is a foreign key to the Name attribute in the orders parameter, so the values must match. The attribute cannot have a null value.

  • SecondOrderNameNamestring (length: 500)

    The name of the second order of the pair. This attribute is a foreign key to the Name attribute in the orders parameter, so the values must match. The attribute cannot have a null value.

  • MaxTransitTimenumber (non-negative)default:60

    The maximum transit time for the pair. The transit time is the duration from the departure time of the first order to the arrival time at the second order. This constraint limits the time-on-vehicle, or ride time, between the two orders. When a vehicle is carrying people or perishable goods, the ride time is typically shorter than that of a vehicle carrying packages or nonperishable goods.

    Excess transit time (measured with respect to the direct travel time between order pairs) can be tracked and weighted by the service. Because of this, you can direct the service to take one of three approaches: minimize the overall excess transit time, regardless of the increase in travel cost for the fleet; find a solution that balances overall violation time and travel cost; or ignore the overall excess transit time and, instead, minimize the travel cost for the fleet. By assigning an importance level for the excess_transit_factor parameter, you are in effect choosing one of these three approaches. Regardless of the importance level, the service will always return an error if the MaxTransitTime attribute value is surpassed.

    This attribute can contain null values; a null value indicates that there is no constraint on the ride time. The default value for this attribute is null .

Example

In this example, a paratransit company needs to find the best routes for a fleet of vans to transport people who would otherwise not have access to transportation from their homes to different hospitals for medical appointments.

The hospital and patient locations are specified as the orders parameter. The passengers have to be taken to a predetermined hospital. For each patient-to-hospital pair, add a feature to the order_pairs parameter using patient name as the value for the FirstOrderName attribute and hospital name as the value for the SecondOrderName attribute. The maximum time in minutes that the patients can sit in the van during a one-way trip is specified using the MaxTransitTime attribute.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "features": [
    {
      "attributes": {
        "FirstOrderName": "Mark (Home)",
        "SecondOrderName": "Mark (Doctor)",
        "MaxTransitTime": 30
      }
    },
    {
      "attributes": {
        "FirstOrderName": "Tom (Home)",
        "SecondOrderName": "Tom (Doctor)",
        "MaxTransitTime": 20
      }
    },
    {
      "attributes": {
        "FirstOrderName": "Bob (Home)",
        "SecondOrderName": "Bob (Doctor)",
Expand

excess_transit_factor

Allowed values: Low, Medium, High

Use this parameter to rate the importance of reducing excess transit time of order pairs. Excess transit time is the amount of time exceeding the time required to travel directly between the paired orders. Excess time can be caused by driver breaks or travel to intermediate orders and depots.

Calculating excess transit time

Calculating excess transit time

The parameter is specified using one of the following values:

  • Low—The service tries to find a solution that minimizes overall solution cost, regardless of excess transit time. This value is commonly used with courier services. Since couriers transport packages as opposed to people, they don't need to worry about ride time. Using Low allows the couriers to service paired orders in the proper sequence and minimize the overall solution cost.
  • Medium—The service looks for a balance between reducing excess transit time and reducing the overall solution cost.
  • High—The service tries to find a solution with the least excess transit time between paired orders at the expense of increasing the overall travel costs. It makes sense to use this value if you are transporting people between paired orders and you want to shorten their ride time. This is characteristic of taxi services.

The vehicle routing problem solution can change according to the value you choose for the excess_transit_factor parameter. The next two images show the same set of orders and depots; however, the routes are not the same because different excess_transit_factor values were used. The image on the left shows the route that resulted when the excess_transit_factor parameter was set to Low . The overall route is short, but the travel time from the first order to its paired order, the airport, is long. If the excess_transit_factor is set to High, the route reduces the time between the first order and the airport while maintaining the same ride time to the airport for the order on the right; however, the overall cost of the route increases.

Low importance

Low importance (courier)

High importance

High importance (taxi)

uturn_policy

Allowed values: ALLOW_UTURN, ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY, ALLOW_DEAD_ENDS_ONLY, NO_UTURNS

Specify whether to restrict or permit the route from making U-turns at junctions.

To understand the available parameter values, a junction is a point where only two streets intersect each other. If three or more streets intersect at a point, it is called as an intersection. A cul-de-sac is a dead-end.

This parameter can have the following values:

Expand to learn more about the available parameter values
Parameter ValueDescription

ALLOW_UTURNS

U-turns are permitted everywhere. Permitting U-turns implies that the vehicle can turn around at a junction and double back on the same street.

U-turns permitted

U-turns are permitted at junctions with any number of adjacent streets.

ALLOW_DEAD_ENDS_AND_INTERSECTIONS_ONLY

U-turns are prohibited at junctions where exactly two adjacent streets meet.

U-turns permitted only at intersections and dead-ends

U-turns are permitted only at intersections or dead ends.

ALLOW_DEAD_ENDS_ONLY

U-turns are prohibited at all junctions and intersections and are permitted only at dead ends.

U-turns permitted only at dead-ends

U-turns are permitted only at dead ends.

NO_UTURNS

U-turns are prohibited at all junctions, intersections, and dead-ends. Even when this parameter value is chosen, a route can still make U-turns at stops. To prohibit U-turns at a stop, you can set its CurbApproach property to the appropriate value (3).

point_barriers

Specify one or more points that will act as temporary restrictions or represent additional time or distance that may be required to travel on the underlying streets. For example, a point barrier can be used to represent a fallen tree along a street or a time delay spent at a railroad crossing.

When specifying point barriers, you can set properties for each, such as its name or barrier type.

Show attributes for point_barriers

Attributes for point_barriers

  • Namestringnullable

    The name of the barrier.

  • CurbApproachint enumdefault:0

    Allowed values: 0, 1, 2

    Specify the direction of traffic that is affected by the barrier. The field value is specified as one of the following integers:

    • 0: Either side of vehicle. The barrier affects travel over the edge in both directions.
    • 1: Right side of vehicle. Vehicles are only affected if the barrier is on their right side during the approach. Vehicles that traverse the same edge but approach the barrier on their left side are not affected by the barrier.
    • 2: Vehicles are only affected if the barrier is on their left side during the approach. Vehicles that traverse the same edge but approach the barrier on their right side are not affected by the barrier.

    Because junctions are points and don't have a side, barriers on junctions affect all vehicles regardless of the curb approach.

  • BarrierTypeint enumdefault:0

    Allowed values: 0, 2

    Specify whether the point barrier restricts travel completely or adds time or distance when it is crossed.

    The value for this attribute is specified as one of the following integers:

    • 0: Restriction. Prohibits travel through the barrier. The barrier is referred to as a restriction point barrier since it acts as a restriction.

      Two maps demonstrate how a restriction point barrier affects a route analysis.

      The first map shows the shortest path between two stops without any restriction point barriers. The second map has a road that is blocked by a fallen tree, so the shortest path between the same points is longer.

    • 2: Added Cost. Traveling through the barrier increases the travel time or distance by the amount specified in the Additional_Time, Additional_Distance, or AdditionalCost attribute. This barrier type is referred to as an added cost point barrier.
    Two maps demonstrate how added cost point barriers affect a route analysis.

    The map on the left shows the shortest path between two stops without any added cost point barrier. For the map on the right, the travel time from stop one to stop two would be the same whether going around the north end of the block or the south end; however, since crossing railroad tracks incurs a time penalty (modeled with added cost point barriers), the route with only one railroad crossing is chosen. The cost of crossing the barrier is added to the accumulated travel time of the resulting route.

  • FullEdgeint enumdefault:0

    Allowed values: 0, 1

    Specify how the restriction point barriers are applied to the edge elements during the analysis

    • 0:False—Permits travel on the edge up to the barrier but not through it.
    • 1:True—Restricts travel anywhere on the associated edge.
  • Additional_Timenumber (non-negative)default:0

    The added travel time when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

  • Additional_Distancenumber (non-negative)default:0

    The added distance when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

  • AdditionalCostnumber (non-negative)default:0

    The added cost when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero.

  • Bearingnumber (non-negative)nullable

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north.

    This attribute is used in conjunction with the BearingTol attribute. Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle. Using this attribute tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the solver determine the side of the street that the point is on.

    Learn more about bearing and bearing tolerance

  • BearingTolnumber (range: 0 - 180)default:30nullable

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing attribute.

    If the Bearing attribute value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated. The units are in degrees. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatencynumber (non-negative)nullable

    Indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    This attribute is only used in the solve process if the Bearing and BearingTol fields also have values; however, providing a NavLatency attribute value is optional, even when values are present in the Bearing and BearingTol.

Show example

This example shows how to use an added cost point barrier to model a five-minute delay at a railroad crossing. The BarrierType attribute is used to specify that the point barrier is of type added cost and the Attr_TravelTime attribute is used to specify the delay in minutes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "spatialReference": {
    "wkid": 4326
  },
  "features": [
    {
      "geometry": {
        "x": 37.541479,
        "y": -122.053461
      },
      "attributes": {
        "Name": "Haley St railroad crossing",
        "BarrierType": 2,
        "Additional_Time": 5
      }
    }
  ]
}

line_barriers

Specify one or more lines that prohibit travel anywhere the lines intersect the streets. For example, a parade or protest that blocks traffic across several street segments can be modeled with a line barrier. A line barrier can also quickly fence off several roads from being traversed, thereby channeling possible routes away from undesirable parts of the street network.

Two maps demonstrate how a line barrier affects finding a route between two stops.

The first map displays the shortest path between two stops. The second map shows the shortest path when several streets are blocked by a polyline barrier.

When specifying line barriers, you can set the name of each barrier using the following attribute:

Show attributes for line_barriers

Attributes for line_barriers

  • Namestring (length: 500)nullable

    The name of the barrier.

Show example

This example shows how to add two lines as polyline barriers to restrict travel on the streets intersected by the lines. Barrier 1 is a single-part line feature composed of two points. Barrier 2 is a two-part line feature. The first part is composed of three points, and the second part is composed of two points.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "spatialReference": {
    "wkid": 102100
  },
  "features": [
    {
      "geometry": {
        "paths": [
          [
            [-10804823.397, 3873688.372],
            [-10804811.152, 3873025.945]
          ]
        ]
      },
      "attributes": {
        "Name": "Barrier 1"
      }
    },
    {
      "geometry": {
Expand

polygon_barriers

Specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

When specifying polygon barriers, you can set properties for each, such as its name or barrier type, using the following attributes:

Show attributes for polygon_barriers

Attributes for polygon_barriers

  • Namestringnullable

    The name of the barrier.

  • BarrierTypeint enumdefault:0

    Allowed values: 0, 1

    Specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

    The value for this attribute can be specified as one of the following integers:

    • 0: Restriction. Prohibits traveling through any part of the barrier. The barrier is referred to as a restriction polygon barrier since it prohibits traveling on streets intersected by the barrier. One use of this type of barrier is to model floods covering areas of the street that make traveling on those streets impossible.

      Two maps demonstrate how a restriction polygon barrier affects finding a route between two stops.

      The first map depicts the shortest path between two stops. The second map shows a polygon barrier blocking flooded streets, so the shortest path between the same two stops is different.

    • 1: Scaled Cost. Scales the cost (such as travel time or distance) required to travel the underlying streets by a factor specified using the ScaledTimeFactor or ScaledDistanceFactor attribute.

      If the streets are partially covered by the barrier, the travel time or distance is apportioned and then scaled. For example, a factor of 0.25 means that travel on underlying streets is expected to be four times faster than normal. A factor of 3.0 means it is expected to take three times longer than normal to travel on underlying streets. This barrier type is referred to as a scaled-cost polygon barrier. It can be used to model storms that reduce travel speeds in specific regions, for example.

    Two maps demonstrate how a scaled cost polygon barrier affects finding a route between two stops.

    The first map shows a route that goes through inclement weather without regard for the effect that poor road conditions have on travel time. The second map shows a scaled polygon barrier that doubles the travel time of the roads covered by the storm. The route still passes through the southern tip of the storm since it is quicker to spend more time driving slowly through a small part of the storm rather than driving completely around it. The service uses the modified travel time in calculating the best route, and the modified travel time is reported as the total travel time in the response.

  • ScaledTimeFactornumber (non-negative)default:1

    This is the factor by which the travel time of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is time-based.

  • ScaledDistanceFactornumber (non-negative)default:1

    This is the factor by which the distance of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is distance-based.

  • ScaledCostFactornumber (non-negative)default:1

    The scaled cost when the barrier is traversed. This attribute is applicable only for scaled-cost barriers. The attribute value must be greater than or equal to zero.

    This field is applicable only for scaled-cost barriers when the impedance is neither time-based nor distance-based.

Show example

This example shows how to add two polygons as barriers. The first polygon, Flood zone, is a restriction polygon barrier that prohibits travel on the underlying streets. The polygon is a single-part polygon feature composed of four points. The second polygon, Severe weather zone, is a scaled-cost polygon barrier that reduces the travel time on underlying streets to one-third of the original value. The polygon is a two-part polygon feature. Both parts are composed of four points.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  "spatialReference": {
    "wkid": 4326
  },
  "features": [
    {
      "geometry": {
        "rings": [
          [
            [-97.0634, 32.8442],
            [-97.0554, 32.84],
            [-97.0558, 32.8327],
            [-97.0638, 32.83],
            [-97.0634, 32.8442]
          ]
        ]
      },
      "attributes": {
        "Name": "Flood zone",
        "BarrierType": 0
Expand

use_hierarchy_in_analysis

Specify whether hierarchy will be used when finding the shortest paths.

  • true—Use hierarchy when travelling between stops. When hierarchy is used, the service prefers higher-order streets (such as freeways) to lower-order streets (such as local roads) and can be used to simulate the driver preference of traveling on freeways instead of local roads even if that means a longer trip. This is especially true when finding routes to faraway locations, because drivers on long-distance trips tend to prefer traveling on freeways where stops, intersections, and turns can be avoided. Using hierarchy is computationally faster, especially for long-distance routes, since the service can determine the best route from a relatively smaller subset of streets.
  • false—Do not use hierarchy when travelling between stops. When hierarchy is not used, the service considers all the streets and doesn't prefer higher-order streets when finding the route. This is often used when finding short-distance routes within a city.

restrictions

Specify whether the restrictions will be honored by the service.

A restriction represents a driving preference or requirement. In most cases, restrictions cause roads or pathways to be prohibited, but they can also cause them to be avoided or preferred. For instance, using the Avoid Toll Roads restriction will result in a route that will include toll roads only when it is required to travel on toll roads to visit a stop. Use Height Restriction to route around clearances that are lower than the height of the vehicle. If the vehicle is carrying corrosive materials, you can use the Any Hazmat Prohibited restriction to prevent hauling the materials along roads where it is marked as illegal to do so.

The parameter value is specified as a comma-separated list of restriction names. A value of null indicates that no restrictions will be used when finding the best route, but only when travel_mode is set to Custom.

Example for restrictions

Use dark colors for code blocksCopy
1
restrictions=[Driving a Truck, Height Restriction, Length Restriction]
Expand to see the restriction names supported by the service
Restriction nameDescription

Any Hazmat Prohibited

The results will not include roads where transporting any kind of hazardous material is prohibited.

Avoid Carpool Roads

The results will avoid roads that are designated exclusively for car pool (high-occupancy) vehicles.

Avoid Express Lanes

The results will avoid roads designated as express lanes.

Avoid Ferries

The results will avoid ferries.

Avoid Gates

The results will avoid roads where there are gates, such as keyed access or guard-controlled entryways.

Avoid Limited Access Roads

The results will avoid roads that are limited-access highways.

Avoid Private Roads

The results will avoid roads that are not publicly owned and maintained.

Avoid Roads Unsuitable for Pedestrians

The results will avoid roads that are unsuitable for pedestrians.

Avoid Stairways

The results will avoid all stairways on a pedestrian-suitable route.

Avoid Toll Roads

The results will avoid all toll roads for automobiles.

Avoid Toll Roads for Trucks

The results will avoid all toll roads for trucks.

Avoid Truck Restricted Roads

The results will avoid roads where trucks are not allowed, except when making deliveries.

Avoid Unpaved Roads

The results will avoid roads that are not paved (for example, dirt, gravel, and so on).

Axle Count Restriction

The results will not include roads where trucks with the specified number of axles are prohibited. The number of axles can be specified using the Number of Axles restriction parameter.

Driving a Bus

The results will not include roads where buses are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving a Taxi

The results will not include roads where taxis are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving a Truck

The results will not include roads where trucks are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving an Automobile

The results will not include roads where automobiles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving an Emergency Vehicle

The results will not include roads where emergency vehicles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Height Restriction

The results will not include roads where the vehicle height exceeds the maximum allowed height for the road. The vehicle height can be specified using the Vehicle Height (meters) restriction parameter.

Kingpin to Rear Axle Length Restriction

The results will not include roads where the vehicle length exceeds the maximum allowed kingpin to rear axle for all trucks on the road. The length between the vehicle kingpin and the rear axle can be specified using the Vehicle Kingpin to Rear Axle Length (meters) restriction parameter.

Length Restriction

The results will not include roads where the vehicle length exceeds the maximum allowed length for the road. The vehicle length can be specified using the Vehicle Length (meters) restriction parameter.

Preferred for Pedestrians

The results will use preferred routes suitable for pedestrian navigation.

Riding a Motorcycle

The results will not include roads where motorcycles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Roads Under Construction Prohibited

The results will not include roads that are under construction.

Semi or Tractor with One or More Trailers Prohibited

The results will not include roads where semis or tractors with one or more trailers are prohibited.

Single Axle Vehicles Prohibited

The results will not include roads where vehicles with single axles are prohibited.

Tandem Axle Vehicles Prohibited

The results will not include roads where vehicles with tandem axles are prohibited.

Through Traffic Prohibited

The results will not include roads where through traffic (nonlocal traffic) is prohibited.

Truck with Trailers Restriction

The results will not include roads where trucks with the specified number of trailers on the truck are prohibited. The number of trailers on the truck can be specified using the Number of Trailers on Truck restriction parameter.

Use Preferred Hazmat Routes

The results will prefer roads that are designated for transporting hazardous materials.

Use Preferred Truck Routes

The results will prefer roads that are designated as truck routes, such as roads that are part of the national network as specified by the National Surface Transportation Assistance Act in the United States, or roads that are designated as truck routes by the state or province, or roads that are preferred by truckers when driving in an area.

Walking

The results will not include roads where pedestrians are prohibited.

Weight Restriction

The results will not include roads where the vehicle weight exceeds the maximum allowed weight for the road. The vehicle weight can be specified using the Vehicle Weight (kilograms) restriction parameter.

Weight per Axle Restriction

The results will not include roads where the vehicle weight per axle exceeds the maximum allowed weight per axle for the road. The vehicle weight per axle can be specified using the Vehicle Weight per Axle (kilograms) restriction parameter.

Width Restriction

The results will not include roads where the vehicle width exceeds the maximum allowed width for the road. The vehicle width can be specified using the Vehicle Width (meters) restriction parameter.

attribute_parameter_values

Specify additional values required by an attribute or restriction, such as to specify whether the restriction prohibits, avoids, or prefers travel on restricted roads. If the restriction is meant to avoid or prefer roads, you can further specify the degree to which they are avoided or preferred using this parameter. For example, you can choose to never use toll roads, avoid them as much as possible, or prefer them.

Expand to see the default Restriction Usage values for the restrictions
Restriction nameRestriction parameter nameRestriction parameter default value

Any Hazmat Prohibited

Restriction Usage

PROHIBITED

Avoid Carpool Roads

Restriction Usage

PROHIBITED

Avoid Express Lanes

Restriction Usage

PROHIBITED

Avoid Ferries

Restriction Usage

AVOID_MEDIUM

Avoid Gates

Restriction Usage

AVOID_MEDIUM

Avoid Limited Access Roads

Restriction Usage

AVOID_MEDIUM

Avoid Private Roads

Restriction Usage

AVOID_MEDIUM

Avoid Roads Unsuitable for Pedestrians

Restriction Usage

AVOID_HIGH

Avoid Stairways

Restriction Usage

AVOID_HIGH

Avoid Toll Roads

Restriction Usage

AVOID_MEDIUM

Avoid Toll Roads for Trucks

Restriction Usage

AVOID_MEDIUM

Avoid Truck Restricted Roads

Restriction Usage

AVOID_HIGH

Avoid Unpaved Roads

Restriction Usage

AVOID_HIGH

Axle Count Restriction

Number of Axles

0

Axle Count Restriction

Restriction Usage

PROHIBITED

Driving a Bus

Restriction Usage

PROHIBITED

Driving a Taxi

Restriction Usage

PROHIBITED

Driving a Truck

Restriction Usage

PROHIBITED

Driving an Automobile

Restriction Usage

PROHIBITED

Driving an Emergency Vehicle

Restriction Usage

PROHIBITED

Height Restriction

Restriction Usage

PROHIBITED

Height Restriction

Vehicle Height (meters)

0

Kingpin to Rear Axle Length Restriction

Restriction Usage

PROHIBITED

Kingpin to Rear Axle Length Restriction

Vehicle Kingpin to Rear Axle Length (meters)

0

Length Restriction

Restriction Usage

PROHIBITED

Length Restriction

Vehicle Length (meters)

0

Preferred for Pedestrians

Restriction Usage

PREFER_LOW

Riding a Motorcycle

Restriction Usage

PROHIBITED

Roads Under Construction Prohibited

Restriction Usage

PROHIBITED

Semi or Tractor with One or More Trailers Prohibited

Restriction Usage

PROHIBITED

Single Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Tandem Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Through Traffic Prohibited

Restriction Usage

AVOID_HIGH

Truck with Trailers Restriction

Restriction Usage

PROHIBITED

Truck with Trailers Restriction

Number of Trailers on Truck

0

Use Preferred Hazmat Routes

Restriction Usage

PREFER_MEDIUM

Use Preferred Truck Routes

Restriction Usage

PREFER_HIGH

Walking

Restriction Usage

PROHIBITED

WalkTime

Walking Speed (km/h)

5

Weight Restriction

Restriction Usage

PROHIBITED

Weight Restriction

Vehicle Weight (kilograms)

0

Weight per Axle Restriction

Restriction Usage

PROHIBITED

Weight per Axle Restriction

Vehicle Weight per Axle (kilograms)

0

Width Restriction

Restriction Usage

PROHIBITED

Width Restriction

Vehicle Width (meters)

0

Syntax and code sample for attribute parameter values

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "features": [
    {
      "attributes": {
        "<field1>": "<value11>",
        "<field2>": "<value12>",
        "<field3>": "<value13>"
      }
    },
    {
      "attributes": {
        "<field1>": "<value21>",
        "<field2>": "<value22>",
        "<field3>": "<value13>"
      }
    }
  ]
}

time_impedance

Allowed values: Minutes, TravelTime, WalkTime, TruckMinutes, TruckTravelTime

Specify time-based impedance.

distance_impedance

Allowed values: Miles, Kilometers

Specify distance-based impedance.

The value represents the travel distance along road segments or on other parts of the transportation network.

  • Miles—Length measurements along roads are stored in miles and can be used for performing analysis based on shortest distance.
  • Kilometers —Length measurements along roads are stored in kilometers and can be used for performing analysis based on shortest distance.

impedance

Allowed values: TravelTime, Minutes, TruckTravelTime, TruckMinutes, WalkTime, Miles, Kilometers

Specify the impedance.

Impedance is a value that quantifies travel along the transportation network. Travel distance is an example of impedance; it quantifies the length of walkways and road segments. Similarly, drive time—the typical time it takes to drive a car along a road segment—is an example of impedance. Drive times may vary by type of vehicle—for instance, the time it takes for a truck to travel along a path tends to be longer than a car—so there can be many impedance values representing travel times for different vehicle types. Impedance values may also vary with time; live and typical traffic reference dynamic impedance values. Each walkway and road segment stores at least one impedance value. When performing a network analysis, the impedance values are used to calculate the best results, such as finding the shortest route—the route that minimizes impedance—between two points.

The parameter can be specified using the following values:

  • TravelTime—Historical and live traffic data is used. This option is good for modeling the time it takes automobiles to travel along roads at a specific time of day using live traffic speed data where available. When using TravelTime, you can optionally set the TravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the vehicle is capable of traveling.
  • Minutes—Live traffic data is not used, but historical average speeds for automobiles data is used.
  • TruckTravelTime—Historical and live traffic data is used, but the speed is capped at the posted truck speed limit. This is good for modeling the time it takes for the trucks to travel along roads at a specific time. When using TruckTravelTime, you can optionally set the TruckTravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the truck is capable of traveling.
  • TruckMinutes—Live traffic data is not used, but the smaller of the historical average speeds for automobiles and the posted speed limits for trucks are used.
  • WalkTime—The default is a speed of 5 km/hr on all roads and paths, but this can be configured through the WalkTime::Walking Speed (km/h) attribute parameter.
  • Miles—Length measurements along roads are stored in miles and can be used for performing analysis based on shortest distance.
  • Kilometers—Length measurements along roads are stored in kilometers and can be used for performing analysis based on shortest distance.

If you choose a time-based impedance, such as TravelTime, TruckTravelTime, Minutes, TruckMinutes, or WalkTime, the measurement_units parameter must be set to a time-based value; if you choose a distance-based impedance such as Miles, Kilometers, the measurement_units must be distance-based.

populate_route_lines

Specify the shape of the output routes.

  • true—The output routes will have the exact shape of the underlying streets that are included in the routes.
  • false—No shape is generated for the output routes. You won't be able to generate driving directions if the populate_route_lines parameter is set to false. Use this option if you are only interested in determining the assignment and sequence of orders to the routes and do not want route shapes that follow streets or generate driving directions. Use this option to reduce the time taken by the service to solve the vehicle routing problem, as the service has to perform relatively fewer computations.

route_line_simplification_tolerance

Specify the simplification level for the route geometry returned by the service.

Simplification maintains critical points on a route, such as turns at intersections, to define the essential shape of the route and removes other points. The simplification distance you specify is the maximum allowable offset that the simplified line can deviate from the original line. Simplifying a line reduces the number of vertices that are part of the route geometry. This reduces the overall response size and also improves the performance for drawing the route shapes in applications.

This parameter is relevant only when route_shape is set to True Shape or True Shape with Measures because the other route_shape options cannot be simplified further.

The parameter is specified as a JSON structure that includes the following properties:

  • distance —The simplification distance value.
  • units —The units for the simplification distance value. The property value should be specified as one of the following values: esriCentimeters, esriDecimalDegrees, esriDecimeters, esriFeet, esriInches, esriKilometers, esriMeters, esriMiles, esriMillimeters, esriNauticalMiles, esriPoints , and esriYards .

Syntax and code sample for route line simplification tolerance

Use dark colors for code blocksCopy
1
2
3
4
{
  "distance": "<value>",
  "units": "<unit>"
}

populate_directions

Specify whether the service will generate driving directions for each route.

directions_language

Specify the language that will be used when generating travel directions.

This parameter applies only when the populate_directions parameter is set to true.

Show all supported languages

The service supports generating directions in the following languages:

  • ar: Arabic
  • bg: Bulgarian
  • bs: Bosnian
  • ca: Catalan
  • cs: Czech
  • da: Danish
  • de: German
  • el: Greek
  • en: English
  • es: Spanish
  • et: Estonian
  • fi: Finnish
  • fr: French
  • he: Hebrew
  • hr: Croatian
  • hu: Hungarian
  • id: Indonesian
  • it: Italian
  • ja: Japanese
  • ko: Korean
  • lt: Lithuanian
  • lv: Latvian
  • nb: Norwegian
  • nl: Dutch
  • pl: Polish
  • pt-BR: Portuguese (Brazil)
  • pt-PT: Portuguese (Portugal)
  • ro: Romanian
  • ru: Russian
  • sk: Slovak
  • sl: Slovenian
  • sr: Serbian
  • sv: Swedish
  • th: Thai
  • tr: Turkish
  • uk: Ukrainian
  • vi: Vietnamese
  • zh-CN: Chinese (China)
  • zh-HK: Chinese (Hong Kong)
  • zh-TW: Chinese (Taiwan)

The service searches for an exact match for the specified language including any language localization. If no exact match is found, it tries to match the language family. If a match is still not found, the service returns the directions using the default language of the server's operating system. For example, if the directions language is specified as es-MX (Mexican Spanish), the service will return the directions in Spanish, as it supports the es language code, not es-MX.

directions_style_name

Allowed values: NA Desktop, NA Navigation

Specify the name of the formatting style for the directions. This parameter can be specified using the following values:

  • NA Desktop—Generates turn-by-turn directions suitable for printing.
  • NA Navigation—Generates turn-by-turn directions designed for an in-vehicle navigation device.

This parameter applies only when the populate_directions parameter is set to true.

save_route_data

Specify whether the service will create a .zip file that contains a file geodatabase with the inputs and outputs of the analysis in a format that can be used to share route layers with your portal.

  • true—The route data will be saved as a .zip file. This file can be downloaded from the URL provided as part of the output_route_data parameter.
  • false—The route data will not be saved.

save_output_layer

Specify whether the service will save the analysis settings as a network analysis layer file.

You cannot work directly with this file even when you open the file in an ArcGIS Desktop application such as ArcGIS Pro. It is meant to be sent to Esri Technical Support to diagnose the quality of results returned from the service.

  • true—The network analysis layer file will be saved. The file can be downloaded from the URL provided as part of the output_network_analysis_layer_package parameter.

  • false—The network analysis layer file will not be saved.

populate_stop_shapes

Specify whether the service will create the shapes for the output assigned and unassigned stops.

  • true—The output assigned and unassigned stops are created as point features. This can be useful to visualize which stops are assigned to routes and which stops could not be assigned to any routes.
  • false—The output assigned and unassigned stops are created as tables and will not have shapes. Use this option only if your application does not have a need to visualize the output stops and can work with just the attributes of the stops.

output_format

type:enumdefault:Feature Set

Allowed values: Feature Set, JSON File, GeoJSON File

Specify the format in which the output features will be returned.

  • Feature Set—The output features will be returned as feature classes and tables.

  • JSON File—The output features will be returned as a compressed file containing the JSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more JSON files (with a .json extension) for each of the outputs created by the service.

  • GeoJSON File—The output features will be returned as a compressed file containing the GeoJSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more GeoJSON files (with a .geojson extension) for each of the outputs created by the service.

context

This parameter contains additional settings that affect task operation, for example, the spatial reference of the output features.

overrides

ignore_invalid_order_locations

Specify whether invalid orders will be ignored when solving the vehicle routing problem.

  • true—The solve operation will ignore any invalid orders and return a solution, given it didn't encounter any other errors. To generate routes and deliver them to drivers immediately, you may be able to ignore invalid orders, solve, and distribute the routes to your drivers. Then, resolve any invalid orders from the last solve and include them in the fleet routing analysis for the next workday or work shift.

  • false—The solve operation will fail when any invalid orders are encountered. An invalid order is an order that the fleet routing solver can't reach. An order may be unreachable for a variety of reasons, including when the order is located on a prohibited network element, isn't located on the network at all, or is located on a disconnected portion of the network.

Response details

On successful completion the service returns solution to the specified fleet routing problem. The solution is made up of the following output parameters:

out_stops

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.

Show attributes for out stops
  • Namestring (length: 500)nullable

    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 if the Name field value refers to a depot, an order, or a break.

  • StopTypeintegernullable

    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
  • PickupQuantitiesstr

    The amount of cargo or number of people to be picked up from 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.

  • DeliveryQuantitiesstring

    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.

  • RouteNamestring (length: 1024)nullable

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

  • Sequenceintegernullable

    The relative sequence in which the assigned route visits the stop.

  • FromPrevTravelTimenumber (non-negative)nullable

    The elapsed travel time from the previous stop to the current stop. The value is in the units specified by the time_units parameter.

  • FromPrevDistancenumber (non-negative)nullable

    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.

  • ArriveTimedatedatetime

    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.

  • DepartTimedatedatetime

    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.

  • ArriveTimeUTCdatedatetime

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

  • DepartTimeUTCdatedatetime

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

  • WaitTimenumber (non-negative)nullable

    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_unitsparameter.

  • ViolationTimenumber (non-negative)nullable

    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_FIDintegernullable

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

  • SnapXnumber (non-negative)

    The x-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

  • SnapYnumber (non-negative)

    The y-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

  • SnapZnumber (non-negative)

    The z-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset. The SnapZ attribute is 0 if the network is two-dimensional.

  • DistanceToNetworkInMetersnumber (non-negative)

    The distance in meters between the point's geographic location and the position where it was located on the network.

Example:

The following shows an example of the out_stops parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
  "paramName": "out_stops",
  "dataType": "GPRecordSet",
  "value": {
    "displayFieldName": "",
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "Name",
        "type": "esriFieldTypeString",
        "alias": "Name",
        "length": 128
      },
      {
        "name": "PickupQuantities",
        "type": "esriFieldTypeString",
Expand

out_routes

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 highly influence the shape of the output routes.

Show attributes for out routes
  • Namestring (length: 500)nullable

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

  • ViolatedConstraintsintegernullable

    This field is deprecated and replaced by the four individual fields ViolatedConstraint_1 through ViolatedConstraint_4. The descriptions of the violations can be seen in ViolationConstraints_#.

  • ViolatedConstraint_1 through ViolatedConstraint_4integernullable

    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.

    • 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.
  • OrderCountintegernullable

    The number of orders assigned to the route.

  • TotalCostnumber (non-negative)nullable

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

  • RegularTimeCostnumber (non-negative)nullable

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

  • OvertimeCostnumber (non-negative)nullable

    The cost of overtime work, excluding any unpaid breaks.

  • DistanceCostnumber (non-negative)nullable

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

  • TotalTimenumber (non-negative)nullable

    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.

  • TotalOrderServiceTimenumber (non-negative)nullable

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

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

  • TotalBreakServiceTimenumber (non-negative)nullable

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

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

  • TotalTravelTimenumber (non-negative)nullable

    The total travel time for the route.

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

  • TotalDistancenumber (non-negative)nullable

    The total travel distance for the route.

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

  • StartTimedatedatetime

    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.

  • EndTimedatedatetime

    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.

  • StartTimeUTCdatedatetime

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

  • EndTimeUTCdatedatetime

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

  • TotalWaitTimenumber (non-negative)nullable

    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.

  • TotalViolationTimenumber (non-negative)nullable

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

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

  • RenewalCountintegernullable

    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.

  • TotalRenewalServiceTimenumber (non-negative)nullable

    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.

Example:

The following shows an example of the out_routes parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{
  "paramName": "out_routes",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPolyline",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "Name",
        "type": "esriFieldTypeString",
        "alias": "Name",
Expand

out_directions

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

Show attributes for output directions
  • RouteNamestring (length: 500)nullable

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

  • ArriveTimedatetimenullable

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

  • Typeintegernullable

    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.

    See 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
    See 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
  • SubItemTypeintegernullable

    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.
  • Textstring (length: 500)nullable

    A text description of the travel directions.

  • ElaspsedTimeintegernullable

    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.

  • DriveDistanceintegernullable

    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.

Example

The following shows an example of the output directions.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
  "paramName": "Output_Directions",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPolyline",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "RouteName",
        "type": "esriFieldTypeString",
        "alias": "RouteName",
Expand

out_unassigned_stops

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.

Show attributes for out unassigned stops
  • Namestring (length: 500)nullable

    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 whether the Name field value refers to a depot, an order, or a break.

  • StopTypeintegernullable

    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
  • ViolatedConstraintsintegernullable

    This field is deprecated and replaced by the four individual fields ViolatedConstraint_1 through ViolatedConstraint_4. The descriptions of the violations can be seen in ViolationConstraints_#.

  • ViolatedConstraint_1 through ViolatedConstraint_4integernullable

    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.

    • 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.
  • Statusint enum

    Allowed values: 0, 1, 2, 3, 4, 5, 6, 7

    Indicates the status of the point with respect to its location on the network and the outcome of the analysis. The possible values are as 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 cannot 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 cannot 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. If time windows are used and the route arrives early or late, the value changes to 6 (Time window violation)

Example:

The following shows an example of the out_unassigned_stops parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  "paramName": "out_unassigned_stops",
  "dataType": "GPRecordSet",
  "value": {
    "displayFieldName": "",
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "StopType",
        "type": "esriFieldTypeSmallInteger",
        "alias": "StopType"
      },
      {
        "name": "Name",
        "type": "esriFieldTypeString",
        "alias": "Name",
Expand

out_route_data

Provides access to 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.

out_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.

save_output_network_analysis_layer

Provides access to 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.

usage_cost

This parameter returns the credits used by the analysis.

Example

The following shows an example of the usage_cost parameter in which the analysis generated 9 billable objects (represented by numObjects ) and 4.5 credits were used by the analysis.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": "Usage_Cost",
  "dataType": "GPString",
  "value": {
    "numObjects": 9,
    "credits": 4.5
  }
}

solve_succeeded

Determine if the service was able to complete successfully. The error messages for the failure can be obtained by making a request to get the status of the job.

Example

The following shows an example of the solve_succeeded parameter

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "paramName": "solve_succeeded",
  "dataType": "GPBoolean",
  "value": true
}

Examples

Service a set of orders with a fleet of vehicles

In this example, you will find the best routes for a fleet of three vehicles, operated by a distribution company, to deliver goods from a distribution center to a set of nine grocery stores. Each store has a specific quantity of demand for the goods, and each truck has a limited capacity for carrying the goods. The main objective is to assign trucks in the fleet a subset of the stores to service and to sequence the deliveries in a way that minimizes the overall transportation costs.

Because you have three routes, you need to select the job request. The first request is to submit a job that returns the job ID.

Request

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
POST https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRoutingProblem/GPServer/SolveVehicleRoutingProblem/submitJob? HTTP/1.1
Content-Type: application/x-www-form-urlencoded

f=json
&token=<ACCESS_TOKEN>
&orders={
    "features": [
        {
            "geometry": {
                "x": -122.51,
                "y": 37.7724
            },
            "attributes": {
                "DeliveryQuantities": 1706,
                "Name": "Store_1",
                "ServiceTime": 25,
                "TimeWindowStart1": 1355245200000,
                "TimeWindowEnd1": 1355274000000,
                "MaxViolationTime1": 0
            }
Expand

Response (JSON)

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "jb1e9c0999ec047f4ac99750055041719",
  "jobStatus": "esriJobSubmitted"
}

Service limits

The table below lists the limits that apply to this service.

Limit descriptionLimit value

Maximum number of orders

2,000

Maximum number of routes

100

Maximum number of orders per route

200

Maximum number of (point) barriers

250

Maximum number of street features intersected by polyline barriers

500

Maximum number of street features intersected by polygon barriers

2,000

Maximum straight-line distance for the walking travel mode

(If the straight-line distance between any orders or depots is greater than this limit, the analysis will fail when the walking restriction is used.)

27 miles (43.45 kilometers)

Force hierarchy beyond a straight-line distance of

(If the straight-line distance between any orders or depots is greater than the limit shown here, the analysis uses hierarchy, even if use_hierarchy_in_analysis is set to false .)

50 miles (80.46 kilometers)

Maximum number of directions features that can be returned

200,000

Maximum time a client can use the Vehicle Routing Problem service

4 hours (14,400 seconds)

Troubleshooting

At times you may encounter certain error messages or unexpected behaviors returned from the fleet routing service. The table below lists some of the common errors that the service may return and how to resolve them.

TypeDescriptionExampleSolution

Errors in Definition

At least one order, depot, and route are required for a given fleet routing problem analysis layer to be solved.

No order or depot or route is defined.

Make sure there is at least one order, depot, and route.

Invalid network locations

The invalid network locations in the Depots and Barriers network analysis classes cannot be ignored. An error message is generated if either of these network analysis classes have invalid network locations. Invalid orders, however, can be ignored.

  • During route analysis, some of the stops are not located on the network.
  • A stop is located on an edge that is restricted in both directions.
  • A stop is located on an edge that is blocked at both ends with barriers.
  • A located stop has incorrect time window attributes.
  • Verify the inputs locations are valid.
  • If you want to ignore unlocated orders, set the ignore_invalid_order_locations to true.

Relationships in classes

The attributes in the network analysis classes that act as key fields must have identical values.

Relationships between network analysis classes in the fleet routing problem

The value for the Name attribute in the Depots network analysis class must be identical to the value for the StartDepotName and EndDepotName attributes in the Routes network analysis class. Similarly, the value for the Name attribute in the Routes network analysis class must be identical to the value for the RouteName attribute in the Breaks network analysis class.

Verify the relationship between classes is correct.

Distance Attribute property

The Distance Attribute property of the analysis layer must be specified if you have distance-based constraints.

If distance-based constraints, such as MaxTotalDistance and CostPerUnitDistance , are specified for routes, the Distance Attribute property of the analysis layer must be specified.

If you have distance constraints, make sure the Distance Attribute property of the VRP layer is specified.

Partial solution

Not all the orders are routed.

If the VRP solver cannot assign all the orders to the routes without violating the given constraints, a partial solution is determined by the solver. The ViolatedConstraints attribute in the Orders and Routes network analysis classes contains information about the constraints that are violated by a particular order or the route.

Learn more about violated constraints for orders and routes.

  • Check out_unassigned_stops for violated constraints field to understand the reason.
  • Check out_routes for violated constraints field to understand the reason.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.