I love designing bike routes. It’s a great way to explore the country from home and to dream about beautiful places to ride. But creating a long route that contains the shortest length of paved roads is a challenge. How is it done?
This post follows on from the main post about the Great Vic Gravel Route. It will make more sense if you read that post first. I describe below how the Great Vic Gravel Route was created and show how changes to the route-selection rules can create alternative routes.
Some cycling apps and route planning apps let you design routes that ‘avoid sealed roads’ or ‘prefer unpaved roads’. These vague phrases beg the question, how far will you go to avoid a paved road? Would you ride 2, 10 or 100 km on dirt roads to avoid riding on 1 km of asphalt? Your answer to that question will greatly influence the route you create.
If we ask a computer to find the shortest route from Nelson to Mallacoota in Victoria using data from OpenStreetMap it creates a route that is 896 km long, with 806 km of asphalt. That’s the blue line in the map below.
If we’re prepared to travel up to 2 km to avoid every 1 km section of paved road (i.e. we’re happy to travel twice as far on unpaved roads to avoid each paved road), the route we get is longer but has much less asphalt than the shortest route.
Map 1. The shortest route from Nelson to Mallacoota (blue) and the route with the shortest distance of paved roads if we travel up to 2 km on unpaved roads and tracks to avoid every 1 km of asphalt (orange). Click on any map for a larger view.
Our route becomes longer again, but contains even fewer paved roads, if we’re happy to ride up to 10 km to avoid every 1 km of asphalt — or, to put it another way, if we travel up to 1 km to avoid every 100 m of asphalt, etc.
(I don’t know anyone who actually thinks like this, but it’s a helpful way to understand how route selection algorithms work, and to find the route from Nelson to Mallacoota that contains the shortest possible distance of paved roads, so bear with me for a moment.)
Map 2. The route with the shortest distance of paved roads if we travel up to 10 km on unpaved roads and tracks to avoid every 1 km of asphalt (purple).
But how do we find the route that has the smallest possible length of paved roads? The route that has less asphalt than every other potential route?
To do that, we simply tell the computer that we’re prepared to ride a crazy-long way to avoid pavement. Like 5,000 km crazy. To ride 5,000 km on unpaved roads to avoid a single kilometer of pavement is ludicrous. No route-planning app is ever going to suggest that big a detour.
When we ask a computer to do this, it delivers the route shown below: a 2,005 km trip across Victoria that contains just 30.0 km of asphalt.
Map 3. The route with the shortest distance of paved roads if we travel up to 5,000 km on unpaved roads and tracks to avoid every 1 km of asphalt (green).
We get exactly the same route if we’re prepared to ride 10,000 km to avoid every 1 km of pavement, so we can be confident that there isn’t any other route that contains less than 30.0 km of pavement. Unfortunately, this isn’t the most sensible route to ride.
The further we travel to avoid paved roads, the longer our route becomes, but the length of paved roads that we avoid gets shorter and shorter. You can see this effect in the table below.
Table 1. The total distance we need to ride and the length of paved roads we avoid when we travel longer and longer distances to avoid paved roads.
|Prepared to ride (km)||Total route length (km)||Extra distance travelled (km)||Distance paved (km)||Paved roads avoided (km)|
Extra distance travelled = the extra distance travelled compared to the row below.
Paved roads avoided = the length of paved roads avoided compared to the row below.
If we travel up to 2 km to avoid every 1 km of paving, we have to travel an extra 257 km compared to the shortest route and we avoid riding on 642 km of asphalt. That’s a great saving. If we travel up to 5 km to avoid every 1 km of paving, we have to ride an extra 171 km compared to the 2-km route and we avoid riding on a further 90 km of asphalt.
At the other extreme, if we ride up to 5,000 km to avoid every 1 km of asphalt, we avoid riding on just 150 meters of asphalt compared to the 1,000-km option. Given the entire length of our ride is 2,005 km, this ‘saving’ is actually quite meaningless as it’s beyond the resolution of the underlying map data.
Most paved and unpaved roads in OpenStreetMap have been mapped from satellite images. There’s always some error in marking exactly where the paving starts and finishes. It might be just a few meters, but over a 2,000 km route these micro-errors will add up to more than 150 m.
Table 1 shows that there doesn’t appear to be any real saving in the total length of paved roads if we ride more than 35 km to avoid every 1 km of paving. We get exactly the same route, and the same length of paving, if we use any value from 35-50 km.
So many numbers! Let’s pull this together:
- To find the route from Nelson to Mallacoota that has the shortest length of paved roads, we need to travel up to 35 km to avoid every 1 km of asphalt.
- If we travel less than this, our route is shorter but contains more paved roads.
- If we travel more than this, the route is longer but any reduction in the length of paved roads is extremely small and probably spurious.
For these reasons, the Great Vic Gravel Route is based on the 35-50 km option, which is shown in bold in Table 1.
Map 4. For all practical purposes, the Great Vic Gravel Route (red) contains less paved roads than any other route from Nelson to Mallacoota.
The alternative routes shown above highlight that small changes to a route-selection algorithm can result in dramatically different routes. By selecting the 35-50 km option for the Great Vic Gravel Route, I’ve adopted the route that delivers the shortest distance of asphalt, but which avoids travelling excessive distances to make trivial, and probably non-existent, savings in the total length of paved roads. For all practical purposes, the Great Vic Gravel Route contains less paved roads than any other route from Nelson to Mallacoota. You can travel further, but you won’t encounter any less asphalt.
Shortest and fastest routes
A final note. How do we tell a computer that we’re prepared to travel 10 km to avoid 1 km of paving? It’s easy, but involves a bit of trickery.
As well as being able to calculate the shortest route between two points, many route-planning algorithms can calculate the fastest route between two points. They do this by using speed limits on different roads. For example, the algorithm might use an average speed of 100 km/hr on freeways, 90 km/hr on major highways and 40 km/hr in towns. The program just needs to know if each road is a freeway, highway or local road. It then selects the relevant speed limit and calculates the fastest way to get to the destination.
We can use this process “in reverse” to find a route that has the shortest distance of paved roads. For example, we can tell the algorithm to travel at 2 km/hr on dirt roads and just 1 km/hr on paved roads and ask it to find the fastest route between two points. This is the same as telling it that we’re prepared to ride up to 2 km on dirt roads to avoid every 1 km of pavement. If we tell it to travel at 5,000 km/hr or 10,000 km/hr on dirt roads and just 1 km/hr on paved roads, it finds the route that contains the absolute minimum possible distance of sealed roads.
To create the maps and tables shown above, I’ve repeated this process over and over again, by telling the program to travel at 1 km/hr on paved roads and a range of speeds (from 1-10,000 km/hr) on dirt roads and tracks, and asked it to find the fastest route from Nelson to Mallacoota. To do this, I used the fastest route option in the shortest path (point-to-point) network analysis function in QGIS.
All maps were created using the comprehensive data in OpenStreetMap. It’s an honour to acknowledge the thousands of editors who have compiled this amazing resource.