← dean's list
algorithms · 2026 · ✓ complete

Package Delivery Routing System

Genetic Algorithm solving truck loading + delivery order in a single fitness function

view on github ↗
architecture

The WGU capstone used a static nearest-neighbor algorithm with hard-coded truck loading for exactly 40 packages and 3 trucks. It could not handle real-world randomness, variable package counts, or custom constraints like refrigeration requirements.

Custom Genetic Algorithm that simultaneously solves the truck loading and delivery order problem in a single fitness function. Packages and trucks are generated randomly per run. Sentinel-based chromosome encoding separates truck routes within a flat array. Delivered as a configurable CLI tool with per-package status lookup post-run.

  • Single fitness function handles both truck assignment and delivery sequence simultaneously
  • Adaptive mutation: rate doubles after 50 stagnant generations, resets on improvement to escape local optima
  • Scramble + inversion mutation operators for search space exploration
  • Sentinel-aware ordered crossover preserves truck boundary constraints during recombination
  • Early termination after 500 stagnant generations
  • Capacity-aware population seeding gives the GA a rational baseline from generation zero
  • Per-package status lookup by ID or address via CLI post-run
PythonGenetic AlgorithmCLI