This project provides an efficient package delivery system that utilizes data structures, algorithms, and a hash table for efficient package look-up and tracking. The system is built using Python and optimizes the allocation and delivery of packages using three trucks.
- Project Name: Package Delivery Optimization
- Author: Mehdi Rahimi
- Course: C950 Data Structures and Algorithms II
- Institution: Western Governors University (WGU)
- Revision: 1.0
- Date: April 8, 2023
The package delivery system efficiently allocates and delivers packages using three trucks. The system incorporates a modified Greedy algorithm, which utilizes elements of the Nearest Neighbor algorithm and Dijkstra's shortest path algorithm to efficiently deliver packages.
- Efficient package allocation and delivery using three trucks.
- Utilizes data structures, algorithms, and hash tables.
- Optimized for better efficiency and performance.
- Includes package look-up and tracking functionality.
- Allocate packages to trucks based on delivery deadlines, special notes, and truck capacities.
- Start at the hub (depot) as the current location for each truck.
- For each truck, find the shortest path to deliver all the packages assigned to it.
- Update package information and recalculate paths if necessary.
- Keep track of each truck's path, distances traveled, and arrival times at each location.
- Once all packages are delivered, return each truck to the hub.
Algorithm: Modified Greedy Algorithm for Package Delivery
Input:
- Package information (including package ID, address, deadline, and other relevant details)
- Address and distance information for all locations
- Number of trucks
Initialize all trucks and packages Initialize the current time
While there are undelivered packages: For each truck: If the truck is available: Allocate packages to the truck based on the greedy algorithm, considering deadlines and other constraints Calculate the shortest path for the truck using Dijkstra's algorithm Deliver packages following the shortest path Update package and truck status Update the current time
- IDE: PyCharm 2022.3.3 (Professional Edition)
- Python Version: 3.10.9
track_package(): O(N) time complexity, O(1) space complexityview_delivery_status(): O(N) time complexity, O(N) space complexitymain_menu(): O(1) time complexity, O(1) space complexity
- The solution is designed to handle a growing number of packages efficiently using a hash table.
- The algorithm's performance mainly depends on the loading and delivering of packages.
- The software uses modular functions and classes, making it easy to understand and modify.
- The chosen algorithm and data structures are efficient in terms of space and time complexity.
- Strengths: Fast look-up times, efficient use of memory, and easily scalable.
- Weaknesses: Potential collisions may increase look-up time and less efficient space usage when the load factor is high.
The project is organized as follows:
csvReader.py: Reads CSV files containing package and distance information.Distance.py: Manages distance calculations between delivery locations.Hashtable.py: Implements a hash table for efficient package look-up.main.py: The main execution file that runs the delivery algorithm.Package.py: Defines the package data structure.
Additional directories include:
CSV/: Contains the input CSV files (Addresses.csv,Distances.csv,Packages.csv).Screenshots/: Contains screenshots demonstrating the application's functionality.
-
Clone the Repository:
git clone https://github.com/exxxius/PackageDeliveryOptimization.git
-
Navigate to the Project Directory:
cd PackageDeliveryOptimization -
Ensure Python is Installed: Make sure you have Python 3.x installed on your machine. You can download it from python.org.
-
Install Dependencies: Install any required dependencies using pip. You may want to create a virtual environment first.
pip install -r requirements.txt
Run the main.py file to start the package delivery optimization process:
python main.pyHere are some screenshots demonstrating the application's functionality:
This project is licensed under the MIT License. See the LICENSE file for details.


