Skip to main content
Routing Result in MileApp

Routing Result in MileApp

Route Optimization is one of MileApp’s key features. It helps you plan the most efficient route for your field users. With this feature, you’re equipped with a powerful tool to enhance field operations. Say goodbye to inefficient routes, unnecessary costs, and wasted time. Start optimizing your routes and experience more streamlined, cost-effective, and predictable operations. Our route optimization engine is based on the Travelling Salesman Problem (TSP), where multiple iterations are performed to find the minimum distance using the fewest number of vehicles within the configured parameters.

Available Parameters

Routing parameters are configurations that the routing engine uses to produce the best possible result. You can configure these parameters at either the visit level, the vehicle level, or in the routing configuration. Each parameter is either a hard constraint or a soft constraint:
  • Hard constraint: the resulting solution will not violate this rule.
  • Soft constraint: the solution may violate this rule if no fully feasible solution can be found.
ParameterExplanationConfigure inType
Time windowDefines the time range in the day when a visit can be served.VisitHard constraint
Visit timeSpecifies how long the visit takes (in minutes).VisitHard constraint
TagEnsures visits are served by vehicles with the same tag.Visit, VehicleHard constraint
Capacity constraintDefines what kind of capacity each visit consumes, and the minimum/maximum capacity each vehicle has.Visit, VehicleMinimum ➝ soft constraint, Maximum ➝ hard constraint
Working timeDefines the time range in a day when the vehicle is allowed to work.VehicleHard constraint
Cost factorDefines the usage priority of each vehicle based on a cost factor (0–100). 0 is highest priority, 100 is lowest.VehicleHard constraint
Auto speedIf true, the engine will determine vehicle speed based on historical data. If false, you can manually define each vehicle’s speed (km/h) or use a default speed.Vehicle, Routing ConfigurationHard constraint
Return to hubIf true, the vehicle must return to the hub before its working time ends. If false, the vehicle may end its day at the last visit.Routing ConfigurationHard constraint
Multi-tripIf true, the vehicle is allowed to return to the hub to reset its capacity and then continue on another trip (more than one trip per day).Routing ConfigurationSoft constraint
ClusteringIf true, the optimization engine will try to minimize overlapping service areas between vehicles.Routing ConfigurationSoft constraint
Use all vehicleIf true, the engine will try to use all available vehicles instead of minimizing the number of vehicles used.Routing ConfigurationSoft constraint
Auto splitIf true, a visit that exceeds all vehicles’ maximum capacity (within matching tags) will be split into multiple visits so it can be served by one or more vehicles.Routing ConfigurationSoft constraint
Auto mergeIf true, multiple visits with the exact same latitude/longitude will be treated as a single visit. This prevents those visits from being assigned to different vehicles.Routing ConfigurationSoft constraint
Grouped Visit and PriorityVisits that are assigned to a specific vehicle will remain on that vehicle and will be ordered by priority. A lower number means higher priority.VisitHard constraint

Time Window

This parameter defines when a visit can and should be served. In most cases, time windows are used to specify when a shipment or delivery should arrive or be picked up before the location closes. Time windows help ensure logistics operations run smoothly by setting clear expectations and reducing uncertainty. Example: If an outlet opens at 8 AM and closes at 5 PM, you can set the visit’s open time to 8 AM and close time to 5 PM. This ensures delivery is scheduled only within that time range. You can configure this in Routing ➝ Visit:
Time window configuration
The routing result will ensure that vehicles only visit that outlet between the allowed times.

Visit Time

This parameter defines how long the vehicle is expected to remain at each visit before departing to the next stop. This is often called unloading time, because in most cases it represents the time needed to unload goods. You can configure this in Routing ➝ Visit:
Visit time configuration

Tag

The tag parameter indicates which vehicle should serve a visit. The routing system will try to match visits and vehicles that share the same tag.

Use case: Road class

A common use case is road access / vehicle class. Each visit can be tagged based on what vehicle type can physically reach that location.
Tag configuration
For example, visits can be tagged according to the road size (small, medium, big), and vehicles can receive matching tags.

Use case: Dedicated vehicle

Another common tag use case is for dedicated vehicles. Example: if you have vehicles dedicated to Cash on Delivery collection, those vehicles can be tagged "COD", and visits that require COD collection can use the same tag so they are matched together.

Capacity Constraint

Capacity is critical in logistics because it determines a vehicle’s ability to fulfill orders and deliver on time. MileApp supports up to 10 capacity constraints. Common examples include:
  • Weight:
  • Volume:
  • Packs:
  • Boxes:
  • Frozen-weight:
  • Chilled-weight
Capacity can be measured in different units (weight, volume, quantity of items, etc.) depending on the product type.
  1. First, define the capacity constraint configuration and its unit in Routing ➝ Configuration:
Capacity constraint configuration
  1. Then, set each vehicle’s minimum and maximum capacity.
    • Maximum is a hard constraint (the engine will not exceed it).
    • Minimum is a soft constraint (the engine may go below it if no feasible result is found).
    You can configure this in Routing ➝ Vehicle for each vehicle:
Vehicle capacity configuration
  1. Each visit can also define how much capacity it consumes. If nothing is filled in the visit, it is treated as 0. You can configure this in Routing ➝ Visit for each visit:
Visit capacity configuration
You can create more capacity constraint definitions, but each hub can only select up to 10 constraints. The list of available constraints is the same across all hubs in your organization, but each hub can choose which constraints to actually use.

Working Time

Working time defines the time range during which a vehicle is allowed to operate. The routing engine will not assign visits outside this range. If Return to hub is enabled, the return trip to the hub must still fit within this allowed working time. You can also set working time to span more than one day if you want to plan multi-day routes in one run. You can configure this in Routing ➝ Vehicle for each vehicle:
Working time configuration

Cost Factor

The cost factor defines vehicle priority. It represents a cost multiplier. Example: If Vehicle A has a cost factor of 1 and Vehicle B has a cost factor of 10, then using Vehicle B is considered ten times “more expensive” than Vehicle A. This is useful when you have internal fleet and external vendor fleet. You can assign a low cost factor (e.g. 0) to your internal fleet and a higher cost factor (e.g. 10) to vendor vehicles. The engine will try to use cheaper vehicles first. You can configure this in Routing ➝ Vehicle for each vehicle:
Cost factor configuration

Auto Speed

When Auto speed is enabled, the engine will estimate each vehicle’s speed based on historical performance in that area. If Auto speed is disabled, you can manually define the vehicle’s speed in km/h. This is useful if you want to assume slower or faster movement than historical data. You can configure this in Routing ➝ Configuration:
Auto speed configuration
If Auto Speed is enabled, the per-vehicle speed field will be disabled.

Return to Hub

Return to hub makes sure that each vehicle returns to the hub as the final leg of its trip. The return trip must still respect the vehicle’s working time. For example, if a vehicle’s working time is 8 AM–5 PM, it will be routed to return to the hub before 5 PM.
Return to hub configuration
With the latest enhancement, you can now choose whether vehicles must return to the hub before or after their working hours end. If the option is left unchecked, the vehicle will automatically be routed to return before the end of its working hours. If this parameter is set to false, the vehicle does not have to return to the hub. The trip can end at the last visit.
This option is automatically enabled when Multi Trip is turned on.

Multi Trip

Multi Trip allows a vehicle to return to the hub, reset its capacity constraints, and then continue with another trip in the same day.
Multi trip configuration

Clustering

When Clustering is enabled, the routing engine groups nearby visits together to reduce overlap between vehicles’ service areas. Without Clustering:
Without clustering
With Clustering:
With clustering

Use All Vehicle

When Use all vehicle is enabled, the routing engine will try to use all available vehicles instead of trying to minimize the number of vehicles used. This is useful if you want to distribute work more evenly.

Auto Split

When Auto Split is enabled, if a visit’s capacity is larger than what any single vehicle can carry (among vehicles with matching tags), that visit will be automatically split into multiple smaller visits. This allows the system to generate a solution without dropping that visit. Read more here for details.

Auto Merge

When Auto Merge is enabled, multiple visits with the exact same coordinates will be treated as a single combined visit and scheduled back-to-back on the same vehicle. This prevents the same customer (same location) from being assigned to multiple vehicles. Read more here for details.

Visit Group

Similar to the tag system: When enabled, visits that are assigned to the same vehicle will be grouped and ordered by priority. A lower number indicates a higher priority. Read more here.

Flow Configuration for Routing Parameters

Before using the routing system, you need to connect Flow components to routing visit parameters. You can configure this in Flow ➝ Configuration ➝ Route:
Flow configuration for routing
Each routing parameter expects a specific input type from Flow. The mapping is shown below:
Routing keyType of input component
Visit nameText
AddressAddress
Open timeTime
Close timeTime
Visit durationNumber
CoordinateCoordinate
TagText
ConstraintNumber, Currency

Feature: Dynamic Routing

Dynamic routing ensures that routed visits stay with the same vehicle even after re-routing. If new visits are added after optimization, previously assigned visits will not be reassigned to different vehicles. The package icon will be displayed next to the visit name, as shown below:
Dynamic routing icon