Welcome to the FlexiMove Logistics Optimization project! This repository documents our journey in solving complex vehicle routing problems (VRP) using AI-driven algorithms, innovative data visualization, and a step-by-step exploration of real-world logistics challenges.
FlexiMove Logistics aims to address the challenges of modern logistics by developing an intelligent, adaptable AI agent to optimize delivery routes. The project focuses on achieving cost efficiency, reducing environmental impact, and ensuring timely deliveries, thereby enhancing overall customer satisfaction.
Our AI agent integrates multiple routing optimization algorithms and is designed to:
- Minimize travel distances for all deliveries.
- Dynamically adapt to real-time conditions such as traffic or new customer orders.
- Provide a user-friendly interface with informative data visualizations to understand optimization improvements.
Our solution utilizes heuristic and clustering-based algorithms combined with real-time adjustment capabilities to tackle the VRP problem effectively. The implemented approaches include:
This heuristic provides an efficient way to generate initial routes by prioritizing the nearest unvisited customers. It aims to quickly identify a reasonable solution that can be further refined.
The Sweep Algorithm clusters customers based on their angular positions relative to the depot, forming smaller, more manageable groups that allow for optimal routing. Each cluster then undergoes further optimization, resembling a Traveling Salesman Problem (TSP) solution.
The initial routes are further refined using the 2-Opt algorithm. This iterative algorithm looks for opportunities to swap two segments within a route to achieve a lower total distance, improving overall efficiency.
Key functionalities include:
- Static and Dynamic Route Optimization: Efficiently calculate routes for different vehicle configurations.
- Visual Comparison of One vs. Two Vehicles: Compare route efficiency using one or two vehicles to help demonstrate the impact of increased fleet capacity.
- Performance Tracking: Evaluation metrics like distance traveled, on-time delivery rates, and overall efficiency improvements are generated.
Three synthetic datasets form the backbone of our logistics optimization solution:
- Distance Matrix: Represents pairwise distances between depot and customer locations, generated programmatically based on geographic coordinates.
- Customer Demands: Provides customer demand values at each location, designed to represent realistic logistics demands.
- Truck Capacities: Maximum load capacities for each vehicle in the fleet, used to ensure efficient load balancing across deliveries.
All datasets are automatically generated and formatted for scalability, allowing for easy modifications.
Generates initial routes by always selecting the nearest unvisited customer, resulting in a quick and relatively optimized solution. This heuristic is especially useful when a fast response is required.
Clusters customers based on their geographic position, allowing for efficient group deliveries. The clustering is then optimized using TSP heuristics to minimize travel within each group.
Further optimizes initial routes by systematically reversing segments to find a route with reduced distance. This ensures the final route achieves significant efficiency gains over the initial heuristic.
To evaluate the solution's performance, we use the following key metrics:
-
On-Time Delivery Rate: Percentage of deliveries completed within the expected time frame.
(( ext{Deliveries Made on Time} / ext{Total Deliveries}) imes 100%)
-
Total Distance Traveled: The sum of all distances covered by all vehicles. A lower value indicates better optimization.
-
Fuel Efficiency Improvement: Measures the percentage improvement in fuel consumption compared to a baseline scenario.
(( ext{Baseline Fuel} - ext{Optimized Fuel}) / ext{Baseline Fuel} imes 100%)
-
Customer Satisfaction: Calculated based on post-delivery feedback, reflecting the efficiency and timeliness of deliveries.
-
Clone the repository:
git clone https://github.com/hosseinzamanlou/FlexiMoveLogistics.git
-
Install dependencies:
pip install -r requirements.txt
-
Generate Synthetic Datasets:
python generate_datasets.py
-
Run Route Optimization Solutions:
python run_vrp_solutions.py
-
Visualize Routes and Metrics:
- Open the generated results in your browser or review the plots saved in the
outputs/
folder.
- Open the generated results in your browser or review the plots saved in the
The solution provides visual representations of:
- All Addresses: Displays all customer locations and depot on a 2D plane using distinct colors.
- Static Route Optimization: Shows results of the three route optimization algorithms (Nearest Neighbor, Sweep, 2-Opt) for one-vehicle and two-vehicle scenarios.
- Comparative Analysis: Visual matrices highlight the difference between using a single vehicle vs. multiple vehicles, demonstrating the efficiency improvements.
- **Alexander Gafirov | Cédric Fink | Hossein Zamanlou | Patricia Abel | Patrick Sigg **: Original concept, data generation, algorithm implementation, and optimization.
We welcome feedback, suggestions, and collaborations! Please feel free to open an issue or submit a pull request if you'd like to contribute.
This project is licensed under the MIT License.
Happy optimizing! 🚛