Skip to content

A machine learning-powered system that optimally allocates vehicles in urban networks based on real-time traffic congestion predictions. This project combines graph theory with predictive modeling to improve traffic flow efficiency and reduce congestion.

Notifications You must be signed in to change notification settings

Navid-Rahman/Vehicle-Allocation-System-Based-on-Traffic-Congestion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Vehicle Allocation System Based on Traffic Congestion

A machine learning-powered system that optimally allocates vehicles in urban networks based on real-time traffic congestion predictions. This project combines graph theory with predictive modeling to improve traffic flow efficiency and reduce congestion.

๐Ÿš€ Features

  • Traffic Prediction: Uses Random Forest Regressor to predict bus counts based on historical traffic data
  • Graph-based Route Analysis: Implements NetworkX for modeling street networks and finding optimal paths
  • Dynamic Vehicle Allocation: Allocates vehicles based on predicted congestion and road capacity
  • Interactive Input System: User-friendly interface for route planning with date/time specifications
  • Visualization: Network graphs showing traffic flow and vehicle allocation

๐Ÿ“Š Dataset

The system uses Chicago Traffic Tracker historical congestion estimates by segment from 2018, containing:

  • Segment IDs for road identification
  • Date and time information
  • Bus count data for traffic volume
  • Street segment information (FROM_STREET, TO_STREET)
  • Road length data for capacity calculations

๐Ÿ› ๏ธ Technologies Used

  • Python Libraries:
    • pandas & numpy - Data manipulation and analysis
    • scikit-learn - Machine learning models (Random Forest Regressor)
    • NetworkX - Graph creation and path analysis
    • matplotlib - Data visualization
    • datetime - Time-based calculations

๐Ÿ—๏ธ System Architecture

  1. Data Preprocessing: Historical traffic data is cleaned and prepared
  2. Feature Engineering: Date conversion to ordinal format for model training
  3. Model Training: Random Forest Regressor learns patterns from historical data
  4. Graph Construction: Street network represented as nodes (intersections) and edges (road segments)
  5. Path Finding: Shortest path algorithms identify optimal routes
  6. Congestion Prediction: ML model predicts traffic for specific date/time
  7. Vehicle Allocation: Dynamic allocation based on predicted congestion and road capacity

๐Ÿ“ˆ Model Performance

The system tracks model accuracy using:

  • RMSE (Root Mean Square Error): Measures prediction accuracy
  • MAE (Mean Absolute Error): Average prediction deviation

๐ŸŽฏ How It Works

  1. Input Collection: Users specify origin, destination, date, and time
  2. Path Analysis: System finds all shortest paths between locations
  3. Traffic Prediction: ML model predicts congestion for each road segment
  4. Allocation Calculation: Vehicles allocated based on:
    • Predicted traffic volume
    • Road segment length/capacity
    • Time-based traffic patterns
  5. Visualization: Results displayed as network graphs with allocation data

๐Ÿšฆ Real-World Applications

  • Public Transit Planning: Optimize bus routes and frequencies
  • Emergency Services: Efficient ambulance and fire truck deployment
  • Ride-sharing: Dynamic vehicle positioning for services like Uber/Lyft
  • City Planning: Data-driven decisions for traffic infrastructure
  • Logistics: Delivery vehicle routing optimization

๐Ÿ“ Usage

The system provides an interactive interface where users can:

  • Enter starting and destination locations
  • Specify travel date (year, month, day)
  • Select time slot (24-hour format with hourly intervals)
  • View predicted congestion and optimal vehicle allocation

๐Ÿ”ฎ Future Enhancements

  • Real-time data integration
  • Multi-modal transportation support
  • Weather impact modeling
  • Mobile application development
  • Integration with city traffic management systems

๐Ÿค Contributing

This project demonstrates the practical application of machine learning in urban transportation systems. The combination of predictive modeling and graph algorithms provides a robust foundation for intelligent traffic management solutions.

About

A machine learning-powered system that optimally allocates vehicles in urban networks based on real-time traffic congestion predictions. This project combines graph theory with predictive modeling to improve traffic flow efficiency and reduce congestion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published