aryagraph.generators.datasets.ucalgary_campus#

aryagraph.generators.datasets.ucalgary_campus(*, indoor_only: bool = False) → Graph[source]#

University of Calgary main campus: 56 buildings and the ways between them.

A real-world spatial network for routing, centrality and layout demos. Nodes are official building codes ("MSC", "TFDL", "ICT", …); edges are undirected, and each edge’s kind is one of:

  • "tunnel": underground pedestrian tunnel (e.g. MacEwan Hall ↔ Science B);

  • "pedway": enclosed bridge or link corridor (e.g. Earth Sciences ↔ Mathematical Sciences);

  • "attached": adjoining buildings with an internal door;

  • "outdoor": a modelled walking link. Each building is joined to its two nearest neighbours within 250 m, plus the shortest links needed to make the campus connected.

Parameters:

indoor_only – Keep only the tunnel / pedway / attached edges, which form the “stay warm, stay inside” network. All 56 buildings are kept, so buildings without an indoor connection become isolated nodes.

Returns:

Graph – Node attributes: name, kind ("academic", "residence", "student-life", "athletics", "arts", "library", "research", "administration" or "services"), lat and lon (WGS84 degrees) and pos = (x, y) in metres on a local plane centred on the campus: x points east and y points south (the screen convention, y down), so drawings come out north-up without a layout algorithm. Edge attributes: kind, length (metres) and weight (equal to length). Graph attributes: name, description, attribution and sources (URLs).

Notes

This is a schematic model compiled from public sources, not an official or surveyed campus dataset:

  • building codes and names: UCalgary Main Campus Map (July 2023) and the Facilities building directory, updated for later renamings: "KNA" and "KNB" (Kinesiology A and B) have been the Dr. Roger Jackson Kinesiology Complex since February 2026;

  • indoor links: UCalgary’s Indoor Building Routes map (November 2025), cross-checked against OpenStreetMap tunnels, bridges and shared walls, plus UCalgary, Haskayne, Alberta Major Projects and DIALOG pages. The Aurora Hall ↔ Dining Centre tunnel, part of the residence tunnels, comes from UCalgary’s Aurora Hall page rather than the routes map;

  • coordinates: the centre of each building’s OpenStreetMap bounding box (© OpenStreetMap contributors, ODbL 1.0).

Positions are approximate (a bounding-box centre can sit a few metres off an irregular building’s centroid), and every length is the straight-line (haversine) distance between two positions, not a measured walking distance. The "outdoor" edges are modelled nearest-neighbour walking links, not surveyed paths. Craigie Hall’s blocks C–G are merged into one node, "CH". One building lies off the main grounds: the Olympic Volunteer Centre ("OVC"), which UCalgary lists among its main-campus buildings, stands at McMahon Stadium south of 24 Avenue NW. Its only edge is a modelled 626 m outdoor link to Mathison Hall, the longest edge in the graph, and it stretches the north–south extent of any north-up drawing by about half.

>>> campus = ucalgary_campus()
>>> campus.nodes["TFDL"]["name"]
'Taylor Family Digital Library'
>>> sorted({k for _, _, k in campus.edges.data("kind")})
['attached', 'outdoor', 'pedway', 'tunnel']