finds.dev← search

// the find

iRB-Lab/py-ga-VRPTW

★ 661 · Python · MIT · updated May 2026

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

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →