Skip to content

Elkholtihm/smart_logistics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart logistics

Smart Logistics Optimization Platform - An intelligent Vehicle Routing Problem (VRP) solver using Genetic Algorithms and Optuna hyperparameter optimization.

What's Inside

Core Features

  • Genetic Algorithm Solver: Evolutionary optimization for route planning
  • Optuna Integration: Automatic hyperparameter tuning for optimal results
  • Multi-Constraint Handling: Fuel capacity, load limits, time windows
  • Real-time Monitoring: Live progress tracking and visualization
  • Interactive Web Interface: User-friendly Django-based UI
  • Stop Control: Ability to halt optimization mid-process
  • Detailed Analytics: Route feasibility reports and constraint violation analysis

Project Components

"""
vrp_project/
├── manage.py
├── vrp_project/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   ├── wsgi.py
│   └── asgi.py
├── vrp_solver/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── models.py
│   ├── views.py
│   ├── urls.py
│   ├── forms.py
│   ├── genetic_algorithm.py  # Your existing GA code
│   ├── tasks.py
│   ├── templates/
│   │   └── vrp_solver/
│   │       ├── index.html
│   │       ├── upload.html
│   │       ├── progress.html
│   │       └── results.html
│   └── static/
│       └── vrp_solver/
│           ├── css/
│           │   └── style.css
│           └── js/
│               └── progress.js
└── media/
    └── uploads/

Key Files Explained

genetic_algorithm.py (Core Algorithm)

  • Data loading and parsing
  • Distance and route calculations
  • Fitness evaluation with penalties
  • Genetic operators (selection, crossover, mutation)
  • Fuel station management
  • Optuna hyperparameter optimization
  • Progress callbacks for Django integration

models.py (Database Schema)

  • VRPJob model: tracks optimization jobs
  • Fields: status, progress, fitness, routes, parameters
  • Stores uploaded files and results

views.py (Business Logic)

  • File upload handling
  • Background job processing
  • Real-time progress API
  • Stop job functionality
  • Results display

templates/ (User Interface)

  • Responsive Bootstrap 5 design
  • Real-time JavaScript updates
  • Progress bars and status indicators
  • Detailed route visualization

Installation & Setup

Step 1: Clone or Download

# Option A: Clone with Git
git clone https://github.com/yourusername/smartlogix.git
cd smartlogix

# Option B: Download ZIP and extract
cd smartlogix-main

### Step 2: Create Virtual Environment
# Create virtual environment
python -m venv venv

# Activate it
# Windows:
venv\Scripts\activate

# macOS/Linux:
source venv/bin/activate

### Step 3: Install Dependencies
# Install all required packages
pip install -r requirements.txt

### Step 4: Setup Database
# Navigate to Django project
cd vrp_project

# Create database tables
python manage.py makemigrations
python manage.py migrate

# (Optional) Create admin user
python manage.py createsuperuser

### Step 5: Run Development Server
# Start Django server
python manage.py runserver

Dataset Description

Electric Vehicle Routing Problem Dataset (Schneider et al., 2014)

This dataset provides benchmark instances for the Electric Vehicle Routing Problem with Time Windows (E-VRPTW).
Each instance models a delivery network where electric vehicles (EVs) must serve customers while considering battery limitations, recharging, and load constraints.

Dataset Structure

Each location in the instance includes:

  • StringId – unique identifier
  • Type – location type:
    • d: depot
    • f: recharging station
    • c: customer
  • x, y – coordinates (Euclidean distances)
  • demand – cargo demand at customer
  • ReadyTime / DueDate – time window for service
  • ServiceTime – duration of service at the customer

Vehicle Parameters

All vehicles are identical and defined by:

  • Q – battery (energy) capacity
  • C – cargo load capacity
  • r – energy consumption rate (per distance unit)
  • g – inverse charging rate (time per energy unit)
  • v – average travel velocity

Source

Schneider et al., 2014 – E-VRPTW Benchmark Dataset (Mendeley Data)

Demonstrative Video

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors