This project implements a shortest path navigation system for the IIT Kanpur campus using Dijkstra’s Algorithm in C++.
The program computes the shortest distance and optimal route between two campus locations by modeling the campus map as a weighted graph.
- Campus locations are represented as nodes
- Roads/walkways are represented as edges with distances
- The shortest path between a source and destination is computed using Dijkstra’s Algorithm
- Both the minimum distance and the actual path are displayed
| Node ID | Location |
|---|---|
| 0 | Hall 3 |
| 1 | Hall 5 |
| 2 | Lecture Hall Complex (LHC) |
| 3 | Library |
| 4 | Academic Block |
- Language: C++
- Data Structures: Graphs (Adjacency List)
- Algorithms: Dijkstra’s Algorithm (Greedy)
- STL Containers:
vector,pair,priority_queue
The project uses Dijkstra’s Algorithm to find the shortest path in a weighted graph by:
- Initializing all distances as infinity
- Using a min-heap priority queue to always process the closest unvisited node
- Relaxing edges to update shorter distances
- Tracking parents to reconstruct the shortest path
Time Complexity:
O((V + E) log V)
- Compile the program:
g++ iitk_route_planner.cpp