Route analysis

Solving a route analysis can mean finding the quickest, shortest, or even the most scenic route, depending on the impedance you choose to solve for. If the impedance is time, then the best route is the quickest route. If the impedance is a time attribute with live or historical traffic, then the best route is the quickest route for a given time of day and date. Hence, the best route can be defined as the route that has the lowest impedance, or least cost, where the impedance is chosen by you. Any cost attribute can be used as the impedance when determining the best route.

A route of the quickest path between A and B
This shows the route of the quickest path for someone to drive from point A to point B.

You can accumulate any number of impedance attributes in a route analysis, but accumulated attributes don't play a role in computing the path along the network. For example, if you choose a time cost attribute as the impedance attribute and want to accumulate a distance cost attribute, only the time cost attribute is used to optimize the solution. The total distance is accumulated and reported, but the path isn't calculated from distance in this example.

Finding the best route through a series of stops follows the same workflow as other network analyses.

Learn more about the network analysis workflow

Route analysis layer

The route analysis layer stores all the inputs, parameters, and results of a route analysis.

Creating a route analysis layer

You can create a route analysis layer from the Network Analyst toolbar by clicking Network Analyst > New Route.

Choosing New Route on the Network Analyst toolbar

When you create a new route analysis layer, it shows up in the Network Analyst window along with its five network analysis classes—Stops, Routes, Point Barriers, Line Barriers, and Polygon Barriers.

The route analysis layer also appears in the Table Of Contents as a composite layer, which is named Route (or, if a route with the same name already exists in the map document, Route 1, Route 2, and so on). There are five feature layers—Stops, Routes, Point Barriers, Line Barriers, and Polygon Barriers. Each of the five feature layers has default symbology that can be modified on its Layer Properties dialog box.

Route analysis classes

The route analysis layer is composed of five network analysis classes.

Learn more about network analysis classes

An overview of each class and descriptions of their properties are provided in the following sections.

Stops class

This network analysis class stores the network locations that are used as stops in a route analysis. The Stops layer has four default symbols: located stops, unlocated stops, stops with errors, and stops with time violations. You can modify the symbology for the Stops layer in the Layer Properties dialog box, where there is a custom symbology category for stops, Network Analyst > Sequenced Points.

Stops Layer Properties dialog box

When a new route analysis layer is created, the Stops class is empty. It is populated only when network locations are added to it. A minimum of two stops is necessary to create a route.

Stop properties

Some of the stop properties are only available when a start time is defined or time windows are enabled, both of which are parameters on the Analysis Settings tab of the Route analysis layer's Layer Properties dialog box.

Input fields of stops

Input field

Description

ObjectID

The system-managed ID field.

Shape

The geometry field indicating the geographic location of the network analysis object.

Name

The name of the network analysis object.

A name, which you can edit, is assigned automatically when the stop is added to the map.

RouteName

This represents the name of the route to which the stop belongs. By using this property, stops within one route analysis layer can be assigned to multiple routes.

  • If some stops have route names, they are grouped into a route with the same name. In this case, if some stops do not have a route name assigned, they are listed as unassigned and are left out of the solution.
  • If no name is present, then all the stops belong to the same route.

TimeWindowStart

This property stores the earliest time the network location can be visited.

If TimeWindowStart is set to 10:00 AM and the route arrives at the stop at 9:50 AM, there is a wait time of 10 minutes that is added to the total time.

If the network dataset has a time-zone attribute, the time-of-day fields refer to the same time zone as the edge that the stop is located on.

This property is only available when time windows are enabled on the network analysis layer.

TimeWindowEnd

This property stores the latest time the network location can be visited.

Together, the TimeWindowStart and TimeWindowEnd properties make up the time window within which a route can visit the network location.

If a location has a TimeWindowEnd value of 11:00 AM, and the earliest a route can reach the stop is 11:25 AM, a violation of 25 minutes is noted. Additionally, the stop is symbolized to display that it has a time window violation.

If the network dataset has a time-zone attribute, the time-of-day fields refer to the same time zone as the edge that the stop is located on.

This property is only available when time windows are enabled on the network analysis layer.

Attr_[Impedance]

(for instance, Attr_Minutes, where Minutes is the impedance for the network)

This property specifies how much time 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 the network location requires no service time.

For example, if you are finding the best route through three stops using Drivetime as impedance, the property Attr_Drivetime can be used to store the amount of time you expect to spend at each stop. If you start from Stop 1, reach Stop 2 in 10 minutes, spend 10 minutes at Stop 2, and reach Stop 3 in another 10 minutes, then the total time to reach Stop 3 is displayed as 30 minutes (10 + 10 + 10), even though there is only 20 minutes of traveling to reach Stop 3.

Network location fields

  • SourceID
  • SourceOID
  • PosAlong
  • SideOfEdge

Together, these four properties describe the point on the network where the object is located.

Learn more about network location fields

CurbApproach

The CurbApproach property specifies the direction a vehicle may arrive at and depart from the network location. There are four choices (their coded values are shown in parentheses):

  • Either side of vehicle (0)—The vehicle can approach and depart the network location in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the stop or if it can pull into a driveway or parking lot and turn around.
  • Right side of vehicle (1)—When the vehicle approaches and departs the network location, the curb must be on the right side of the vehicle. A U-turn is prohibited.
  • Left side of vehicle (2)—When the vehicle approaches and departs the network location, the curb must be on the left side of the vehicle. A U-turn is prohibited.
  • No U-Turn (3)—When the vehicle approaches the network location, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around.

Learn more about U-turn policies

Input/output fields of stops

Input/Output field

Description

Sequence

As an input field, this number represents the order in which the stops should be visited. Within a route, the sequence number should be greater than 0 but not greater than the maximum number of stops. Also, the sequence number should not be duplicated. If the analysis layer parameter Reorder Stops To Find Optimal Route is not checked, the resulting route visits the stops in the sequence specified.

If the stops are allowed to be reordered by the solver, the optimal sequence is discovered, and Sequence is updated during the solve process.

The recommended way to change the sequence value is by dragging stops above or below other stops in the Network Analyst window.

TipTip:

Assume you want to load a feature class into Stops and use an attribute with predefined values to automatically specify the stop sequence. Since neither the Load Locations dialog box nor the Add Locations geoprocessing tool allows you to map a field from your input to the Sequence field of Stops, you need a different method. The recommended method is specifying the sequence field from your input feature class as the sort field in the load process. This causes the features to be sorted, then loaded, in the sequence you had predefined in the attribute table.

Status

This field is constrained by a domain of values, which are listed below (their coded values are shown in parentheses).

  • OK (0)—The network location is valid.
  • Not located (1)—The location on the network can't be determined.
  • Network element not located (2)—The network element that the network location is supposed to be on can't be found. This can occur when a network edge is deleted and the network location is not recalculated.

After a solve operation, the status can be modified using one of the following status values:

  • OK (0)—The network location was successfully evaluated.
  • Element not traversable (3)—The network element that the network location is on is not traversable. This can occur when the network element is restricted by a restriction attribute.
  • Invalid field values (4)—The field values of the network location fall outside the analysis layer's coded or range domains. For example, a negative number may exist where positive numbers are required.
  • Not reached (5)—The network location can't be arrived at by the solver.

If time windows are used and the route arrives early or late, the value changes to Time window violation (6).

Output fields of stops

Output field

Description

ArriveCurbApproach

Indicates which side of the vehicle the curb is on when the vehicle approaches the network location. If the network location's CurbApproach value is set to Right side of vehicle, the ArriveCurbApproach after solving is Right side of vehicle. However, if the CurbApproach value is set to Either side of vehicle or No U-Turn, the ArriveCurbApproach could be on the right or left side depending on which produces the overall shortest path.

DepartCurbApproach

Indicates which side of the vehicle the curb is on when the vehicle departs the network location. If the network location's CurbApproach value is set to Right side of vehicle, the DepartCurbApproach after solving is Right side of vehicle. However, if the CurbApproach value is set to Either side of vehicle or No U-Turn, the DepartCurbApproach could be on the right or left side depending on which produces the overall shortest path.

Cumul_[Impedance]

(for instance, Cumul_Minutes, where Minutes is the impedance for the network)

This property is the total impedance it takes to reach the stop. This includes the impedance incurred in traveling to the stop, the impedance of the stop, and the impedances of all the previous stops.

In the example given for the input attribute, Attr_[Impedance], the Cumul_Drivetime for Stop 2 would be 20 minutes (10 minutes travel time + 10 minutes spent at Stop 2), and the Cumul_Drivetime for Stop 3 would be 30 minutes (20 minutes Cumul_Drivetime for Stop 2, plus 10 minutes travel time from Stop 2 to Stop 3).

Wait_[Impedance]

(for instance, Wait_Minutes, where Minutes is the impedance for the network)

This property stores the time spent waiting for the time window to open (TimeWindowStart) when the route arrives early.

This property is only available when time windows are enabled on the network analysis layer.

CumulWait_[Impedance]

(for instance, CumulWait_Minutes, where Minutes is the impedance for the network)

This property stores a sum of how much time has been spent waiting for time windows to open (TimeWindowStart). It includes the time from the current stop and all previous stops visited by the route.

This property is only available when time windows are enabled on the network analysis layer.

Violation_[Impedance]

This property is a measure of how late the route arrived after the time window closed (TimeWindowEnd). Specifically, it stores the amount of time between the end of the time window and the arrival of the route.

This property is only available when time windows are enabled on the network analysis layer.

CumulViolation_[Impedance]

This property stores the cumulative violation time (Violation_[Impedance]) from the current stop and all previous stops visited by the route.

This property is only available when time windows are enabled on the network analysis layer.

ArriveTime

The date and time value indicating the arrival time at the stop.

When using traffic data that covers multiple time zones, the time zone for this time-of-day value is taken from the network element on which the order is located.

DepartTime

The date and time value indicating the departure time from the stop.

When using traffic data that covers multiple time zones, the time zone for this time-of-day value is taken from the network element on which the order is located.

NoteNote:
  • The time fields in the Stops class can contain either time-only values or date-and-time values. If a time field, such as TimeWindowStart, has a time-only value (for example, 8:00 AM), the date is ignored. Using both date and time (for example, 7/11/2010 8:00 AM) allows you to specify time windows that span multiple days.
  • A time window only states when a vehicle can arrive at a stop, not when the Attr_[Impedance] is completed. To account for service time and leave before the time window is over, subtract Attr_[Impedance] from the TimeWindowEnd field.

Route class

The Route class stores the resulting route, or routes, from the analysis. As with other feature layers, its symbology can be accessed and altered from its Layer Properties dialog box.

The Route class is an output-only class; it is empty until the analysis is complete. Once the best route is found, it is displayed on the Network Analyst window.

Route properties

Output fields of routes

Output field

Description

ObjectID

The system-managed ID field.

Name

The name for the route is assigned automatically when the route layer is solved, either by reading the value from the RouteName property of the Stops class or, if that value is null, by integrating the name of the first stop in the route and the name of the last stop, for example, Graphic Pick 1 – Graphic Pick 8. You are able to rename the route from the Network Analyst window.

FirstStopID

The ObjectID of the route's first stop.

LastStopID

The ObjectID of the route's last stop.

StopCount

The number of stops visited by the route.

Total_[Impedance]

(for instance, Total_Minutes, where Minutes is the impedance for the network)

The total impedance from the beginning of the first stop to the end of the last stop. The total travel impedance and the Attr_[Impedance] of the visited stops are included in this value.

TotalWait_[Impedance]

(for example, TotalWait_Minutes, where Minutes is the impedance of the network)

This property stores the route's overall wait time, which is the time spent at stops waiting for time windows to open.

This property is only available when time windows are enabled on the network analysis layer.

TotalViolation_[Impedance]

(for example, TotalViolation_Minutes, where Minutes is the impedance of the network)

This property stores the route's overall violation time at stops. Violation time is added when the route arrives at a stop after the time window has ended; it is the difference between the ArriveTime and TimeWindowEnd.

This property is only available when time windows are enabled on the network analysis layer.

StartTime

The time the route begins.

This property is only available when time windows are enabled on the network analysis layer.

EndTime

The time the route is complete.

This property is only available when time windows are enabled on the network analysis layer.

Point, line, and polygon barriers

Barriers serve to temporarily restrict, add impedance to, and scale impedance on parts of the network. When a new network analysis layer is created, the barrier classes are empty. They are populated only when you add objects into them—but adding barriers is not required.

Barriers are available in all network analysis layers; therefore, they are described in a separate topic.

Learn more about barriers

Route analysis parameters

Analysis parameters are set on the Layer Properties dialog box for the analysis layer. The dialog box can be accessed in different ways:

Learn more about opening the network analysis Layer Properties dialog box

The Analysis Settings tab

The following subsections list parameters that you can set on the analysis layer. They are found on the Analysis Settings tab of the analysis layer's Layer Properties dialog box.

The Analysis Settings tab

Impedance

Any cost attribute can be chosen as the impedance, which is minimized while determining the best route. For instance, choosing the Minutes attribute results in the quickest route.

Learn more about cost attributes

Restrictions

You can choose which restriction attributes should be respected while solving the analysis. In most cases, restrictions cause roads to be prohibited, but they can also cause them to be avoided or preferred. A restriction attribute, such as Oneway, should be used when finding solutions for vehicles that must obey one-way streets (for instance, nonemergency vehicles). Other common restriction attributes include height or weight limits that prohibit some vehicles from traversing certain roads or bridges; hazardous materials restrictions that hazmat drivers need to completely bypass or at least try to avoid; and designated truck routes that truck drivers should try to follow. You can choose which restriction attributes should be respected while solving the analysis. (You can further specify whether the elements that use the restriction should be prohibited, avoided, or preferred in the Attribute Parameters tab.)

Use Start Time

Use Start Time, in conjunction with the Time of Day and Specific Date or Day of Week properties, lets you specify when the route will begin from the first stop. Moreover, if you specify a time-only value in any date/time properties for the route analysis, such as time window properties, the date is assumed to be the date you set for Specific Date or Day of Week.

Note that specifying a start time doesn't require traffic data; yet, if the network dataset includes traffic data, the results of the analysis are more accurate. That is, the results are calculated for the start date and time that you set. For example, during rush hour, the route could take longer than during off-peak hours. Furthermore, the best path could change depending on traffic conditions at that time.

The route feature or features that are output by the solver have StartTime and EndTime properties when a time-based impedance is used with a start time. The StartTime value will match the value that you enter in the Use Start Time settings of the route analysis layer. The EndTime will be calculated from the start time and the duration of the route. The Directions window will display the start and end times when directions are generated.

Stops in a route analysis have an ArriveTime and DepartTime property when a time-based impedance is used with a start time. If you also choose to display the Time of day column in the Directions Options dialog box, the arrive and depart times at stops will appear in the Directions window. In fact, all directives in the Directions window will display a time of day.

Time of Day

The value you enter here represents the time you want the route, or routes, to begin. The default value of Time of Day is 8:00 AM.

The time must be associated with a date. You can choose between entering a floating day (Day of Week) or a calendar day (Specific Date).

Specific Date

For a calendar date, you provide the day, month, and year that the Time of Day value is associated with.

Day of Week

For a floating day, you can choose Today or any day of the week (Sunday through Saturday) relative to the current date. Floating days enable you to configure an analysis layer that can be reused, without having to remember to change the date.

Floating days are especially beneficial when used with traffic data since traffic changes from minute to minute and day to day. For example, if you calculate the same routes each day and need accurate times or the best routes given traffic conditions, you can choose the Day of Week and Today settings. The solver will generate results based on the traffic for the current day, which is determined from your computer's operating system. If you return the next day—for instance, May 5—to update the routes for that day, you can re-solve the same analysis layer. The solution will automatically be based on the traffic for May 5 since Day of Week was set to Today.

Likewise, when you choose Monday for the Day of Week property, then solve, the solution will be based on the traffic forecast for the next Monday. However, if today is Monday, the solution uses today's traffic data. You can solve up to six days ahead relative to the current day.

Using a start time with traffic data and time zones

If you use traffic data, the start time refers to the time zone of the edge or junction on which the first stop is located. There is one case in which this causes a solve to fail because the time zone can't be determined beforehand. That situation is created when your stops are located across multiple time zones and you check Reorder Stops To Find Optimal Route without preserving the first stop. You can avoid this failure by preassigning the first stop.

Use Time Windows

If a stop can be visited only during a particular time of day, its time window can be stored in the TimeWindowStart and TimeWindowEnd properties of the network location (stop). This check box enables or disables the usage of those time windows. If time windows are enabled, the route will be modified such that it honors the time windows. If the route is unable to honor some time windows, the affected stops will be symbolized as time-window violations.

Learn more about routing with time windows

Reorder Stops To Find Optimal Route

By default, a route traverses stops in the order you define. However, you can possibly shorten the route further by letting Network Analyst find the best order. It will account for a variety of variables, such as time windows. Another option is to preserve the origin and destination while allowing Network Analyst to reorder the intermediary stops.

When you check this property, the route analysis changes from a shortest-path problem to a traveling salesperson problem (TSP).

U-turns at Junctions

Network Analyst can allow U-turns everywhere, nowhere, only at dead ends (or culs-de-sac), or only at intersections and dead ends. Allowing U-turns implies the vehicle can turn around at a junction and double back on the same street.

Learn more about U-turn policies

Output Shape Type

The route features that are output by the analysis can be represented in one of four ways.

NoteNote:

No matter which output shape type you choose, the best route is always determined by the network impedance, never Euclidean distance. This means that only the route shapes are different, not the underlying traversal of the network.

  • True Shape gives the exact shape of the resulting route.

    Route as true shape

  • True Shape with Measures gives the exact shape of the resulting route. Furthermore, the output includes route measurements for linear referencing. The measurements increase from the first stop and record the cumulative impedance.

    Learn more about linear referencing

  • Straight Line results in a single, straight line between the stops.

    Straight line shape for route

  • When the output shape type is set to None, no shape is returned.

Use Hierarchy

If the network dataset has a hierarchy attribute, you can use the hierarchy during the analysis. Using a hierarchy results in the solver preferring higher-order edges to lower-order edges. Hierarchical solves are faster, and they can be used to simulate the driver preference of traveling on freeways instead of local roads—even if that means a longer trip. Not using a hierarchy, however, yields an exact route for the network dataset.

Learn more about routing with hierarchy

Ignore Invalid Locations

This property allows you to ignore invalid network locations and solve the analysis layer from valid network locations only. If this option is not checked and you have unlocated network locations, the solve may fail. In either case, the invalid locations are ignored in the analysis.

Directions

With the Directions properties, you can set the units for displaying distance and, optionally, time (if you have a time attribute). Additionally, you can choose to open directions automatically after the generation of a route. (If you choose not to display directions automatically, you can click the Directions Window button Directions on the Network Analyst toolbar to display directions.)

The Accumulation tab

Under the Accumulation tab, you can choose cost attributes from the network dataset to be accumulated on the route objects. These accumulation attributes are purely for reference; the solver only uses the cost attribute specified by the analysis layer's Impedance parameter to calculate the route.

For each cost attribute that is accumulated, a Total_[Impedance] property is added to the routes that are output by the solver, where [Impedance] is replaced with the name of the accumulated impedance attribute.

Assume you set the impedance attribute to Minutes because you want to find a route that minimizes travel time. Even though you're solving using travel time, you would also like to know the length of the quickest route. Suppose you have another cost attribute, Miles, that you check on in the Accumulation tab. After solving, the output route features will have properties named Total_Minutes and Total_Miles.

Conversely, you can find the shortest route and accumulate travel time to determine when the route will arrive at its stops and how long it will take to complete the trip. If you have a traffic-enabled network dataset, you can even find this information for a specific time of day and account for variable traffic speeds. To do this, choose a distance-based cost attribute for the impedance of the analysis layer, use a start time, and accumulate a time-dependent cost attribute.

The Network Locations tab

The parameters on the Network Locations tab are used to find network locations and set values for their properties.

Learn more about network locations

Directions

Directions can be displayed in ArcMap after the generation of a route in route analysis.

To display directions, on the Network Analyst toolbar, click the Directions Window button Directions.

Related Topics

3/25/2015