Inspiration
Walking is difficult enough on its own, and it can be difficult to optimize routes on untracked land. Unlike public roads, private grounds, including university campuses, typically lack comprehensive mapping data for the countless unmarked pathways, lawn crossings, and hidden shortcuts that students actually use. What if there was a solution to this?
What it does
CampusPF is an interactive web application that helps users find the most efficient walking routes across unmarked property, such as university campuses — not just through official pathways, but through the real shortcuts people actually use.
The app is powered by real walking data collected from campus visitors, forming a network that reflects authentic movement patterns. This includes hidden trails, lawn crossings, and informal pathways that maps often miss.
Using an intuitive map interface, users can select any start and end point (from preset campus buildings or custom pins), and CampusPF instantly calculates the shortest walking route using Dijkstra’s algorithm. The result is displayed on an interactive map that visually distinguishes between existing campus paths and the optimized route, clearly marking start and end locations.
How we built it
The frontend is built and structured with React.js, creating a dynamic single page application with reusable components. Furthermore, it is modularized to organize specific functionality and utilizes hooks for state management.
The map is rendered using Leaflet.js.
The pathfinding logic is implemented using Dijkstra's algorithm with TypeScript, which finds the shortest path by calculating the shortest distance to every intersection and discarding the longer ones, until it reaches the final point.
The styling is done with CSS.
Challenges we ran into
Implementing the data structure algorithm was the most difficult part. Creating the frontend was fairly simple, but the site wouldn't render because the path finding algorithm was running infinitely. I almost gave up for this, but eventually I got it to work once I realized that the calculateDistance calls were being run before the nodes were fully initialized. All that I needed to do was ensure that calculateDistance was being called afterwards, and with some simple error handling, the problem was solved.
Accomplishments that we're proud of
I'm proud of how well the pathfinding algorithm works and how visually intuitive the web application is to use.
What we learned
I learned a lot about TypeScript type conventions after many errors, and about working with mapping concepts and treating geographic points as nodes in a graph-like structure.
What's next for CampusPF
What's next for CampusPF is database implementation. Currently it stores a limited amount of information within the browser, which for the purposes of the prototype works out fine, but in order to store geographic data of every route that an individual takes for up to several years, it will be insufficient.
In the future, this system could enable large-scale data collection and analysis, tracking real user movement patterns to improve route optimization and even integrate with services like Google Maps for more precise, local-specific navigation insights.
Log in or sign up for Devpost to join the conversation.