Dynamic Delivery

Technologies

  • Python
  • Math Library
  • Time Library
  • Custom Truck Module
  • Hash Tables
  • Lists & Sets
  • Distance Matrix
  • Algorithmic Sorting & Searching
  • Graph Theory (Potentially)
  • Simulation/Optimization Tools (Potentially)

Skills

  • Algorithm Design & Optimization
  • Data Structures
  • Object-Oriented Programming (OOP)
  • Mathematical Reasoning
  • Recursion & Iteration
  • Complexity Analysis
  • File Handling & Data Processing
  • Problem-Solving
  • Parallel Processing (Optional)
  • Software Testing & Debugging
Slide 0Slide 1Slide 2Slide 3
animation

Dynamic Delivery

This project is designed to optimize the delivery route of packages using a truck-based system. The program processes package data, determines deadlines, and sorts deliveries to minimize travel distances. The find_deadlines function identifies time-sensitive packages and separates them from end-of-day deliveries, creating an efficient sequence for prioritization. Using a recursive algorithm, min_distance sorts packages based on their proximity, ensuring that trucks follow the shortest possible routes. The project integrates various utility functions, such as get_address_id and get_distance, to retrieve addresses and calculate distances, enabling precise route optimization.


To enhance efficiency, the program identifies packages that are “on the way” by employing a geometric approach. It calculates the midpoint between two stops and determines an optimal area in which additional packages can be added to the route without significantly increasing total travel distance. By leveraging the Pythagorean theorem, the algorithm establishes a delivery radius and incorporates nearby packages within the calculated zone. This method ensures that the delivery sequence remains efficient while maximizing the number of packages transported per trip. Additionally, the system handles special cases, such as delayed shipments and packages with incorrect addresses, updating their statuses accordingly.


The final stages of the program involve truck and driver assignment. The get_trucks_and_hub_list function organizes packages into available trucks while ensuring that no vehicle exceeds its maximum load capacity. The program also merges grouped deliveries when necessary, ensuring efficient use of resources. Once trucks are loaded, process_trucks updates package statuses, indicating which truck they are assigned to. Finally, the system assigns drivers to trucks based on availability, ensuring smooth operation. The project effectively integrates data structures, sorting algorithms, and mathematical calculations to optimize delivery logistics, making it a robust solution for package routing and distribution.