Case study
VRP Solver
A custom genetic algorithm for a multi-depot vehicle-routing problem with heterogeneous fleets, pickups, deliveries, and cargo types.
Inside the project
Context
This university project tackles a deliberately complex Vehicle Routing Problem. Five depots, several vehicle types, delivery and pickup points, and three categories of goods create a search space where exhaustive optimisation is impractical.
Role
I modelled the domain and implemented the genetic algorithm in Python, including candidate representation, route evaluation, constraint handling, selection, crossover, and mutation.
Constraints
Every route must respect vehicle capacity and cargo categories while serving both deliveries and pickups. Vehicles start from randomly assigned depots, demand is generated across a two-dimensional map, and collected goods may be reused for later deliveries or returned to storage.
Approach
The solver represents locations with Euclidean distances and evaluates each candidate by route length plus penalties for invalid plans. Evolutionary operators explore new route combinations while preserving enough valid structure to converge toward shorter, feasible solutions.
Outcome
The application produces near-optimal route sets for generated scenarios and provides a practical environment for observing how genetic parameters affect convergence, diversity, and solution quality.
Lessons
Metaheuristics require careful problem representation. Improving the fitness function and preserving useful route fragments often mattered more than adding complexity to the algorithm itself. The project deepened my understanding of optimisation under multiple interacting constraints.
