PitchHut logo
Fleet Route Optimizer
Advanced logistics and delivery route planning for optimized fleet operations.
Pitch

Fleet Route Optimizer is a powerful web application that addresses complex vehicle routing challenges. It incorporates advanced constraints such as vehicle capacity and time windows, while using real travel data for enhanced accuracy. With integration of leading solver engines and an interactive UI, efficient fleet optimization is simplified.

Description

Fleet Route Optimizer (CVRPTW)

Capacitated Vehicle Routing Problem with Time Windows is an advanced optimization system designed specifically for logistics and delivery route planning. This comprehensive web-based application addresses complex vehicle routing challenges by incorporating various constraints, making it suitable for businesses aiming to optimize their delivery efficiency.

Overview

Fleet Route Optimizer offers a solution that includes:

  • Vehicle Capacity: Each vehicle's load capacity is effectively managed.
  • Time Windows: Ensures deliveries are made within designated time slots.
  • Fleet Optimization: Strategically reduces the number of vehicles used while maximizing their utilization.
  • Real Distance Matrix: Utilizes actual travel distances and times influenced by traffic patterns throughout the day.
  • Dynamic Service Time: Delivery efficiency is improved based on package size, with calculated service times.

Key Features

  • Multiple Solver Engines: Capable of using both OR-Tools (open-source) and Gurobi (commercial) for optimal solutions.
  • Interactive Web UI: Real-time visualization aids in route management and decision-making.
  • Map Integration: Routes are visually represented on interactive maps for better clarity.
  • Distance Cache: Implements persistent storage to minimize redundant calculations.
  • Real Distance Matrix: Leverages OSRM routing service for precise travel times.
  • Time-Based Routing: Adjustments made for different travel conditions during the day.
  • Detailed Analytics: Comprehensive metrics and statistics support data-driven decisions.
  • Docker Support: Facilitates easy deployment using Docker Compose.
  • Clean Architecture: Adopts a modular, maintainable, and scalable codebase, prioritizing best practices in software design.
  • Real-Time Log Streaming: Server-Sent Events allow for live tracking of optimization processes.
  • Pydantic Models: Ensures type-safe data validation and serialization.

Project Structure

The application follows Clean Architecture principles, distinctly delineating the different layers involved:

  • API Layer: Handles HTTP endpoints.
  • Core Layer: Contains the business logic and solver implementations.
  • Service Layer: Manages the orchestration of business logic processes.
  • Models Layer: Incorporates type-safe data structures using Pydantic.
  • Utils Layer: Holds reusable helper functions.
  • Config Layer: Manages environment-based configuration.

Design patterns employed include:

  • Factory Pattern
  • Service Layer Pattern
  • Repository Pattern
  • Dependency Injection
  • Abstract Base Classes

API Endpoints

Several endpoints are provided for interactions:

  1. Health Check:

    GET /health
    

    Returns the status of the service.

  2. Solve Problem:

    POST /solve?time_limit=60&solver=ortools
    Content-Type: application/json
    {
        "date": "2025-01-15",
        "depot": { "location": [45.464, 9.190] },
        "vehicles": [ { "id": "V1", "capacity_units": 33, "time_window": { "start_min": 240, "end_min": 1260 } } ],
        "customers": [ { "id": "C1", "name": "Customer 1", "location": [45.470, 9.200], "demand_units": 10, "time_window": { "start_min": 480, "end_min": 720 } } ]
    }
    

    Offers a complete solution with metrics and timeline.

  3. Real-Time Streaming Solution:

    POST /solve-stream?time_limit=60&solver=ortools
    Content-Type: application/json
    // Payload same as /solve
    

    Streams optimization logs and results in real-time.

  4. Download Example Files:

    GET /download-examples
    

    Returns JSON files for various input sizes.

Performance Considerations

  • Incorporates a Distance Cache to enhance performance by caching requests to the OSRM API.
  • Utilizes traffic patterns to optimize delivery times based on scheduled windows.
  • Offers the choice of solvers based on needs for speed or optimality.
  • The architecture promotes maintainability and scalability while ensuring data integrity through the use of type safety.

Contribution

Contributions to the project are encouraged. Interested developers can fork the repository, create feature branches, and follow established code structure and style guidelines for submitting pull requests.

For detailed development practices and architectural insights, refer to the project's documents.

Conclusion

Fleet Route Optimizer presents an invaluable tool for logistics operations, significantly enhancing delivery efficiency through advanced resource allocation and route planning techniques. By leveraging modern technologies like FastAPI, React, and Docker, it provides a robust solution for businesses aiming to streamline their logistics processes.

0 comments

No comments yet.

Sign in to be the first to comment.