v2.0

GoRules Version 2 is here - redesigned, now with managed cloud.GoRules Version 2 is here!

Watch the launch videoWatch

Delivery Route Optimizer

Smart logistics system that evaluates capacity, traffic, time windows, and distance to determine the most efficient delivery routes for maximum efficiency.

Solution

This route optimization system maximizes delivery efficiency by analyzing multiple critical factors before selecting the optimal path. It evaluates vehicle capacity utilization to ensure resources are used effectively while considering real-time traffic congestion data to avoid delays. The system factors in delivery time windows to prioritize time-sensitive deliveries and calculates route distances to minimize fuel consumption and delivery times.

Each route receives a comprehensive scoring based on these factors, with classifications ranging from "optimal" to "not recommended." The system provides clear approval status and detailed reasoning for each route decision, allowing logistics managers to quickly identify the most efficient options. This enables faster deliveries, reduced operational costs, and improved customer satisfaction through reliable delivery timing.

How it works

The decision graph evaluates delivery routes through four key stages:

  1. Input Processing: Receives route data including capacity utilization, traffic congestion, delivery window timeframes, and distance metrics.
  2. Base Score Calculation: Assigns initial scores based on capacity utilization and traffic conditions, with priority levels from very low to high.
  3. Additional Score Computation: Calculates supplementary scores for delivery time windows and distance factors, with higher scores for shorter timeframes and distances.
  4. Route Classification: Determines the final route classification by evaluating the total score against predefined thresholds, resulting in a clear approval status with supporting message.

Where teams use it

  • Last-mile delivery operations
  • Food delivery services
  • Parcel and package delivery
  • Grocery delivery services
  • Field service technician routing
  • Multi-stop urban deliveries
  • Fleet management optimization

Inside the decision model

Delivery Route Optimizer ships as a JDM decision graph with 4 nodes, 2 decision tables and 10 rules. Download it, load it into GoRules, and run it as-is on Zen Engine.

Decision graph4 nodes · read-only
input requesttable evaluate_base_scoreexpression calculate_additional_scorestable determine_route_approval
01

Request

input

Each candidate arrives as a single route object carrying capacityUtilization, trafficCongestionMinutes, deliveryWindowMinutes, and distanceKm, plus an id and name for reporting. The scoring stages read these fields directly, so no enrichment happens before evaluation.

Sample requestJSON
{
  "route": {
    "id": "R1234",
    "name": "Downtown Loop",
    "capacityUtilization": 0.85,
    "trafficCongestionMinutes": 12,
    "deliveryWindowMinutes": 45,
    "distanceKm": 8.5,
    "otherCondition": "normal"
  }
}
02

Evaluate Base Score

table

Base scoring pairs route.capacityUtilization with route.trafficCongestionMinutes under a first hit policy, so the fullest, least congested combination wins. Utilization above 0.8 with congestion under 15 minutes scores 100 with 'high' priority, the same utilization in heavier traffic drops to 80 and 'medium', mid-range utilization above 0.5 lands at 70 or 60 around a 20-minute traffic split, light loads under 0.5 with congestion below 30 minutes get 50, and the blank catch-all row assigns 30 with 'very_low'.

Weighting vehicle fill ahead of traffic reflects how route economics work: an underfilled van spreads its fixed cost over fewer stops, which no amount of clear road can recover. The 0.8 and 0.5 cutoffs and the minute thresholds are sensible operational choices rather than industry standards, tuned so a well-loaded route only loses its top band when congestion becomes material.

Decision tablefirst hit policy
Capacity Utilizationroute.capacityUtilizationTraffic Congestion (min)route.trafficCongestionMinutesOther Conditionroute.otherConditionBase ScorerouteScores.baseScorePriorityrouteScores.priority
> 0.8< 15-100'high'
> 0.8> 15-80'medium'
> 0.5< 20-70'medium'
> 0.5> 20-60'low'
< 0.5< 30-50'low'
---30'very_low'
03

Calculate Additional Scores

expression

Two supplementary scores get computed here: timeWindowScore awards 50 points when route.deliveryWindowMinutes <= 30, 30 up to 60 minutes, and 10 beyond, while distanceScore steps from 40 at route.distanceKm <= 5 down to 10 past 20km. Both are added to routeScores.baseScore to form totalScore, the single number the approval table thresholds against. Rewarding tight windows and short hops means urgent, nearby work outranks distant slack deliveries.

Expressions3 fields
timeWindowScoreroute.deliveryWindowMinutes <= 30 ? 50 : (route.deliveryWindowMinutes <= 60 ? 30 : 10)
distanceScoreroute.distanceKm <= 5 ? 40 : (route.distanceKm <= 10 ? 30 : (route.distanceKm <= 20 ? 20 : 10))
totalScorerouteScores.baseScore + $.timeWindowScore + $.distanceScore
04

Determine Route Approval

table

Approval bands cut totalScore with a first hit policy: above 160 the route is classified 'optimal', above 120 'recommended', above 90 'acceptable', all with routeResult.isApproved set to true, and the blank catch-all writes 'not_recommended' with false and the message 'Route is not recommended due to low score.' Each band also emits a human-readable routeResult.message for the dispatcher.

Against the maximum achievable 190 points (100 base plus 50 window plus 40 distance), the 160 bar reserves 'optimal' for routes that are strong on every factor, while 90 marks the floor where running the route still beats replanning it. Splitting classification from the boolean flag lets a dispatch system auto-release approved routes and queue only the rejected ones for manual review, which is a common pattern in fleet operations.

Decision tablefirst hit policy
Total ScoretotalScoreRoute ClassificationrouteResult.classificationIs ApprovedrouteResult.isApprovedMessagerouteResult.message
> 160'optimal'true'Route is optimal with high score.'
> 120'recommended'true'Route is recommended with good score.'
> 90'acceptable'true'Route is acceptable with moderate score.'
-'not_recommended'false'Route is not recommended due to low score.'

Make this template
your own.

Load Delivery Route Optimizer into GoRules, adjust the rules to your policy, and ship it behind your own API.