Not Displayed for privacy reasons
The University of British Columbia (UBC) Vancouver campus spans over 400 acres, making efficient navigation a significant challenge. Students frequently travel between buildings, requiring optimal routing strategies to minimize travel time.
Our group applies linear programming to solve pathfinding problems at UBC. We implement a graph-based model where buildings are represented as nodes, and roads are edges weighted by distance.
Additionally, we address various sub-problems such as finding the best dining hall that minimizes the travel distance between two classes.
A flow network is a directed graph consisting of nodes and edges, each with a capacity and flow. While network flow problems are often solved using combinatorial methods, they can also be formulated as linear programming (LP) problems.
-
$N$ : Set of all buildings, road intersections, and endpoints (nodes) -
$E$ : Set of all edges between nodes -
$b_k$ : Flow generated by node$k$ -
$b_o = 1$ (origin node) -
$b_d = -1$ (destination node) -
$b_k = 0$ (otherwise)
-
-
$d_ij$ : Distance between nodes$i$ and$j$ (edge weight) -
$x_ij$ : Flow variable-
$1$ if edge$(i,j)$ is part of the shortest path -
$0$ otherwise
-
-
$u_ij = 1$ : Capacity constraint
Minimize:
Subject to:
The objective function minimizes total distance, and constraints ensure flow conservation across nodes.
This problem can be solved using two methods:
- Shortest Path Method
- Utility Score Method
-
$R$ : Set of all dining halls -
$r_i$ : Binary variable for dining hall selection
The LP problem formulation follows the shortest path problem, ensuring exactly
For utility-based selection, we introduce:
-
$u_r$ : Utility score for restaurant$r$ -
$y_r$ : Binary variable ($1$ if restaurant$r$ is chosen)
The objective function optimizes:
The Median Shortest Path Problem (MSPP) determines an optimal meeting point minimizing the total travel distance for multiple individuals.
-
$x^s_ij$ : Binary variable for student$s$ traveling along edge$(i,j)$ -
$m_k$ : Binary variable indicating if node$k$ is the meeting point
Objective:
Subject to:
This ensures each student follows an optimal route to the common meeting point.
All code can be found in our GitHub Repository.
To construct the UBC graph model, we used data from the UBC Geospatial Open Data. Key datasets include:
- Roads Dataset (
ubcv_roads_simple.geojson
) - Buildings Dataset (
ubcv_buildings_simple.csv
) - Points of Interest Dataset (
ubcv_poi.csv
) - Building Entrances Dataset (
ubcv_building_entrances.geojson
)
Nodes and edges were structured to ensure a connected network, allowing continuous paths.
Example: Crescent West (CRSW) to Leonard S. Klinck (LSK)
- Computed Distance: 2594.02 meters
- Google Maps Distance: 2700 meters
Example: Student Recreation Centre (SRC) to LSK
- Optimal Dining Hall: Orchard Commons
- Computed Distance: 620.83 meters
Using Dijkstra’s Algorithm, we determined an optimal meeting point that minimizes total travel costs.
- Our computed shortest paths were often shorter than Google Maps’ suggestions.
- However, real-time factors (construction, road conditions) are not accounted for.
- The shortest path method does not consider previously traveled paths.
- The utility-based method provides a more flexible solution.
- Our heuristic approach (Dijkstra’s Algorithm) returned reasonable results.
- The LP formulation faced infeasibility issues, requiring further refinement.
This project successfully applied linear programming to pathfinding problems at UBC. We implemented models for:
- Shortest paths between classes
- Optimal dining hall selection
- Median shortest path meeting point
Future improvements could include:
- Incorporating real-time data (traffic, walking conditions)
- Improving computational efficiency in large-scale networks
- Palifka, B. (2024). Google Maps Shortest Route
- UBC Geospatial Open Data. GitHub Repository
- B. Roy and K. Mason. (draft) formulation and analysis of linear programs, September 2005. Accessed: Feb 10, 2025.