This project is a route visualization and traffic simulation system designed to demonstrate shortest path algorithms, k-shortest paths, and real-time vehicle movement on road networks in India.
It combines graph theory, geospatial data, and simulation in an interactive Python GUI.
The project has two main components:
-
Route Finder (Stable)
- Uses OSMnx and NetworkX to build road networks and compute shortest paths.
- Allows selecting start and end locations via geocoding with multiple candidate options.
- Computes k-shortest paths and a longer alternative path.
- Displays route distances in a Tkinter table.
- Visualizes routes in Folium interactive maps.
-
Traffic Simulation (Under Development)
- Simulates vehicle movement on the computed routes using Tkinter + Matplotlib.
- Supports cars and ambulances, with ambulances having priority at traffic lights.
- Traffic lights can be manually toggled or automatically controlled by ambulances.
- Real-time vehicle movement, directional bearings, and dynamic traffic light updates.
- Adjustable simulation speed.
- Location search with geocoding and candidate selection.
- Automatic road network graph generation around chosen points.
- Computes shortest, k-shortest, and longer alternative paths.
- Displays path distances in a table.
- View routes in interactive Folium maps.
- Vehicles follow precomputed routes.
- Ambulance priority at traffic lights.
- Real-time vehicle positions with directional markers.
- Dynamic traffic light control via GUI.
- Adjustable simulation speed.
- Live map display using Matplotlib.
⚠️ Simulation is under development and may have incomplete features.
tkinterthreadingfoliumwebbrowsertempfileosmnxnetworkxgeopyitertoolstime,math,randomPIL(Pillow)matplotlibnumpyrequests
- Run the application:
python traffic_gui.py
- Enter Start Location and End Location.
- Select the correct location from candidate options.
- Click Find Routes.
- View route distances in the table.
- Click Open Map for All Routes to see interactive maps.
- After computing routes, select Car Route and Ambulance Route.
- Adjust Simulation Speed.
- Click Start Simulation.
- Vehicles move along their routes in the live map.
- Traffic lights can be toggled manually; ambulances can override them.
- Click Stop Simulation to end the simulation.
DSA-Route-Simulator/ │ ├── traffic_gui.py # Main GUI application ├── README.md # Project documentation ├── requirements.txt # Python dependencies (to be generated) └── assets/ # Optional: images, icons
- Performance: Large map areas may cause memory issues.
- Simulation: Improve traffic light logic, multiple vehicles, and collision handling.
- UI Enhancements: Interactive traffic light placement and route editing.
- AI/ML Integration: Predict congestion and optimize ambulance routes dynamically.