An interactive campus navigation system that uses BFS and DFS algorithms to find paths between buildings on a virtual campus map. This project lets you create a virtual campus map by adding buildings and connecting them with paths. You can then use two different search algorithms (BFS and DFS) to find routes between buildings. The system visualizes how each algorithm explores the campus to find a path.
- Create Buildings: Click on the canvas to add buildings to your campus
- Connect Paths: Link buildings together with paths that have distance, travel time, and accessibility properties
- Find Routes: Use BFS (shortest path) or DFS (any valid path) to navigate between buildings
- Simulate Real Conditions:
- Randomize weights to simulate traffic changes
- Close paths to simulate construction
- Filter for accessible-only routes
- Visual Feedback: See the path-finding process with color-coded edges:
- 🟩 Green = Found path
- 🔴 Red = Closed path
- 🟧 Orange = Non-accessible path
- ⚫ Black = Regular path
BFS (Breadth-First Search): Finds the shortest path by exploring level by level. Guarantees the minimum number of hops between buildings.
DFS (Depth-First Search): Explores as far as possible down each path before backtracking. Finds a valid route but not necessarily the shortest.
- Python 3.7 or higher
-
Download the project files:
apply.pyrequirements.txt
-
Since this project only uses Python's built-in libraries, no additional packages need to be installed. Just make sure you have Python installed:
python --version
-
If you don't have tkinter (rare), install it:
- Ubuntu/Debian:
sudo apt-get install python3-tk - macOS:
brew install python-tk - Windows: Included with Python installer
- Ubuntu/Debian:
-
Open a terminal or command prompt
-
Navigate to the project folder:
cd path/to/project -
Run the program:
python apply.py
-
Add Buildings: Click anywhere on the white canvas and enter a building name
-
Connect Buildings:
- Click the "Add Path" button
- Enter the names of two buildings to connect
- Enter distance (in feet) and time (in minutes)
- Choose if the path is accessible
-
Find a Route:
- Click "Run BFS" or "Run DFS"
- Enter the start building name
- Enter the destination building name
- Watch the algorithm find and animate the path
-
Try Different Scenarios:
- Use "Randomize Weights" to simulate traffic changes
- Use "Toggle Path" to close/open specific paths
- Check "Accessible Only" to find wheelchair-accessible routes only
- Use "Reset Route" to clear the visualization
- Use "Clear Map" to start over
1. Click on the canvas and add: "Library", "Cafeteria", "Gym"
2. Click "Add Path" to connect Library → Cafeteria (distance: 200, time: 5)
3. Click "Add Path" to connect Cafeteria → Gym (distance: 150, time: 3)
4. Click "Add Path" to connect Library → Gym (distance: 400, time: 10)
5. Click "Run BFS" and search from "Library" to "Gym"
6. See the shortest path highlighted in green!