industries

Pyvorin for Route Optimisation

VRP, TSP, and last-mile delivery algorithms.

Published May 30, 2026

Vehicle Routing Problem

Savings algorithm and sweep heuristic for VRP solutions.

def savings_algorithm(depot, customers, capacity):
    routes = [[depot, c, depot] for c in customers]
    savings = []
    for i in customers:
        for j in customers:
            if i != j:
                s = distance(depot, i) + distance(depot, j) - distance(i, j)
                savings.append((s, i, j))
    savings.sort(reverse=True)
    # merge routes based on savings...
    return routes

Travelling Salesman

2-opt and simulated annealing for TSP improvement.

Last-Mile Delivery

Time-windowed delivery optimisation.