problem solved
This package routing system is a rebuild of a previous academic project.
The original academic solution only accounted for a set number of packages and trucks. Additionally, package loading per truck was hard-coded. This resulted in a "solution" that had zero randomness tolerance and was not scalable.
This solution uses one genetic algorithm to solve both package loading and routing. First, configurable constraint distributions simulator random package generation, and truck counts scale automatically according to demand. The GA then tackles the bulk of the work, testing through thousands of generations which loading + route combination results in the best score (lowest fleet milage & fewest constraints violations).
ga run results
packages routed
converged at gen
fleet mileage
fitness score vs generation
algorithm pipeline
multi-objective scoring
k=3 pressure selection
sentinel-aware recombination
four-strategy adaptive mutation
chromosome encoding
A complete multi-truck routing solution is represented as a single flat array. Negative integers act as sentinels — boundaries between truck routes. Positive integers are bundle IDs. Order within each segment is the delivery sequence for that truck.
This encoding lets a single crossover or mutation operator affect both assignment (which truck gets a bundle) and sequencing (what order it delivers) in one operation.
♜ stack ♖
languages
algorithm
core concepts
cli
testing & tooling