Team Members:
- Piyush Kumar (Team Leader)
- Ayush Kumar
- Bhaskar
- Chandra Prakash
- Kanishk Krishnan
- Overview
- Problem Statement
- Solution Approach
- Features
- Installation
- File Structure
- Usage
- Genetic Algorithm
AgriRoute is an innovative solution designed to address inefficiencies in agricultural supply chains. Our system optimizes the movement of perishable goods across farms, storage hubs, and distribution centers by leveraging a modified Genetic Algorithm to reduce costs and minimize spoilage. The project integrates advanced algorithms with dynamic constraints to deliver scalable, real-time logistics optimization.
Modern agricultural supply chains face several challenges:
- Farms: Geographic dispersion, varying production capacities, and perishability windows.
- Storage Hubs: Limited capacity, high fixed costs, and variable storage costs.
- Distribution Centers: Specific demands with strict deadlines.
- Fleet Management: Diverse vehicle types with varying capacities and operational costs.
- Dynamic Constraints: Traffic, road closures, and fluctuating fuel costs.
Inputs:
- Locations, capacities, and demands for farms, hubs, and distribution centers.
- Fleet specifications and transportation constraints.
- Distance and cost matrices for multi-stage routes.
Outputs:
- Optimized routing and vehicle allocation plans.
- Detailed cost and spoilage analyses.
- Visualization of routes and key performance metrics.
Our solution utilizes a modified Genetic Algorithm to:
- Optimize multi-stage supply chains with competing objectives:
- Minimize costs.
- Reduce spoilage.
- Meet delivery deadlines.
- Handle dynamic real-world disruptions such as traffic and road closures.
- Scale efficiently to support large datasets (e.g., 50+ farms, 20+ hubs, 15+ distribution centers).
- Simulation Tools: Generate realistic logistics scenarios.
- Interactive Dashboard: Visualize routes, allocations, and metrics.
- Benchmarking: Compare against baseline methods like Greedy Heuristics and Linear Programming.
Note: This project also utilizes IBM's CPLEX optimization software, a community platform free for educational institutions. Ensure that the education version of CPLEX is installed to execute the relevant Python files.
- Implements a modified Genetic Algorithm tailored for multi-stage logistical challenges.
- Balances cost, spoilage, and deadline compliance.
- Adapts to dynamic constraints.
- Generate realistic data for farms, hubs, and centers.
- Customize parameters like perishability rates and vehicle capacities.
- Compare our algorithm with baseline methods.
- Evaluate metrics like total cost, spoilage, and computational efficiency.
- Visualize optimized routes on detailed maps.
- Display real-time metrics such as cost and spoilage.
- Simplified user interface for non-experts.
Follow these steps to set up and run the application:
-
Clone the Repository
git clone <repository-url> cd AgriRoute
-
Set Up Environment Variables
- Rename
.env.exampleto.env:mv .env.example .env
- Generate an Azure Maps API Key:
- Create a free account on Azure.
- Create a Maps resource.
- Navigate to the Authentication section in the Azure portal.
- Copy the Primary Key and paste it into the
.envfile.
- Rename
-
Install IBM CPLEX
- Download and install the educational version of IBM CPLEX Optimization Studio from IBM Academic Initiative.
- Ensure the CPLEX Python API is correctly installed.
-
Create a Virtual Environment
- Using Python 3.10 (recommended):
python3.10 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Using Python 3.10 (recommended):
-
Install Dependencies
pip install -r requirements.txt
-
Run the Application
streamlit run main.py
AgriRoute/
├── .env.example # Environment variable template
├── main.py # Entry point for the Streamlit application
├── requirements.txt # Python dependencies
├── data_input.py # Simulation and data generation
├── distance_azure.py # Distance matrix calculation
├── ga_mutation.cpp # Genetic Algorithm core (C++ implementation)
├── ga_mutation.py # Genetic Algorithm wrapper (Python)
├── linear_programming.py # Linear Programming benchmark
├── greedy_kmeans.py # Greedy heuristic benchmark
├── map_data.json # Sample map data
├── ga_solution.json # Genetic Algorithm solution output
├── Readme.md # Documentation (this file)
└── comparison.json # Benchmarking results
Run the following command to start the interactive dashboard:
streamlit run main.py- Input simulated or manual logistics data (farms, hubs, centers).
- Generate distance matrices using Azure Maps.
- Run optimization methods (Genetic Algorithm, Linear Programming, Greedy Heuristics).
- Visualize routes and performance metrics in real-time.
The Genetic Algorithm (GA) is a bio-inspired optimization technique that mimics the process of natural selection. In AgriRoute, GA is tailored to:
-
Chromosome Representation:
- Each chromosome represents a route plan (vehicle assignments and paths).
-
Fitness Function:
- Evaluates total cost, spoilage, and deadline compliance.
-
Genetic Operators:
- Selection: Chooses the best chromosomes based on fitness.
- Crossover: Combines two chromosomes to generate offspring.
- Mutation: Introduces randomness to explore new solutions.
-
Advantages:
- Handles multi-objective optimization.
- Adapts to dynamic constraints (e.g., traffic disruptions).
Thank you for exploring AgriRoute! We hope this project inspires innovative solutions for agricultural supply chain optimization. For more details, refer to the attached AG-12 PPT.pdf.


