|Optimising a set of deliveries with MapInfo RouteFinder|
|MapInfo® RouteFinder is an add-on for MapInfo Pro™ that provides routing and driving region capabilities. These can be used in a variety of ways.|
This article is about taking advantage of the Traveling Sales Person (TSP) routing capabilities in RouteFinder. These capabilities provide the ability to calculate directions to a number of destinations in an optimal manner. Traveling Sales Person is a well-known algorithm to accomplish this. This capability can be used for deliveries, appointments or other types of visits.
There are two methods to specify the point locations for which to calculate the routes. One is to use a tool to point and click on the map. The second is to start with a table of locations that you want to optimise the visits to. The first method is briefly covered. This article will focus on using a table of locations.
Once again, "TSP" is an abbreviation for "Traveling Sales Person". Given a table of points, RouteFinder will calculate an optimal set of routes to visit all of the locations as efficiently as possible.
But first, you will likely want to set some preferences. For example, you may wish to have the route calculations be done in such a way that a "round trip" is created. The overall travel plan can finish at the same point as the start location. Here are options available to you to determine how the set of routes are calculated.
In the RouteFinder menu, click on Options > TSP Options.
The last item in the dialog box is an option to use straight line distances to determine the order in which to visit the points. This will be faster but the result may not the optimal route amongst all the input locations.
- Round Trip optimises the set of journeys such that the first point in the table (or first point clicked) is used as the starting point and the ending point.
- Start-End Point uses the first row in the table (or first point clicked) as the starting point and the last row (last clicked) as the final destination.
- Start Point only uses the first row in the table (or first point clicked) as the starting point.
- Choose Every time - this dialog is presented each time you use the TSP capability. You can set the behaviour as needed. (This applies only when using the interactive TSP capability.)
Calculating the optimal routes
Below is a screen shot from MapInfo Pro showing the StreetPro Canada map for Ontario. We will use the TSP capability to calculate an optimal route to all of the locations. Note that the first row in the table is the warehouse. This will be the start and end point for the set of routes.
Above: A map of Toronto with a warehouse location and seven other locations to route to. Map data is StreetPro Canada © TomTom BV.
The steps to calculate the routes are as follows:
In the RouteFinder menu, click on the Batch Options sub menu and choose TSP from Table.
Choose the table for which to calculate the routes. Note that you can add a delay at each stop. This can be a fixed amount of time for all stops or it can vary for each stop. The latter requires a column which indicates what the delay should be for each stop. This is expressed in minutes.
Round trip result.
In the result below the start point is the warehouse (the point furthest at the bottom of the map). The calculation includes a route from the last point visited (#8) back to the origin.
Note that the route stops are labelled. MapInfo RouteFinder has added two layers to the map. One is called The Route. This contains the polyline objects representing the route path. The second is called RouteLabels. This is a copy of the input point table. It is providing the labels representing the order in which the stops are made.
Hint: If some of the labels are crowded out by labels from other layers, turn on the Try Other Positions option. To do this, double click the RouteLabels layer to bring up the Layer Properties dialog box. Also, in the Layer Control window, click the Adjust Labeling Priorities button and increase the priority of the labels.
Start point only
In the example below, the option to use the Start Point only was chosen.
Do you have multiple vehicles or people to route? Batch TSP from Table
Let's say you have a table representing deliveries or visits made by a number of vehicles or individuals. With your table in the right structure, MapInfo RouteFinder can calculate routes for each of the vehicles. The data needs to have a column which indicates to which group (i.e. vehicle) each location belongs to. An additional column indicating the order for each stop can also be supplied, if desired.
This command is called Batch TSP routes from Table. It is also in the Batch Functions sub menu.
Otherwise, the capabilities work the same as described above.
Interactive TSP (clicking on the map)
Instead of specifying an input table, it is also possible to click on several points in the map and have MapInfo RouteFinder calculate the optimal route to all of the locations.
The Traveling Sales Person tool is highlighted above.
Want to try MapInfo RouteFinder?
- Click to add the first point.
- Use Ctrl+click to add additional points.
- Use Shift+click to add the last point.
Get in touch with your usual Pitney Bowes contact or with your reseller.
Links to MapInfo Pro free trials in a number of languages can be found here: http://web.pb.com/mapinfopro-archive/resources
Article by Tom Probert, Editor of "The MapInfo Pro" journal
When not writing articles for "The MapInfo Pro" journal, Tom enjoys talking to MapInfo Pro users at conferences and events. When not working he likes to see movies with car chases, explosions and kung-fu fighting.