Build territories and plan routes
Group neighbouring areas into territories with even workloads, and share stops between vans or people in the order that keeps travel time lowest.
Two jobs that share work out across a map. A territory is a set of building blocks (postcode districts, wards, census tracts) grouped so that one person or team looks after it: Mapstack groups neighbouring areas into territories that are each in one piece and each hold a similar share of something that adds up. A route is the order of a day's visits: given a set of stops and a number of vans or people, Mapstack decides which stops each one takes and in what order, so the total travel time is as low as it can find.
GIS people know the first as building balanced zones and the second as vehicle routing (for one route alone, the travelling salesman's problem).
The asks below are examples of the kind of thing to say. Use your own datasets and column names.
- Who can use it
- Free, Creator and Creator Max
- You provide
- Areas with a column that adds up, or a set of stops
- You get
- A dataset of territories, or routes with their stops in order
Group areas into territories
People build territories for sales when reps join or leave, for delivery or service zones, caseloads, and patrol or inspection areas. The question is usually some form of "split this fairly".
Give it:
- Areas to group, such as postcode districts, wards or census tracts.
- One or more columns that add up, such as customers or population.
- For territories around bases: a dataset of points, one per base.
You get a new dataset of territories made from your areas, each in one piece. The reply says what it balanced and any caveats. Make a map of it by asking. Your areas are not changed.
Example: Texas's 254 counties grouped into six sales territories balanced on 4,132 veterinary clinics, each territory joined along county borders and within 2% of an even share of 688.67 clinics.
The whole job, from finding the clinics to testing a change, is the guide Split accounts into balanced sales territories.
If your areas already carry the grouping, such as a district code on every ward, merging them is a different job: see Combine and reshape data. To give each area to its nearest site, see Choose where to go next.
Points can be grouped directly. Territories are usually built from areas. Where you have only points, such as addresses to visit, ask for groups of a set size and Mapstack groups them by closeness. Ask for a walking order inside each group, and every address gets a number.
Group addresses into rounds
Group these addresses into rounds of 50 to 150 doors, and number each address in walking order
Split areas into a set number of balanced territories
Name the building blocks, how many territories, and the column to balance.
Group these postcode districts into 6 sales territories with equal numbers of customers
Make territories of a target size
Give the total each territory should hold. The number of territories follows from it.
Build delivery zones of about 20,000 households each from these wards
Build a territory around each base
Give a dataset of the bases (a depot, an office, each rep's home). Each territory forms around one of them.
Make one territory around each of our 5 depots, balanced on sales
Even and compact territories
The balancing column must add up. Population, customers, sales, call-outs. A rate or an average cannot be shared out, so name the count behind it. If more than one column could fit, Mapstack asks which you mean.
Territories are as even as the areas allow. Whole areas are grouped, never split, so a few large areas in one territory limit how even the totals can be. Smaller building blocks give it more room: postcode sectors instead of districts, for example.
Balance on more than one measure
Give each measure a weight. You can also set a least and a most a territory may hold.
Split these census tracts into 8 patrol areas, balanced 80% on call-outs and 20% on population
Keep territories tight by drive time
Closeness is measured in a straight line unless you name a travel mode. Name one and it is measured on the road or path network instead.
Group these districts into 4 territories balanced on accounts, and keep each one tight by drive time
Plan routes for vans or people
People plan routes for vans serving shops from a depot, inspectors visiting sites, a day of sales calls and a courier's drop-offs. Mapstack decides which stops each route takes and in what order.
Give it:
- Stops: a dataset of points.
- A start: one point for all routes, or one per route.
- An end (optional), if routes should not return to the start.
- How many routes, and the most stops one route may take.
It checks the stops fit before planning. If there are more stops than routes times the most stops per route, Mapstack says so before it starts. Raise one of the two.
You get new datasets. One line per route, with its number of stops, total time, travel time, kilometres and miles, and start and end times; and every assigned stop in its order on its route. Make a map of them by asking. Your stops are not changed.
Example: Liverpool's 30 food premises rated 0 for hygiene, shared between 2 inspectors who start and finish at the council's offices in the Cunard Building: 15 visits each, 20 minutes a visit, from 09:00. One route drives 45.6 km and ends at 15:55, the other 24.1 km and ends at 15:19.
The example is the working-day ask further down, planned for real stops: the premises rated 0 in the Food Standards Agency's hygiene ratings for Liverpool, timed on OpenStreetMap roads. Results vary from run to run, so treat its figures as one example.
A time at every stop. Each stop on a route comes with the time the vehicle arrives and the time it leaves. The start can be an address you type in your message.
Plan routes from a depot
Say how many routes and the most stops each may take. Together they must cover every stop.
Plan routes for 3 vans delivering to these 120 shops from the depot, at most 40 stops each
Plan one route that ends at the last stop
Routes return to the start unless you say otherwise.
Plan one cycle courier route through these 15 drop-offs from the shop, ending at the last stop rather than returning
Working day and the spread of stops
Routes are not evened out against each other. One can be much longer than another. To spread the stops more evenly, set the most stops per route close to the number of stops divided by the number of routes.
Stops that do not fit any route are left unassigned, so you can see what the day cannot hold.
Fit the routes into a working day
Give the time spent at each stop, a start time and the longest a route may be. Stops that do not fit are left unassigned.
Plan visits to these 30 sites for 2 inspectors, at most 15 each, 20 minutes at each site, starting at 09:00, no route longer than 8 hours
Travel time and your allowance
Routes are the quickest, not the shortest. Mapstack minimises total travel time, which is not always the least distance. Roads and paths come from OpenStreetMap. There is no live traffic.
Travel uses part of your allowance. Timing neighbouring areas by road, and planning routes, use routing. Before a large job Mapstack says what share of your allowance it will use and waits for your go-ahead. See Your allowance.
For the journey time between places, see Find who and what is within reach.
Reference
| Territory setting | What you can ask for |
|---|---|
| How many | A set number, 2 or more; a target size, the total each should hold; or one around each base, from a point for each |
| Measures | One or more columns that add up, each with a target, a weight (up to 100), a least and a most |
| Closeness | Straight line, or travel by road or path |
| Route setting | What you can ask for | If you don't say |
|---|---|---|
| Number of routes | A whole number | Needed |
| Most stops per route | A whole number | Needed |
| Return to start | Yes, or end elsewhere | Returns to start |
| Time at each stop | Minutes | 0 |
| Longest route | Minutes, travel and stops together | No limit |
| Start time | A clock time | None |
| Travel mode | Drive, truck, cycle or walk | Drive |
What it can't do
- Balance a rate or an average.
- Split one area between two territories.
- Even out the work between routes.
- Minimise distance rather than time.
- Use live traffic.
- Give a stop its own time window, or plan vehicle loads.
- Plan a schedule over several days. A plan is one day.
- Build territories or plan routes on a Viewer seat.
Common questions
How do I make the territories more even?
Give it smaller building blocks, such as postcode sectors instead of districts, or ask for fewer territories. Areas are grouped whole, so one or two large areas can hold a territory back.
Which column can I balance on?
Any column that adds up: customers, sales, population, call-outs. A rate or an average cannot be shared out, so name the count behind it.
My customers are a list, not a count per area. Can I balance on them?
Yes. Count them into the areas first: 'Count our customers in each postcode district'. Then ask for the territories, balanced on that count. See Count and summarise by area.
How do I spread the stops evenly between vans?
Set the most stops per route close to the stops divided by the routes: for 120 shops and 3 vans, 'at most 40 stops each'. Routes are not balanced otherwise, so one can be much longer than another.
How do I fit in the stops left unassigned?
They did not fit within the longest route you allowed. Lengthen it, add a route, or cut the time at each stop: 'No route longer than 9 hours'.