Skip navigation
All Places > GIS > Analysis > Network Analyst > Blog

Network Analyst

5 posts

As a route planner or manager, it can be critical to consider the human component when planning.  The perception of fair division of labor is key to keeping a happy workforce.  In this post we will examine how to balance the workloads across routes.

The many ways to fairly balance workloads

Here are a few ways to balance routes:

  • Total Time - Hourly pay
  • Total Service Time - Amount of work time at order locations
  • Order Count - Commission or tip-based compensation
  • Total Distance - Wear on the vehicle

I’m sure I have only touched the tip of the balancing iceberg.  Tell us how you would like to balance your workloads.  Currently we can encourage the VRP Solver to balance based on total time.

Steps for balancing workloads based on total time

1. The first step in balancing workloads is to know what the average route total time should be for the problem. Set the problem up without worrying about the balancing and solve it.

Initial solve of the VRP

 

2. In the above example you can see that the total time is not well balanced between these four routes, although is typically the best total time for all routes.  The next step is to understand what the average total time should be for the routes.  This gives you a goal for completely equal division of work time.  The statistics for the TotalTime field will give you this information.

Route Total Time statistics from the initial solve

 

3. Now that you know what the average should be add that time (or rounded down to a whole number) to the OvertimeStartTime field. You will also need to add overtime cost.  A good rule of thumb is double the CostPerUnitTime field.  However, the higher you make the CostPerUnitOvertime value the more the solver will try to keep the TotalTime under the OvertimeStartTime.

Add overtime values to the Routes

 

4. Finally, resolve the problem to see the changes.  Although this results in a slightly bigger total time for all routes, it is now a more balanced solution.

Final balanced routes solution

 

To see this example in action, watch this demo.

Get Involved

We would love to know how you would like to balance your routes.  Answer this poll to share with us your preferences.

Sometimes modeling a single capacity constraint just isn’t good enough for your needs, but the VRP solver only offers one capacity field.  We will look at how to model multiple capacities.  So you can model both volume and weight, or number of seats and number of wheel chair positions, or what other capacity combinations you have.

Modeling Steps

Modeling multiple capacities is actually pretty simple.  Capacities and quantities are modeled within the DeliveryQuantities and PickupQuantities field in the Orders feature class and the Capacity field in the Route feature class.  In these fields, you simply put the multiple capacities’ values in the same field separated by a space.  For example, you are tracking volume and weight with a delivery at an order location that is 90 cubic feet and 500 pounds.  In the Delivery Quantities field you enter 90 500.  It is critical that you are consistent in the sequencing of these measurements and use consistent units throughout the problem.  Sequencing and units are not tracked for you. If they are switched in sequence or switch units from one field to another the problem will be solved with the input as input.  This will lead to results that you are not expecting.

Delivery and Pickup Quantities Fields for the Orders Feature Class

For the GP tools in both ArcMap and ArcGIS Pro and the Rest Request system this is all that is needed.  When using the ArcMap UI for VRP layers there is an additional step.  You will also need to go into the Layer Properties Analysis Settings and set the parameter Capacity Count to the correct number according to how many capacities you want to model. 

Capacity Count Field in the Layer Properties

Solver’s Interpretation of differing number of specified capacities

When modeling multiple capacities, it is important to double check the entries to make sure they are accurate.  In correct entries can have unintended consequences that are sometimes hard to identify.  We will look at the effects of having too few or too many values in a field.

Too Few Inputs in a Quantity/Capacity Field

An empty string or null value in a quantity or capacity field is treated as being all zeros.  Null values are often intentional.  However, if it was unintentional and in a quantity field for an order, the order should still be routed.  Since there is now quantity associated with the order, it might overload a route.  if a capacity field on a route is unintentionally left blank, that route would only be able to accommodate orders without a delivery or pickup quantity.

When the field value has fewer dimensions then what is being tracked, the remaining not designated ones will be treated as zeros.  If it is the last number in the sequence is omitted, then this does not matter.  However, if it is in the middle of the sequence of capacities, then all the following ones are pushed forward.  This leaves the last one as zero instead of the intended middle capacity value.  It is recommended to always place a zero in the appropriate location of a capacity that is not needed.  By always including all dimensions it takes out the guess work.

To Many Inputs in a Quantity/Capacity Field

When extra capacity values are included in the ArcMap VRP layer UI it gives a solver error.  This error indicates that the order or route has a string containing too many values and will not solve.  This is because in the ArcMap VRP layer UI the Capacity Count value is set.  This indicates the number of values to be tracked and will not accept extras.

When using the GP tools or Rest Request system a Capacity Count is not set.  Instead the solver will use the maximum number of values for the problem as a Capacity Count.  If an extra value is included in a quantity field for an order, that order will not be routed.  The ViolatedConstraints for that order in the output will indicate Capacities exceeded.  This is because the order has a quantity value for a tracked dimension, but all of the routes will have a zero for that dimension at the end of its sequence. 

If an extra capacity dimension is added to a Route Capacity value, the solver will simply track an extra capacity.  The problem should still solve as intended because all the orders will have zeros in that additional capacity dimension.  The orders can, then, still fit on the vehicles. 

Many local governments have detailed geographic data for their community’s streets and highways. But accurate transportation analysis, such as routing work crews or inspectors and assessing fire station coverage, requires a network dataset with correct network connectivity. One-way streets, overpasses, and speed limits affect the routes vehicles can take between streets, so your data must account for these variables.

 

We've just released a set of Tasks in ArcGIS Pro to walk you through a step-by-step process to help you clean and prepare your data, transform it into a provided schema, create a network dataset from a provided template, and validate the network.

 

Check out this post on the ArcGIS blog for details:

https://www.esri.com/arcgis-blog/products/arcgis-pro/transportation/create-a-local-government-network-dataset/

 

Or if you just want to get started, download the project here: http://arcg.is/z1GrG

More and more companies need to incorporate appointment times or time windows into their routing solutions.  The 30-minute guarantee isn’t just for pizza delivery anymore.  We will discuss the basics of time windows in the VRP solver and how to prioritize their importance.

 

The Basics

Time windows are a way to indicate when the route/driver should arrive at that order location.  The VRP Solver supports two time windows per order.  If the beginning time for a time window is left null, then it will correspond with starting at the earliest start time of the earliest route.  Similarly, if the ending time for a time window is left blank, then it will correspond with the latest ending of the last route.

 

Unless using the Rest Request system, the time window fields are set up to accept either just time or time and date.  If it is just the time then it is assumed to be on the default date.  If using both date and time be sure to use both date and time in all time fields in Orders, Depots, Routes, and Breaks.  The Rest Request system requires that all times are in milliseconds since epoch (which is January 1st 1970).  It, therefore, will inherently have both date and time.

.

Note: Time windows do not include when the drivers should be done at that location, ready to go to the next location.  It is only when they should arrive at the location.  If you need to model it so that the driver leaves within a certain time, then for your time windows subtract the service time from the TimeWindowEnd value. This allows for if the driver was to show up right at the end of this modified time window they would be completed with the service time and leaving right at the end of the original time window.

 

Hard vs. Soft Time Windows

Hard time windows mean that the route/driver must show up during the designated time frame of the time windows.  A soft time window, on the other hand, allows the route/driver to show up late but the violation is penalized in the solver so that violation times are minimized.  To indicate that the time window is hard set the corresponding MaxViolationTime to zero.  Leaving this value as null makes it a soft time window.  Giving a positive value for MaxViolationTime makes it a soft time window within a hard time window.  This means the route/driver can be late to that location, incurring the violation penalty, but only up to the MaxViolationTime.  At that point it is a hard time constraint.

Time window fields in the orders attribute table.

 

Prioritizing Time Window Violations or Total Cost

When setting up a problem with soft time windows you have the option to identify how much priority you want to place on minimizing the time window violation time vs minimizing the total cost of the routes (which includes the total time and total distance for all of the routes).  These two priorities are usually working against each other.  Minimizing or eliminating time window violations usually requires higher costs because.  This is because the shortest tour amongst all of the stops will likely not satisfy the time windows.  To indicate the preference for the VRP problem use the parameter Time Window Violation Importance.  There are three options for this parameter: Low, Medium, and High.

  • Low - Prioritizes minimizing the total cost over the time window violations
  • Medium - Tries to find a balance between the time window violations and added cost
  • High - Minimizes the time window violations at the expense of added cost

 

Time Window Violation Importance field in the Solve VRP GP Tool

 

Time Window Violations Importance Field in the Advanced Settings of the VRP layer properties.

 

Geo-Local or UTC Time

When using the UI in ArcMap for VRP layers or the GP tools in either ArcMap or ArcGIS Pro it is natural to type in the time fields using the local time for that location (Geo-Local).  However, when switching to the rest request method those times need to be converted to milliseconds since epoch.  This UNIX way of representing time has a strong convention of referencing time based on UTC. Therefore, most conversion methods convert those times using UTC instead of Geo-Local.

 

The VRP Solver allows for some flexibility in specifying time.  It allows the option of having that input as a Geo-Local time as well as UTC. You, therefore, need to specify which format is being used.  This is done with the parameter time_zone_usage_for_time_fields with the two parameter options of GEO_LOCAL or UTC.  Setting this parameter is only available in the GP tools or the rest request and it defaults to Geo-Local.  When using the VRP layers in ArcMap there is no way to switch it to using UTC.

 

Time Zone Usage for Time Fields field in the Solve VRP GP Tool.

 

Get Involved

When using soft time windows and a violation is needed, would you prefer to see one order with a larger violation or several orders with smaller violations?  Click here to answer.

 

How many time windows do you want to model?  Click here to answer.

Do you have a fleet of vehicles that need to be routed to customers?  The Vehicle Routing Problem (VRP) Solver is here to help you do that efficiently. But the VRP Team understands that the solver is complicated and has a ton of different options.  This is the beginning of a series of posts to help explain the different modeling options available to you, giving you all our best tips and tricks.  We will start our discussion by examining what problem types we support.

If you have topics you would like us to discuss or specific questions please post them here.

 

Services

The vehicles visit customers to provide a service.

In the Services operation, the vehicles all start at either a central location or the driver’s residence. It then visits the customers on the route providing a service for them before moving on to the next customer. The vehicle then returns to either the central location or their residence to end the day.

  • An exterminator visits houses for treating various pests. Specialties are used to describe which chemicals are kept on the vehicle.
  • Mechanics visit businesses to fix elevators/escalators or provide preventative maintenance to the motor.
  • Health Inspectors are sent to Hospitals, clinics, restaurants, etc. to determine the cleanliness of the business.
  • A satellite/cable provider sends their installers out to customers to install new equipment, recover equipment from customers that are leaving, and making repairs or adjustments to existing customers.
  • Utility workers are sent to houses at the end of the month to notify them they have not paid their bill and will have the utility shut off unless it is paid immediately.
  • City workers are given work requests around town to fix things such as street lights.
  • An insurance company sends out claims assessors to take pictures and talk with the customers after a natural disaster.

 

Goods-Delivery

Vehicles deliver goods from a central location to customers.

In the Delivery operation, the vehicles start their routes full from their warehouse.  They deliver their goods to customers along their route, emptying their vehicle as they go. Vehicles end their route empty at the last location returning to the warehouse.  There is also the option of having the vehicle return to the warehouse mid-route to fill up the vehicle for more deliveries.

  • A store delivers furniture, appliances, large electronics, etc. to customers.
  • Medical supplies are delivered to hospitals and clinics to resupply their stock.
  • Food and drink merchandise is delivered to grocery and convenience stores.
  • A retail company delivers its latest line from the manufacture facility to the stores.
  • A furniture store that delivers may need to send the trucks out for more than one trip in a single day. All of the items to be delivered cannot be loaded at the start of the route.
  • The Meals on Wheels drivers deliver three to four meals at a time. They then go back to the cafeteria to pick up more.  This insures the food is still warm on delivery.

 

Goods-Pickup

Vehicles pickup goods from customers bring them back to a central location.

In the Pickup operation, the vehicles start their routes empty and get filled up along the route. They then arrive full at the ending location.  There is also the option of the vehicle to return to a central facility to empty their vehicles mid-route and then continue picking up items.

  • A non-profit organization that accepts donated goods visits homes to pick them up.
  • A collective farm company goes to the local farms to pick up fresh produce for selling each morning.
  • A recycling company picks up large electronics from customers to bring back to the warehouse to break down for scraps.
  • A Hazmat company goes around to sites to pick up hazardous material needing to be properly disposed.
  • An automobile parts junkyard sends tow trucks to residences to pick up cars that can no longer run. This needs to be a tow truck that carries more than one car at a time. The tow trucks make several trips back to the junkyard to drop off the cars that have been picked up.

 

Goods-Delivery and Pickup

Each Vehicle can both deliver goods from a central location to a customer and/or pickup goods from a customer to bring back to the central location.

In a Delivery and Pickup operation, the vehicles start their route at least partly full to make deliveries.  The vehicle can also pickup product along the route when the vehicle has extra room from either a partially full vehicle at the start or as goods are delivered freeing up space. Pickups, however, do not re-fill the vehicle with usable goods allowing it to make more deliveries.

  • A parcel delivery company delivers mail to customers and picks up their outgoing letters and boxes.
  • A store delivers new furniture, appliances, electronics, etc. to customers and removes their old product to take back to the store to be refurbished, recycled, or donated.
  • A portable toilet company has truck routes that deliver portable toilets from their depot to customer sites. These same routes also pick up toilets to take out of service and bring them back to the depot.
  • A Chemical company delivers barrels to various oil drilling wells and picks up the empties to return to the plant.

 

Courier/Rideshare

Vehicles Pick up a customer or packages from one location and deliver them to another location.

In the Courier/Rideshare operation, the vehicle always starts empty. The passengers or parcels are picked up along the route and transported to their desired drop off location. The vehicle then ends the day with no passengers or parcels.

There can be additional rules about the maximum time between the pickup and delivery orders, especially when transporting people.  This may lead to having customer service related objectives.

  • A courier company picks up packages and delivers on demand for their customers. Sometimes there is a time window for deliveries.
  • A para transit company provides transportation to senior and disabled citizens. In order to provide good service, they limit the additional ride time any particular individual will do above and beyond their individual trip.
  • Special needs school transportation provides door to door transportation to students that qualify. State regulations say that any student cannot be on the bus more than 60 minutes.
  • An armored truck service that picks up cash from local businesses and delivers it to the appropriate banks.
  • A floral delivery company working with multiple local florists to deliver their flowers to customers.

 

Get Involved

What VRP problem type are you working on?  Join this discussion to describe a problem you are modeling with the VRP solver.