Skip to content

xPushpeshx/amazonPrime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🚚 Amazon Delivery Truck Scheduling

A Python project to simulate and optimize Amazon delivery truck routes.
It models delivery addresses, constructs routes, applies optimization heuristics, schedules multiple trucks, and handles dynamic deliveries (new orders each day).


📌 Features

  • Address & Route Modeling: Delivery points with coordinates, Prime flag, and depot handling.
  • Greedy Route Construction: Nearest-neighbor heuristic for quick route generation.
  • 2-opt Optimization: Improves routes by swapping path segments.
  • Multi-Truck Scheduling: Splits deliveries across multiple trucks.
  • Amazon Prime Constraint: Keeps Prime deliveries fixed.
  • Dynamic Simulation: Adds new deliveries each day and runs scheduling.

📂 Project Structure

amazon_truck_scheduling/
│
├── amazon/             # Core package
│   ├── address.py      # Address class
│   ├── address_list.py # AddressList utilities
│   ├── route.py        # Route construction
│   ├── optimizer.py    # Route optimization (2-opt)
│   ├── scheduler.py    # Multi-truck scheduling
│   └── simulation.py   # Dynamic delivery simulation
│
├── main.py             # Entry point (demo & tests)
├── tests/              # Unit tests
├── data/               # Sample input data
└── README.md           # Project overview

▶️ Usage

1. Clone the project

git clone https://github.com/yourusername/amazon-truck-scheduling.git
cd amazon-truck-scheduling

2. Run the demo

python main.py

3. Run tests

pytest tests/

📊 Example Output

--- Single Route (Greedy + 2-opt) ---
Greedy route: [Depot -> A1 -> A2 -> ... -> Depot]
Optimized route length: 72.1

--- Multi-Truck Scheduling ---
Truck 1 route: [Depot -> ...] | Length: 50.3
Truck 2 route: [Depot -> ...] | Length: 46.7

--- Simulation (Dynamic Deliveries) ---
Day 1 - Truck 1 route: [Depot -> ...] | Length: 40.2
Day 1 - Truck 2 route: [Depot -> ...] | Length: 42.8

🔮 Future Improvements

  • Genetic Algorithm-based optimization
  • Real-world datasets (OSM, Google Maps API)
  • Fuel/time cost modeling
  • Visualization of routes on a map

📜 License

MIT License – free to use and modify.

About

optimize Amazon delivery truck routes with Prime features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages