DSA Resport For Project
DSA Resport For Project
System
Submitted To:
Dr.Inayat-ul-Rehman
Submitted By:
Kacho Ayoub Khan(FA23-BCS-039)
Dua Fatima (FA23-BCS-129)
Muaaz Tasawwar (FA23-BCS-050)
Overview
The Digital Management System (DMS) was created to assist urban traffic
systems by providing route enabling, traffic intensity measurement, and
signal timing all in a single package. The goal of our project is to create an
application that allows users to manage traffic data, calculate shortest paths,
estimate traffic intensity, and determine green signal times given real-world
data.
Goals
1. Normalize urban traffic by routing through optimal pathways to reach
the destination.
2. Tweak the timings of traffic lights based on the roads' density at
various times.
3. Provide analytics on the state of the roads, including those under
construction and possible detours.
4. Interpret external CSV files in real time to aid in traffic analysis.
5. Calculate time to reach a destination while considering traffic intensity
and road distance.
Highlights
1. Locating VIP Trails
This feature calculates and displays the shortest distance for a specific load
between a start intersection point and a target intersection using Dijkstra’s
technique. The software loads the distances from a CSV file and enables the
user to determine the cheapest distance from one point to another.
For Example: If a user asks to get the shortest distance from the intersection
point marked “G-7 Markaz” to the point “F-10 Markaz,” the program displays:
Distance: 10 km
Route Taken: F-10 Markaz ← G-9 Markaz ← G-7 Markaz.
Furthermore, this feature also displays any closed roads along the route,
such as:
Road Closure Alert: The road between G-9 Markaz and G-8 Markaz is blocked.
Output:
Output:
Output:
Output:
Code Overview
1. Graph Class
The Graph class uses an adjacency matrix to represent the city’s road
network. It includes methods for adding vertex data, importing data from
CSV files, and running Dijkstra’s algorithm.
class Graph {
public:
vector<vector<int>> adj_matrix;
vector<string> vertex_data;
int size;
vector<int> parent;
Graph(int size) {
this->size = size;
adj_matrix.resize(size, vector<int>(size, 0));
vertex_data.resize(size, "");
parent.resize(size, -1);
}
};
switch (choice) {
case 1:
getVipRoot(distanceGraph);
break;
case 2:
cout << "Number of Vehicles: " <<
numberOfWhicles(intensityGraph) << endl;
break;
case 3:
getGreenLightTiming(intensityGraph);
break;
case 4:
calculateTimeConsideringIntensity(distanceGraph, intensityGraph);
break;
case 5:
cout << "Exiting program. Goodbye!" << endl;
break;
default:
cout << "Invalid choice. Please try again." << endl;
}
} while (choice != 5);
return 0;
}
Output:
Conclusion
The Digital Traffic Management System is a powerful and highly modifiable
solution to urban traffic management problems. By improving traffic flow and
road safety with graph-based algorithms and real-time data, it sets the stage
for future enhancements. Potential developments include integrating live
data interfaces, predictive traffic control, and a graphical interface for easier
use.
Project Divisions:
Our team worked together seamlessly, distributing tasks uniformly and
leveraging each other's strengths to deliver a high-quality project
Kacho Ayoub Khan(FA23-BCS-039)
Dua Fatima (FA23-BCS-129)
Muaaz Tasawwar (FA23-BCS-050)