This project solves a Vehicle Routing Problem (VRP) for optimizing the pickup and drop-off of staff members using a fleet of vehicles with varying capacities.
- Optimized Routing: Minimize the total distance traveled by all vehicles.
- Capacity Constraints: Ensure vehicles do not exceed their passenger capacities.
- Demand Fulfillment: Ensure all staff members are picked up and transported to the depot.
- Customizable Configuration: Define vehicle capacities, starting points, and depot location.
- Python 3.x
ortoolslibrary for solving the VRPgeopandasandmatplotlibfor visualizing the routes and the map
pip install ortools geopandas matplotlib- Each vehicle has a defined capacity, limiting the number of passengers it can carry at any given time.
- The capacity of each vehicle is specified and must be adhered to throughout the routing.
- Each staff member location has a demand of one passenger.
- The depot and vehicle starting points have a demand of zero.
- The total load on a vehicle is the sum of the demands of all visited locations, excluding the depot.
- The depot is the starting and ending point for all routes.
- Vehicles must start and end their routes at the depot.
- Each vehicle has a specified starting location.
- All vehicles end their routes at the depot.
- The distances between locations are calculated using the Euclidean distance formula.
- The total distance for each vehicle's route is the sum of the distances between consecutive locations on that route.
- The routing model must ensure that all staff members are picked up and transported to the depot.
- Each vehicle must respect its capacity constraint while picking up staff members.
- The routes must minimize the total distance traveled by all vehicles.
- The solver uses a specific search strategy to find the optimal or near-optimal routes.
- The search strategy used is "PATH_CHEAPEST_ARC," which builds a solution by repeatedly connecting the nearest node.
- The depot does not contribute to the vehicle load.
- The demand of the depot is always zero and is excluded from the load calculation.
The routes are visualized on a map of Mauritius, showing the paths taken by each vehicle, the distances between stops, and the vehicle loads.
This project is licensed under the MIT License - see the LICENSE file for details.
