How to Implement and Optimize In-App Route Planning

Most logistics companies face the challenge of creating the most cost-effective and time-saving routes for their fleets. 

Logistics managers must create delivery plans with hundreds or even thousands of delivery points every day, taking into consideration various factors. For last-mile delivery, managers should create optimal routes with dozens of stops, and for long-haul delivery, they should take into consideration electronic logging device (ELD) mandates and find the nearest gas stations with the best prices. 

This is extremely time-consuming work that slows down delivery and increases operating costs. To minimize costs and maximize efficiency, logistics companies often try to optimize delivery business by implementing route planning functionality into their transport management or fleet management systems. 

At Yalantis, we have experience creating an efficient route planning algorithm for a transportation management system. With our solution, work that took a logistics manager two to six hours every day is now done by a route optimization algorithm in 30 minutes. In this article, we share our insights into route planning based on market research and our own development experience.

Using commercially available route management software

One of the easiest ways to automate route planning is to purchase ready-to-use software. You can quickly set up commercially available route optimization software and configure it to meet your needs. The market offers various solutions for every need and budget. Below, we list some popular ones. 

Onfleet

Onfleet is a SaaS product for delivery management and last-mile delivery that supplies companies with both ready-to-use standalone platform and an API that can be integrated into company's system. In addition to route planning, this technology can be used to automate delivery routines, manage inventory, and generate delivery reports. 

Onfleet

YaCu

YaCu is another transport monitoring system that has route optimization functionality and focuses on delivery management. It automates delivery routines and offers extra services like delivery analytics and vehicle monitoring.

Route4Me

Route4Me is a user-friendly SaaS solution that offers not only route planning functionality but also in-app voice-guided navigation, scheduled customer notifications, delivery analytics, and a customer relationship management system. Route4Me is more customizable than other options and is used by businesses in the transportation, food delivery, healthcare, and construction industries. 

Route4Me

Ready-made SAAS solutions are quick to set up and use, but they have several constraints you need to consider. 

First, it may take time for the software provider or a development team to integrate route planning software with your logistics system. Also, there are no guarantees the solution will cover all your business needs and be able to build routes with custom rules. 

On the contrary, you can invest more time and money at the beginning and build the functionality you need from scratch. This will eventually bring you more flexibility for application updates and allow you to easily adjust your software to your business needs and your company’s business processes.  

Creating a solution from scratch or implementing route optimization functionality into existing software

Most logistics companies build custom solutions for route planning and make them one of the features of complex transport or fleet management systems. 

What to consider while building route optimization functionality

Building a route for a fleet is a complex process that involves analyzing different types of data such as truck capacity and traffic conditions. In programming and combinatorics, this process is also known as a vehicle routing problem (VRP) if we need to build optimal routes for multiple vehicles visiting a set of locations, or a traveling salesman problem if we build a route for one vehicle. The main difficulties in solving both these problems is the necessity to take into consideration various constraints, such as vehicle's capacity, time windows, etc. Here are some of the things a route optimization algorithm should take into consideration:

  • ELD mandate. It’s important to track a driver’s time on the road and allow managers to set time constraints for trucks according to drivers’ working hours.  

Following ELD mandate

  • Forbidden zones. Implement functionality to let logistics managers add zones on the map where an algorithm cannot build routes. For instance, some route planning APIs we’ll talk about later can build routes that avoid tolls and ferries. 

  • Real-time traffic data. When creating a route, an algorithm should consider up-to-date information about traffic jams, accidents, and road closures. 

  • Schedule optimization. Besides taking a driver’s working hours into consideration, the algorithm should consider delivery windows, departure times, etc.

  • Manual editing. Enable your logistics managers to manually edit waypoints in real time.

  • Analytics and reporting. Your route planning software should allow you to track actual and planned routes as well as help you compare the delivery performance of different business hubs.  

  • Real-time driver tracking. Logistics managers should be able to track route progress in real time. This will help them quickly react to situations that may cause delivery delays and reorganize routes.

  • Truck capacity. An algorithm should also solve the Capacitated Vehicle Routing Problem (CVRP). It means, it should consider that vehicles have a limited carrying capacity of the goods. 

For the transport management system we developed, we combined route planning with load planning so delivery managers can create accurate and cost-effective plans, taking into consideration types of cargo and truck capacity.

Integrating ready-to-use APIs 

To build route planning functionality, you need rich information about traffic situations, maps, and points of interest. Some big players on the mapping tools market provide convenient APIs with all the needed information. You can easily integrate these solutions into your existing delivery management software. Let’s have a look at some of the top tools that provide APIs for route optimization.

  • Routes on the Google Maps Platform

The cloud-based Google Maps Platform has gained a strong reputation and is now used by leading logistics companies like FedEx for logistics automation. We used Google Maps to enable location awareness and route planning in Re-turnz, a unique solution for reverse logistics. 

Routes is one of three products in the Google Maps Platform. It consists of several APIs that help you build and optimize routes based on traffic information:

  1. The Directions API is used for building the optimal route between locations by various modes of transportation. This tool can build multi-stop trips, taking into consideration traffic, the number of turns, and restrictions you set (avoids tolls, highways, and ferries, for instance).

  2. The Roads API first identifies the most likely road a vehicle is traveling by tracking multiple GPS coordinates. Then it returns the closest road segment for each point and information about speed limits on each road segment. 

  3. The Distance Matrix API returns the travel distance (in imperial or metric units) and travel time as calculated by the Directions API. 

Google uses a pay-as-you-go pricing model, and the price for each API depends on the number of monthly queries. 

Take the Distance API as an example. Google Cloud calculates the price on the basis of the number and type of requests. There are two types of requests: basic, if the route consists of ten or fewer waypoints, and advanced, when there are more than ten waypoints and the algorithm takes traffic information into consideration.

With up to 100,000 advanced requests per month, you’ll pay $10 for each 1000 requests. With 100,001 to 500,000 advanced requests, you’ll pay $8 per 1000 requests. Prices for larger volumes are negotiated with Google Cloud sales representatives. 

  • Mapbox

Mapbox is a popular alternative to Google Maps that has wide functionality represented by multiple APIs for different needs. Mapbox also presents a set of solutions for logistics companies. In our previous article, we compared Google Maps and Mapbox and discussed the pros and cons of both tools. 

Here, we’ve paid attention to the Mapbox Navigation service, which offers a solution for routing and navigation powered by real-time traffic information. In particular, Mapbox Navigation has a Directions API that provides users with the following functionality: 

  1. Calculating optimal routes for driving, cycling, or walking, taking traffic and incident information into consideration (optionally and only for listed regions)

  2. Turn-by-turn navigation

  3. Creating routes with up to 25 waypoints without traffic consideration, or up to three waypoints if building a route based on traffic data

  4. Excluding tolls, motorways, or ferries when building a route

  5. Choosing desired arrival and departure times (currently in public beta)

Mapbox Directions API - example of response

There’s also the Isochrone API, which shows areas that are reachable within a specified amount of time from a chosen location.

Mapbox uses a pay-as-you-go pricing model but offers a free tier. Up to 100,000 requests per month are free, after which the price is $2 per 1000 requests if you don’t exceed 500,000 requests. 

  • HERE

The Routing API by HERE is a good solution for web or mobile applications with complex architectures. It provides a route optimization solution and allows you to calculate routes for multiple waypoints, edit routes, update past routes, and calculate a matrix of routes, taking into consideration various destinations and starting points.

In addition, this SaaS solution supplies public transport timetable routing and traffic enabled routing in its premium package. As you can see, you can use the HERE Routing API for any industry that requires route planning.
Another service worth mentioning is HERE Fleet Telematics, which was built specifically for the needs of logistics companies. 

This solution is equipped with geofencing, route building, and matching capabilities. It also calculates toll costs and provides information about height and slope values, curvature, speed limits, and traffic lights.

The Tour Planning REST API, which is part of the Fleet Telematics solution, is responsible for optimizing multi-vehicle routes. It helps logistics managers solve variations of the vehicle routing problem, taking into account constraints like capacity, time windows, maximum travel time, and driver breaks.

HERE has several plans: Freemium, Add-on, and Pro. The Freemium plan has significant restrictions: for instance, the number of monthly active users can’t exceed 5000 and the number of overall transactions is limited to 250,000. Otherwise, you need to pay $1 for each thousand additional transactions. Also, the Freemium plan offers 5 GB of database storage and allows you to transfer up to 2.5 GB of data. To extend the limits, you can purchase another plan. With the Pro plan, you get HERE Data Layers for two city map tiles with data refresh, customer support via HERE’s support portal, and an AI-powered Live Sense SDK.

HERE LiveSense SDK 

In our guide to making your web or mobile app location-aware, we’ve overviewed these tools. If you want to implement one into your delivery management software, this guide will help you choose.

Building a route planning algorithm from scratch 

Building a route planning algorithm from scratch is another option that takes significant development effort but provides exceptional customization, allowing you to set customised rules and build routes that fully cover your needs. Below, we give an example of a simple route planning algorithm that finds the shortest possible route from point A to point B.

Machine learning for delivery route planning

Machine learning (ML) is one way to create and optimize routes. There are different ways to use machine learning along with ready-made solutions for planning routes. We’ll take a look at a relatively new ML algorithm called ant colony optimization. The idea is that machine learning mimics the behavior of ants in search of the shortest route from their colony to a food source. Here’s how it works:

1. During the first calculation, the algorithm finds any possible route to the destination. Next, it goes back to the starting point and searches for other routes. 

Route discovery phase

2. After discovering all possible routes, the algorithm compares their efficiency by seeing how many times they can be covered in a given time frame (for example, in 10 minutes).

Optimal route marking

3. The algorithm will eventually highlight only the Route 4 as it can be covered the most times in 10 minutes.  

Optimal route marking

If new variations of the same route (or entirely new routes) appear, the algorithm will consider them in recalculating the optimal route. Such a machine learning algorithm is good not only for planning routes but for optimizing couriers’ delivery schedules.

Implementing route planning in your trucking software may seem a challenging task, as you’ll have to develop a sophisticated system for editing and sharing routes with scheduling, real-time tracking, and manual route editing. But the results will be increased operational efficiency, decreased fleet idle time, and improved overall fleet efficiency. If you’re thinking about building a smart route optimization solution, you can rely on Yalantis. With expertise in creating logistics tracking software and, in particular, with creating algorithms for route planning, we’ll find the most cost-effective solution that brings valuable results.

 
4.5/ 5.0
Article rating
54
Reviews
Remember those Facebook reactions? Well, we aren't Facebook but we love reactions too. They can give us valuable insights on how to improve what we're doing. Would you tell us how you feel about this article?
Want to automate route planning?

Check how we helped our client with it

See our works

We use cookies to personalize our service and to improve your experience on the website and its subdomains. We also use this information for analytics.