finds.dev

iRB-Lab/py-ga-VRPTW

A Python Implementation of a Genetic Algorithm-based Solution to Vehicle Routing Problem with Time Windows

View on GitHub

★ 661PythonMITupdated May 2026

// the take

A genetic algorithm implementation for the Vehicle Routing Problem with Time Windows (VRPTW), built on top of DEAP. It ships all 56 Solomon benchmark problem instances pre-converted to JSON and handles the full GA loop: PMX crossover, inverse mutation, roulette wheel selection. Aimed at students and researchers who want a working VRPTW baseline to experiment with or extend.

The PMX crossover and inverse mutation implementations are clean and correct for permutation-based chromosomes. All Solomon benchmark instances are included and pre-converted to both text and JSON formats, so you don't have to hunt them down separately. The fitness function properly models wait cost, delay cost, per-distance transport cost, and vehicle startup cost as separate tunable parameters. CSV export of per-generation stats makes it easy to plot convergence without adding instrumentation.

The author openly admits the default parameters produce poor results — the algorithm converges weakly and the included sample runs don't come close to known optimal solutions for R101 or C204. There's no elitism: the population is entirely replaced each generation by offspring, which means good solutions can be lost. The chromosome encoding is a flat permutation with implicit vehicle splitting via constraint checking, which is a fragile representation — a single gene swap can change the number of vehicles used in unpredictable ways. No parallelism support, so scaling to larger instances (200+ customers) will be very slow.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
661
Forks
173
Language
Python
License
MIT
Last commit
21 May 2026

// nearby

If py-ga-VRPTW isn't quite it.

All repos →