AAttendrix Docsv1.0
Domain Systems
ExplanationImplemented

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.

PEDESTRIAN ROUTING INVARIANT
INV-ROUT-01

Routing lookups between any campus building nodes resolve in O(1)O(1) 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 AA^* paths on low-powered mobile devices at runtime:

  1. Precomputation: pgRouting computes all-pairs shortest paths across all node pairs:
Total Route Pairs = 392 nodes * 391 nodes = 152,904 pairs
  1. Relational Ingestion: Stored in public.routing_dataset_routes with columns (version, origin_node_id, destination_node_id, walk_seconds, distance_m).
  2. 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:

  1. syncRoutingDataset calls get_published_routing_dataset RPC.
  2. The dataset is ingested into OfflineRoutingCache.
  3. 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
}
  1. 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 EpathE_{\text{path}} is formally parameterized by segment length, walking velocity, and path surface impedance coefficients:

Twalk=eEpathlength(e)vwalking×κsurfaceT_{\text{walk}} = \sum_{e \in E_{\text{path}}} \frac{\text{length}(e)}{v_{\text{walking}}} \times \kappa_{\text{surface}}

Departure countdown is derived dynamically:

Tmargin=Tscheduled_startTnowTwalkT_{\text{margin}} = T_{\text{scheduled\_start}} - T_{\text{now}} - T_{\text{walk}}

  • Leave In Minutes: If margin is between 5 and 15 minutes, displays a gentle departure reminder.
  • Is Leave Now: If margin is 2\le 2 minutes, triggers an urgent "Leave Now!" notification and highlights the dashboard card in alert amber.
  • Is Late: If margin <0< 0, indicates arrival delay and suggests brisk walking pace.

Was this page helpful?

Your feedback directly guides the engineering documentation roadmap.

On this page