Heuristic Solver for Vehicle Routing Problems in Logistics Using Go
This article introduces a lightweight Go-based heuristic solver designed for a wide range of logistics optimization problems such as vehicle routing, scheduling, and warehouse planning, detailing its algorithmic repertoire, configurable architecture, and real‑world deployment cases.
Preface
With the rapid development of the logistics industry, many operational research problems such as route planning and intelligent scheduling need to be solved. Our self‑developed Go language heuristic solver is lightweight, highly extensible, and equipped with a rich set of built‑in algorithms, enabling fast deployment in business projects to reduce costs and increase efficiency.
Heuristic Solving Widely Applied in the Logistics Industry
The logistics sector, as a capital‑intensive industry, constantly faces the challenge of rational resource planning and utilization, including route planning, area partitioning, intelligent scheduling, and warehouse network design. These business problems correspond to classic operational‑research optimization problems.
Solving optimization problems essentially searches the solution space for a global optimum or an acceptable near‑optimal solution within a given time window. Two main solution approaches exist: integer programming and heuristic algorithms. Integer programming (e.g., branch‑and‑bound) can yield good results for small, one‑off problems but scales poorly. Heuristic algorithms construct an initial solution with problem‑specific strategies and iteratively guide the search toward high‑quality solutions, offering superior efficiency and scalability for real‑world business problems.
Complex and Diverse VRP Solving Scenarios
Vehicle Routing Problem (VRP) is the most widely studied and solved business scenario in logistics. VRP seeks the optimal routes for delivery vehicles to satisfy heterogeneous customer demand. VRP is non‑linear, non‑convex, and contains many inter‑dependent constraints, making it an NP‑hard problem.
In practice, customer requirements vary greatly, leading to numerous VRP variants. The main supported and under‑development VRP scenarios include:
VRPTW – VRP with time windows; customers require deliveries within specific time intervals.
CVRP – Capacitated VRP; vehicles have volume and weight limits.
OVRP – Open VRP; outsourced vehicles may not need to return to the depot after delivery.
SDVRP – Split‑delivery VRP; e.g., cold‑chain logistics where different temperature goods require separate vehicles.
Skill VRP – Fixed‑vehicle VRP; certain tasks must be performed by designated vehicles.
VRPPD – Pickup‑and‑delivery VRP; simultaneous transport of upstream raw materials and downstream finished goods.
MDVRP – Multi‑depot VRP; multiple warehouses serve the same region.
Heterogeneous Fleet VRP – Different vehicle types with varying capacities, regulations, and costs.
Milk‑run VRP – Multi‑trip VRP; a vehicle can perform multiple delivery rounds (e.g., morning and night).
EVRP – Electric‑vehicle VRP; includes charging management for electric fleets.
Rich and Configurable Heuristic Algorithms Available
To meet diverse scenario requirements and deep modeling needs, we have independently developed a Go‑based heuristic solver that is lightweight and comes with a rich set of built‑in algorithms. Users only need to define the problem, configure algorithms and parameters, and start solving. The currently configurable heuristic algorithms are illustrated below.
Sweep – Scanning algorithm that inserts customers clockwise based on angle to the depot.
Farthest – Starts from the farthest customer and inserts the nearest next customer iteratively; Cluster – Constructs an initial solution by clustering customers geographically.
GRASP – Greedy Randomized Adaptive Search Procedure, a multi‑start meta‑heuristic that builds diverse initial solutions.
Local Search – Simple greedy search that moves to a neighboring solution based on an acceptance criterion.
ILS – Iterated Local Search, adds perturbations to escape local optima.
FLS – Fast Local Search, prunes the search space to promising sub‑regions for speed.
RASD – Divide‑and‑conquer, searches selected sub‑problems to obtain local optima and iteratively refines the global solution.
ALNS – Adaptive Large Neighborhood Search, destroys and rebuilds solutions with adaptive selection.
VNS – Variable Neighborhood Search, alternates among different neighborhood structures.
GES – Vehicle reduction algorithm, attempts to merge routes to reduce fleet size.
Simulated Annealing, Late Acceptance, Tabu Search and many other heuristics.
In addition to algorithms, we provide a variety of operators, selection methods, termination conditions, constraints, and objective functions. The entire solving workflow is highly modular, plug‑and‑play, and extensible.
Easy to Extend and Customize for Practical Deployment
In real deployments, customized requirements often arise on top of standard problems. By extending the core solver with scenario‑specific definitions and service‑oriented development, a complete solution architecture can be built, as shown below.
Two implemented scenarios are presented as examples:
ROS Outbound Background: Built a SaaS system to meet customers' route‑planning needs. Challenge: Diverse customer demands require high stability and availability. Practice: Added more than ten common constraints (e.g., delivery order, same‑vehicle orders, incompatibility) that can be toggled per scenario; reused built‑in algorithms and operators for high‑concurrency service. Result: Achieved performance comparable to or better than the open‑source solver OPTA, with stronger extensibility; already used by external customers.
Ground Intelligent Scheduling Background: With electric vehicles replacing fuel vehicles, assign drivers reasonable transport tasks and sequences. Challenge: EV routing is an emerging research topic with complex real‑world constraints and hard‑to‑quantify driver experience factors. Practice: Abstracted experience‑related objectives (e.g., driver work‑time standard deviation) into hierarchical constraints; added targeted operators (e.g., reduce empty mileage, avoid back‑and‑forth); leveraged the EVRP model and algorithms in the solver. Result: Delivered metrics and efficiency far exceeding project targets, facilitating successful rollout.
Outlook
Through relentless effort by the optimization team, we have built a complete heuristic solver from scratch and achieved impressive real‑world results. Going forward, we will continue to deepen solving capabilities, expand business scenarios, and broaden the scope of operational‑research problems to further empower the logistics industry.
END
Beijing SF i-TECH City Technology Team
Official tech channel of Beijing SF i-TECH City. A publishing platform for technology innovation, practical implementation, and frontier tech exploration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.