Redefining Route Optimization

route optimization

We live in an incredibly innovative era and it’s obvious that more companies are being challenged to gain a competitive edge and stand out from the crowds.

In the last-mile delivery sector alone, the most important focus and the challenge are to improve the delivery process by making it more efficient through a platform that has relevant features.

One such feature is route optimization, which seems to be the latest touchpoint in last-mile logistics. But why is this feature so important for business growth and efficiency?

To reduce the cost of movement, companies need to integrate a sophisticated solution that will provide features to help them achieve shorter delivery times, improved turnaround times, faster delivery routes and reduction in rates.

By using a sophisticated route optimization algorithm, not only will you provide your drivers with the fastest delivery route, but also reduce the cost of the delivery and achieve quality for your service.

Route optimization allows you to quickly create smart and efficient delivery routes by considering delivery locations, real-time traffic data and driver schedules.

By having access to this solution on-the-go, your company can leverage an advanced end-to-end delivery that will delight customers and drivers at the same time.

Whats the difference between “Routing” and “Route Optimization”?

The definition of routing is actually the process of finding the best path between two or more locations with a fixed order in a road or rail network.

The criterion according to which a path is the best can vary. You may be looking for the shortest path (by distance), the fastest (by travel time), but also the most scenic or the safest path.

Anything is possible as long as it can be specified by assigning the quantity and a cost to each road segment and looking for the most efficient route.

Route optimization is based on the haversine to calculate the shortest distance between locations based on delivery windows, traffic, capacity, etc.

This is where the difficulty arises and the more constraints you can apply, the more versatile your routing tool will be. 

The advantage is that the feature allows companies to identify the shortest total driving time, given a fleet of vehicles and a host of orders with their constraints and works as a great planning tool which leads to costs saving.


route optimization

We have built a powerful route optimization feature for deliveries which literally cuts the time spent on manual routing to half. Whether an SME or Enterprise, this tool empowers companies of all sizes to save time and create a streamlined operations workflow in minutes.

Key capabilities to look for in a route optimization feature:

  • Create pick-ups and drop-offs, and plan the best route to deliver orders to customers while minimizing cost and increasing efficiency
  • Track on-road performance of drivers and vehicles to ensure plans are being well executed and all changes or issues that may arise can be managed in real time
  • Capture and collect driver and customer data to help eliminate paper-based manual processes and use data to improve future deliveries 

CarPal Fleet’s powerful route optimization engine

The optimization logic needs to be able to consider the parameters that drive your business. 

The more powerful the optimization engine of the planning tool, the more likely the engine will handle a broader spectrum of business parameters that meet a wide variety of routing scenarios while, at the same time, producing better and more feasible results.

CarPal Routing is a Python package that provides routing solutions based on various factors like the number of vehicles, vehicle capacity, delivery window, etc. It works independently as a process engine of location data.

There are two major components included in this package:

Grouping and Routing

Grouping is the module which groups locations based on driver schedule/delivery wave and models data to Python classes as the input for Routing module. However, Grouping is not a mandatory step prior to Routing for some simple problem domains.

If you just have a few locations and need a quick solution to figure out a bunch of optimal routes, you just need to model the locations into Python classes and add them to the Routing module.


Each location should include 5 essential attributes: coordinates, address, delivery_window, capacity and order_time, and an optional attribute reference (it could be table primary key or anything unique).

The order_time attribute is used for grouping locations by the delivery wave. However, it’s not always the case that you wanna do the delivery wave, and then you need to set the value to 0 for all locations.

The Routing module is built on top of Google Optimization Tools and involves a series of derived algorithms for different components.

Here are the components:

Distance calculation

The algorithm we used for distance calculation is called Haversine formula. To understand this algorithm deeply, you can visit this Wikipedia page where explains this algorithm thoroughly.
In a nutshell, this algorithm allows us to calculate the distance between two points based on their lat/long values.
However, you should understand that this is a theoretical value of the distance between two geo points, the actual distance value may vary due to different unexpected factors.

The routing class

This is where the actual routing optimization happens. The Routing class includes only one constructor and one method. The constructor does the job of loading all required data into memory. The code snippet below shows you a simple example of how to start routing optimization


Powerful route optimization tools also take into consideration load capacities, shift patterns, defined coverage regions and a myriad of other constraints.

The expectations and definitions of route planning are constantly evolving thanks to agile development processes and a SaaS deployment model.

Our accurate, complex and predictive models can adapt to study data and create an automated and optimised experience for future deliveries. The smart system learns from results and builds upon them to provide better solutions.

route optimization

Comments are closed.