Package Delivery Router - Traveling Salesperson Problem
WGU Data Structures and Algorithms Project
This command-line Python application simulates package delivery logistics for a fictional shipping company operating in the Salt Lake City, UT area. Designed as part of WGU’s Data Structures and Algorithms coursework, the system models real-world delivery constraints, using a nearest neighbor algorithm to optimize delivery routes across three trucks.
The application reads package information from a spreadsheet and calculates efficient delivery paths using a distance matrix that maps address-to-address travel times. It also simulates delivery progression, tracking timestamps and package statuses throughout the day.
To ensure fast lookups and smooth scalability, hash maps were used to manage package data, and a greedy nearest neighbor algorithm was implemented for route planning—favoring practicality and performance in a limited-time scenario.
Key Features
- 🚚 Multi-truck delivery simulation
- Simulates real-time deliveries for three trucks, each pre-loaded with different packages and subject to specific time constraints.
- 📍 Route optimization with nearest neighbor
- Implements a greedy algorithm to create efficient delivery sequences with minimal total distance traveled.
- 🧮 Hash maps for fast data access
- Package data is stored in custom hash maps to allow constant-time lookups, improving performance across thousands of operations.
- 🗂️ Spreadsheet & distance matrix integration
- Uses a CSV file for package input and a distance matrix to calculate shortest paths between delivery points.
- ⏱️ Delivery status tracking
- Updates and displays delivery time and status as the simulation runs, mimicking the timeline of a real distribution process.
Tech Stack
Language
- Python
IDE
- Visual Studio Code
Key Concepts
- Custom Hash Map for package storage
- Nearest Neighbor Algorithm for delivery route calculation
- File I/O using CSV for package and distance data
Figures



