From the Front Gate to the Back Gate, a student's device must relay its connection through campus Wi‑Fi access points — each with different signal, latency, congestion and bandwidth. Choosing the best relay path at every hop is a weighted shortest-path problem on a multistage graph.
CAMPUS//ROUTE models campus buildings as graph nodes, connections as weighted edges, and network conditions as live edge costs. Three different algorithms — Greedy, Dynamic Programming, and Backtracking — each attempt to solve it, using fundamentally different strategies. Their results are real: no routes are hardcoded.
The campus is divided into stages (clusters of buildings). The device must pass through each stage exactly once, choosing one access point per stage. This creates a layered Directed Acyclic Graph (DAG) — also called a multistage graph.
Each hop's cost combines the destination router's quality — latency, signal loss, congestion penalty, packet loss — plus a lane-switch penalty if crossing sides of the road, and an RF interference factor between routers.
Minimise the total accumulated cost across all 6 intermediate stages from Front Gate to Back Gate. A locally cheap hop can force a globally expensive route — which is exactly where Greedy fails and DP/Backtracking succeed.
Watch each algorithm think — decision by decision — through the campus network.
Adjust signal, latency, congestion or take a router offline. Press Run Algorithm to see the route adapt.
Examine the internal data structures each algorithm builds — search trees, DP tables, ranked choices.
C3 — Theoretical Big-O derived from the actual implementation, plus observed browser runtime.
* Observed times measured at page load on current hardware. Theoretical vs observed diverge because: (1) browser JS engine optimisations, (2) small constant n=6 stages, k≤3 choices/stage. For larger n the theoretical differences become decisive.
Big-O notation describes asymptotic growth as input size approaches infinity. For this simulation, n=6 stages and k≤3 nodes per stage — so even O(kn) backtracking with k=3, n=6 is only 36=729 operations in the absolute worst case. At this scale, constant factors dominate and all three algorithms complete in under 1ms. The theoretical complexity matters when the campus grows: with n=50 stages, Backtracking becomes completely impractical while DP remains efficient. Always distinguish "this takes 0.03ms in this demo" from "this is O(kn) and would be unusable at scale."
Run any two algorithms on identical network conditions — see exactly where they diverge and why.
Beat the optimal algorithm — read the network, build your route, and submit it.