Routing Problems
Optimal Paths Through Complex Networks
From the classical Traveling Salesman Problem to time-windowed vehicle routing, this family addresses the fundamental challenge of finding minimum-cost traversals across graphs and networks. These NP-hard problems underpin modern logistics, transportation, and supply chain optimization.
Quick Navigation
Traveling Salesman Problem
Given n cities and pairwise distances, find the shortest Hamiltonian cycle visiting each city exactly once and returning to the start. The symmetric variant (TSP) uses undirected distances; the asymmetric variant (ATSP) uses directed distances where d(i,j) ≠ d(j,i). One of the most studied combinatorial optimization problems, serving as the benchmark for algorithm development since the 1950s.
Try It Yourself
| Algorithm | Distance | Time | Gap |
|---|---|---|---|
| No results yet | |||
Need to Solve Larger Instances?
This demo handles up to 15 cities for educational purposes. For real-world instances, custom solutions, or research collaboration:
Capacitated Vehicle Routing Problem
Given n customers with demands, a depot, and a fleet of identical vehicles with capacity Q, find a set of routes (depot → customers → depot) that minimize total travel distance while visiting each customer exactly once and respecting vehicle capacity. CVRP simultaneously addresses the clustering of customers into feasible routes and the sequencing of customers within each route.
Try It Yourself
| Algorithm | Distance | Vehicles | Time |
|---|---|---|---|
| No results yet | |||
Need to Solve Larger Instances?
This demo handles up to 12 customers. For real-world routing with hundreds of stops:
Vehicle Routing with Time Windows
Extends the CVRP with time window constraints [ei, li] for each customer. Vehicles must arrive at customer i no later than li; if arriving before ei, they must wait. Each customer requires si service time. The depot has a planning horizon [E0, L0]. The interplay between capacity constraints and time feasibility makes VRPTW significantly harder than CVRP.
Try It Yourself — VRPTW demo
| Algorithm | Distance | Vehicles | Feasible | Time |
|---|
Time Window Feasibility
A route is feasible if every customer is reached before its late window li. Early arrivals cause waiting (shown in the timeline). The timeline shows each vehicle’s schedule: travel (dark), waiting (striped), and service (solid) segments.
Problem Variants
Extensions and specializations of the core routing problems implemented in this repository
Asymmetric TSP
Directed distances break symmetry, making the problem materially harder — Christofides’ 3/2-approximation does not apply. Applications include one-way streets, flight routing, and task sequencing with direction-dependent setup times.
Multi-Depot VRP
Vehicles are stationed at multiple depots. Each customer is assigned to a depot and served by that depot’s fleet. Combines facility assignment with vehicle routing.
Pickup & Delivery
Each request has a pickup and delivery location with precedence constraint (pickup before delivery) on the same vehicle. Adds pairing and precedence to VRPTW constraints.
Open VRP
Vehicles end their routes at the last customer instead of returning to the depot. Models contractor-based deliveries where drivers go home after their last stop.
Electric VRP
Vehicles have limited battery range and may need to detour to recharging stations. Adds energy consumption modeling and recharge scheduling to CVRP.
Split Delivery VRP
A customer’s demand may be split across multiple vehicles. Relaxes the single-visit constraint, potentially reducing total distance at the cost of coordination complexity.
References
TSP Foundations
Dantzig, G., Fulkerson, R. & Johnson, S. (1954). Solution of a large-scale traveling-salesman problem. JORS, 2(4).
Held, M. & Karp, R. (1962). A dynamic programming approach to sequencing problems. JSIAM, 10(1).
Held, M. & Karp, R. (1970). The traveling-salesman problem and minimum spanning trees. Operations Research, 18(6).
Christofides, N. (1976). Worst-case analysis of a new heuristic for the travelling salesman problem. Tech. Report 388, CMU.
Lin, S. & Kernighan, B. (1973). An effective heuristic algorithm for the TSP. Operations Research, 21(2).
Croes, G. (1958). A method for solving traveling-salesman problems. Operations Research, 6(6).
Davis, L. (1985). Applying adaptive algorithms to epistatic domains. IJCAI-85.
Reinelt, G. (1991). TSPLIB — A traveling salesman problem library. ORSA J. Computing, 3(4).
Applegate, D. et al. (2006). The Traveling Salesman Problem: A Computational Study. Princeton.
Rosenkrantz, D., Stearns, R. & Lewis, P. (1977). An analysis of several heuristics for the TSP. SIAM J. Computing, 6(3).
VRP & VRPTW
Clarke, G. & Wright, J. (1964). Scheduling of vehicles from a central depot to a number of delivery points. Operations Research, 12(4).
Solomon, M. (1987). Algorithms for the VRPTW. Operations Research, 35(2).
Prins, C. (2004). A simple and effective evolutionary algorithm for the VRP. Computers & OR, 31(12).
Ropke, S. & Pisinger, D. (2006). An adaptive large neighborhood search heuristic for the PDPTW. Transportation Science, 40(4).
Cordeau, J.-F., Laporte, G. & Mercier, A. (2001). A unified tabu search heuristic for VRPs with TW. JORS, 52(8).
Desrochers, M., Desrosiers, J. & Solomon, M. (1992). A new optimization algorithm for the VRPTW. Operations Research, 40(2).
Toth, P. & Vigo, D. (2014). Vehicle Routing: Problems, Methods, and Applications. 2nd ed., SIAM.
Potvin, J.-Y. & Bengio, S. (1996). The vehicle routing problem with time windows — Part II: Genetic search. INFORMS J. Computing, 8(2).
Exact Methods in Practice
How large routing instances are solved to proven optimality
Branch-and-Cut (TSP)
Solves the LP relaxation of the DFJ formulation, identifies violated subtour-elimination constraints (cutting planes), adds them dynamically, and branches on fractional variables. The Concorde solver (Applegate et al., 2006) has solved TSPLIB instances with up to 85,900 cities to proven optimality using this approach.
Branch-and-Price (CVRP)
Reformulates CVRP as a set-partitioning problem: choose a minimum-cost subset of feasible routes covering all customers. The exponential number of routes is handled by column generation — a pricing subproblem (shortest path with resource constraints) generates promising routes on the fly.
Branch-and-Price (VRPTW)
Extends the CVRP approach: the pricing subproblem becomes an elementary shortest path with resource constraints (ESPPRC), where time windows add a time resource alongside capacity. Desrochers, Desrosiers & Solomon (1992) established the foundational column-generation framework.
● Small instances (n ≤ 20–25): Exact methods (Held-Karp DP, B&B) find proven optima. Good for teaching and verification.
● Medium instances (n ≤ 300): Branch-and-cut/price can solve to optimality. Construction + local search for fast approximations.
● Large instances (n > 300): LKH for TSP; ALNS / LNS for VRP/VRPTW. Metaheuristics dominate practical large-scale routing.
Problem Hierarchy
The routing family forms a natural generalization chain (simplified view)