Computer Science
College Canteen Pre-Order & Token System for the Short Break (Flask + MySQL)
Pre-order snacks, get a token and a pickup slot, and let the counter work from a live queue screen
- Python 3.11
- Flask
- Jinja2
- +6
Dijkstra, Bellman-Ford and A* measured on 243 real stations, not toy graphs
Mapped to your syllabusDelhi University UGCF 2022 · Dissertation / Academic Project / Entrepreneurship · Semester 7 & 8Route Planning on the Delhi Metro Network is a benchmarks-driven algorithms study written for the University of Delhi UGCF dissertation track (Semesters 7 and 8). Instead of testing shortest-path algorithms on the six-node toy graphs found in textbooks, it builds a weighted graph of the real Delhi Metro — 10 colour-coded lines, roughly 243 unique stations (271 station entries counting interchanges) and about 374 km of route — and measures how the classic trio Dijkstra, Bellman-Ford and A* actually behaves on it.
The study does four things. First, it curates a machine-readable station dataset from Wikipedia's line-wise station lists, cross-checked against the Delhi Metro Rail Corporation's official station list, with every source documented. Second, it constructs the adjacency structure correctly: consecutive stations on a line become edges, interchange stations get transfer edges, and edge weights model travel time rather than hop count. Third, it implements all three algorithms from scratch in Python and validates each one against the NetworkX reference implementation (an industry-standard library used only for cross-checking), so correctness is never assumed. Fourth, it runs a reproducible benchmark protocol — warm-up runs, fixed query sets and repeated trials timed with time.perf_counter — and reports runtimes, expanded-node counts and route quality side by side.
A small command-line tool prints itineraries for real journeys such as Rithala to Botanical Garden, and matplotlib figures (another industry-standard extra) draw the network and the timing results. Everything runs offline on an ordinary laptop.
Syllabus alignment
A metro commuter choosing between two routes faces a real trade-off: the route with fewer interchanges may be longer in distance, and the route with fewer stops may need two line changes. Every route planner resolves this with shortest-path algorithms, but the algorithm behind the answer is never shown, and the weights that decide what "shortest" means are hidden. Meanwhile, computer-science students learn Dijkstra, Bellman-Ford and A* only on textbook graphs of a few nodes, where no algorithm shows any measurable advantage and interchange costs never arise.
There is no measured, reproducible evidence for the questions this dissertation asks: by how much does Bellman-Ford actually trail Dijkstra on a real transit network? Does the A* heuristic genuinely pay for its bookkeeping on a sparse, near-planar metro graph? And does interchange-aware weighting change which route counts as "shortest"? This study builds the dataset, the from-scratch implementations and the benchmark protocol needed to answer those questions with numbers instead of folklore, on a network every Delhi student knows first-hand.
This dissertation benchmarks three classic shortest-path algorithms — Dijkstra's algorithm, the Bellman-Ford algorithm and A* search — on a weighted graph of the Delhi Metro built entirely from public data. The graph has about 243 unique stations across 10 lines, with interchanges modelled as explicit transfer edges. All three algorithms are implemented from scratch in Python, validated against NetworkX reference results on every ordered station pair, and timed on fixed query sets under a documented protocol. The study reports measured runtimes, memory use and route quality, and analyses when each algorithm is the right choice for transit routing.
Route planning looks solved: mobile apps answer "Rithala to Botanical Garden?" in a second. But exactly how they answer it is invisible, and a B.Sc. curriculum teaches Dijkstra, Bellman-Ford and A* on tiny classroom graphs where every algorithm is instant and every route is obvious. The learning gap is real: students never see how graph size, edge density, weight design and interchange handling change behaviour. This study closes that gap by treating the Delhi Metro as a serious, verifiable dataset — large enough to produce measurable differences between algorithms, small enough to check by hand.
Build the station graph in three verified weight models — pure hop count, distance-based travel time, and travel time plus a fixed interchange penalty. Implement Dijkstra with a binary heap, Bellman-Ford with early exit, and A* with a haversine-based heuristic, all from scratch. Prove correctness against NetworkX on all ordered station pairs under every weight model, then time all algorithms on three fixed query sets: same-line journeys, one-interchange journeys and terminal-to-terminal worst cases. Analyse the results and present them with fully reproducible scripts.
In scope
Out of scope (and why)
The study follows an experimental benchmarking research design mapped onto the two-semester UGCF dissertation: Semester 7 builds the artefact (data, graph, implementations) and Semester 8 runs the experiments and writes the dissertation. The design has one treatment (the algorithm), three controlled conditions (the weight models), one fixed workload (three query sets) and repeated measurement — the standard structure for a fair runtime comparison. Monthly progress reports to the supervisor are a scheme requirement and are used as checkpoints at the end of every phase.
| Phase | Weeks | Activities | Deliverable |
|---|---|---|---|
| Literature study | 1–3 | Shortest-path theory, transit-routing literature, prior benchmark studies | Annotated reading list, finalised research questions |
| Data collection | 4–6 | Curate stations.csv from Wikipedia line pages; cross-check counts against the DMRC list; record distances between consecutive stations | Verified stations.csv with provenance notes |
| Graph construction | 7–9 | build_graph.py: per-line node chains, transfer edges, three weight models; structural sanity checks | adjacency files plus a graph validation report |
| Implementation | 10–13 | From-scratch Dijkstra, Bellman-Ford, A*; pytest unit tests; NetworkX cross-check on all station pairs | Tested algorithms module |
| Benchmarking | 14–17 | Warm-up runs, 30 timed repetitions per query, perf_counter timing, memory notes, fixed random seed for query generation | results.csv and a benchmark report |
| Analysis | 18–20 | Tables and figures; interchange-penalty route analysis; threats to validity | Results chapter draft |
| Writing and defence | 21–24 | Full dissertation draft, supervisor review, pre-submission seminar, viva preparation | Final dissertation |
Testing approach: pytest unit tests cover boundaries (source equals destination, adjacent stations, terminal-to-terminal) and hand-verified known routes; a full-network cross-check asserts that every from-scratch route matches NetworkX's Dijkstra under the same weights. Benchmark hygiene: one machine, no background load, warm-up excluded from statistics, median and 95th percentile reported alongside the mean.
The study is a pipeline of small, independently testable scripts rather than an application. Raw sources flow through a curation step into a versioned stations.csv; a builder turns it into adjacency lists under each weight model; the algorithms module consumes the graph; the harness times it; notebooks analyse the output. Each stage writes a file, so any stage can be re-run without redoing the earlier ones, and every artefact in the dissertation regenerates from the raw data with one command chain.
flowchart TD
W["Wikipedia line-wise station lists"] --> C["stations.csv curation script"]
D["DMRC official station list"] --> C
C --> V["Verification: per-line counts and interchange flags"]
V --> G["build_graph.py: adjacency lists with weights"]
G --> M1["Weight model 1: hop count"]
G --> M2["Weight model 2: distance-based travel time"]
G --> M3["Weight model 3: travel time plus interchange penalty"]
M1 --> Q["Query sets: same-line, one-change, terminal-to-terminal"]
M2 --> Q
M3 --> Q
Q --> A["From-scratch Dijkstra, Bellman-Ford, A-star"]
N["NetworkX reference implementations"] --> A
A --> T["pytest correctness suite"]
A --> B["benchmark.py: warm-up, 30 repeats, perf_counter"]
B --> R["results.csv"]
R --> P["Analysis notebooks and matplotlib figures"]
P --> F["Dissertation chapters and defence deck"]
A --> U["route.py CLI itinerary demo"]The graph keeps one node per station per line, joined by transfer edges at interchange stations, which is what makes the interchange penalty expressible as an ordinary edge weight:
flowchart LR
subgraph RedLine["Red Line"]
NSP["Netaji Subhash Place (R)"] --- KG_R["Kashmere Gate (R)"]
end
subgraph YellowLine["Yellow Line"]
KG_Y["Kashmere Gate (Y)"] --- NDLS["New Delhi"]
end
KG_R -. "transfer edge, weight 5 min" .- KG_YDesign decisions worth defending in the viva: adjacency lists over matrices (the metro graph is very sparse, about two same-line edges per node); a binary heap for Dijkstra to get the standard O((V+E) log V) bound; an early exit for Bellman-Ford when a pass changes no distance; and an admissible, consistent haversine heuristic for A* so that no closed node ever needs reopening.
Package 01
Builds stations.csv from Wikipedia's line-wise station lists (station name, line, order on line, interchange flag, distance to next station) and verifies totals against the DMRC official list. Every value carries a source note, and recent station renames are recorded so older journey examples stay traceable.
Package 02
Converts the station table into per-line node chains plus transfer edges at interchanges, and emits three weight models: pure hop count, distance-based travel time at a constant commercial speed, and travel time with a fixed five-minute interchange penalty.
Package 03
Implements Dijkstra with a binary heap, Bellman-Ford with early exit, and A* with an admissible haversine heuristic, all on plain Python dictionaries and lists. No library shortest-path function appears inside the implementations being measured.
Package 04
A pytest suite plus a full-network script that compares every from-scratch route and distance against NetworkX reference implementations under each weight model, across all ordered station pairs, failing loudly on any mismatch. This is the study's core evidence of correctness.
Package 05
Runs each algorithm over the three fixed query sets with warm-up, 30 repetitions, perf_counter timing and memory notes, and writes results.csv containing algorithm, weight model, query, distance, expanded-node count and timing statistics (mean, median, p95).
Package 06
route.py prints step-by-step itineraries (stations, line changes, total weight) for real journeys; matplotlib draws the network sketch, the timing comparisons and the route-quality figures used in the dissertation and the defence slides.
Slide 1
Route Planning on the Delhi Metro Network
Slide 2
Why Benchmark on a Real Network?
Slide 3
The Delhi Metro as a Graph Problem
Slide 4
Data Collection and Verification
Slide 5
Graph Model and Interchange-Aware Weights
Slide 6
The Three Algorithms
Slide 7
Proving Correctness
Slide 8
Benchmark Protocol
Slide 9
Results: Measured Runtimes
Slide 10
Results: What the Interchange Penalty Changes
Slide 11
Limitations and Threats to Validity
Slide 12
Conclusion and Future Scope
Bullets, speaker notes and the .pptx · ₹2,000
Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.
Dijkstra assumes that once a node is settled, no shorter path to it can appear later, which negative edges break because extending a path can lower its cost. A metro graph has only non-negative travel times and transfer penalties, so Dijkstra is safe here — but the assumption must be stated and defended in the viva.
With a binary heap the complexity is O((V+E) log V): each edge triggers a possible decrease-key and each node extraction costs log V. On about 243 nodes and roughly 300 edges a naive O(V-squared) scan would still be fast, but the heap matters because the argument scales to any large sparse transit graph.
Admissible means it never overestimates the true remaining cost; consistent means each edge satisfies the triangle inequality with the heuristic. Haversine straight-line distance never exceeds the real along-track travel distance, and the travel-time weight is derived from distance at a constant speed, so it stays admissible under models 2 and 3.
+11 more questions, with answers
Unlocks with the project · ₹2,000
Unlock for ₹2,000What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.
Unlocks with the project · ₹2,000
Unlock for ₹2,000How to study it, adapt it and walk your examiner through it, step by step.
Unlocks with the project · ₹2,000
Unlock for ₹2,000OnlyProjects. (2026). Route Planning on the Delhi Metro Network: A Benchmark Study of Shortest-Path Algorithms (Python): B.Sc Computer Science project bundle [Educational resource]. https://onlyprojects.online/projects/bsc-cs-delhi-metro-shortest-path-benchmark-study
Keep browsing
Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.
Computer Science
Pre-order snacks, get a token and a pickup slot, and let the counter work from a live queue screen
Agriculture
Cattle-dung blends with paddy straw, leaf litter and market waste, benchmarked against FCO Schedule IV specifications
Biochemistry
A p-nitrophenyl phosphate assay read at 405 nm, non-linear Michaelis-Menten fitting, and competitive inhibition by inorganic phosphate
Biotechnology
Four disinfestation protocols, 144 nodal explants on MS medium, and chi-square tests that decide which protocol actually wins
Botany
Frequency, density, abundance and IVI from 20 nested quadrats, with Shannon, Simpson and Jaccard comparisons of a protected and a disturbed plot
Chemistry
Total and calcium hardness of 24 Bengaluru ward sources by APHA 2340 C titration, QC-checked and judged against IS 10500:2012