Campus Pedestrian Routing Engine
100% offline routing architecture, 152,904-pair precomputed distance matrix, and client-side walk interpolation.
Campus Pedestrian Routing Engine
Attendrix features a zero-network, fully autonomous pedestrian routing engine tailored for university campuses. It delivers instantaneous walk durations, turn-by-turn walking routes, and dynamic "Time to Leave" alerts.
Routing lookups between any campus building nodes resolve in time with zero runtime network requests.
1. Graph Model & Offline Matrix Scale
University campuses present complex pedestrian topographies (stairs, covered walkways, footbridges, and restricted plazas) that standard commercial map APIs fail to model accurately.
Attendrix models campus pathways as an explicit directed graph:
graph_nodes: 392 pedestrian intersections, building entrances, hostel gates, and transit stops.graph_edges: 820 accessible walkways with precise lengths, surface types, and wheelchair accessibility flags.
The All-Pairs Distance Matrix
Instead of computing Dijkstra or paths on low-powered mobile devices at runtime:
- Precomputation: pgRouting computes all-pairs shortest paths across all node pairs:
Total Route Pairs = 392 nodes * 391 nodes = 152,904 pairs- Relational Ingestion: Stored in
public.routing_dataset_routeswith columns(version, origin_node_id, destination_node_id, walk_seconds, distance_m). - Binary / JSON Compression: The entire dataset compresses to approximately 15.3 MB.
2. Mobile Ingestion & Memory Footprint
When a student onboards or updates the app:
syncRoutingDatasetcallsget_published_routing_datasetRPC.- The dataset is ingested into
OfflineRoutingCache. - An in-memory hash table indexed by
${originNodeId}_${destinationNodeId}enables sub-millisecond lookup:
int? getWalkDuration(int originNode, int destNode) {
return _distanceMatrix["${originNode}_${destNode}"]; // O(1) lookup
}- Memory footprint in RAM is under 18 MB, ensuring stable performance even on entry-level Android smartphones with 3GB of RAM.
3. Real-Time "Time to Leave" Interpolation
The custom action calculateWalkRoute evaluates the student's next class location against their current position. The walk duration across the edge path is formally parameterized by segment length, walking velocity, and path surface impedance coefficients:
Departure countdown is derived dynamically:
- Leave In Minutes: If margin is between 5 and 15 minutes, displays a gentle departure reminder.
- Is Leave Now: If margin is minutes, triggers an urgent "Leave Now!" notification and highlights the dashboard card in alert amber.
- Is Late: If margin , indicates arrival delay and suggests brisk walking pace.
Was this page helpful?
Your feedback directly guides the engineering documentation roadmap.