Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🧭 Campus Path Finder

Interactive Jupyter Notebook Game for Visualizing Shortest Path Algorithms on a Campus Map

Python Jupyter Notebook NetworkX Matplotlib IpyWidgets

📘 Overview

Campus Path Finder is an interactive Jupyter Notebook game that visualizes and computes paths across a virtual university campus.
It helps users (students or learners) understand graph traversal algorithms and shortest path computation in an engaging, visual way.

Players can select start and target locations (like “Main Gate” → “Library”), explore different routes, and compare their chosen path with the optimal one calculated using Dijkstra’s algorithm.

🕹️ Gameplay Summary

Once launched, the notebook displays an interactive map built using NetworkX and Matplotlib.

  • Choose your Start and Target locations.
  • Optionally check “Prefer lifts / avoid stairs”.
  • Click Start Game to begin.
  • Use dropdowns to move step-by-step between connected buildings.
  • Click Finish Route to compare your path against the optimal route.
  • Buttons available:
    • ✅ Start Game
    • ↩ Undo Move
    • 🏁 Finish Route
    • 💡 Show Hint (reveals shortest path)
    • 🔁 Reset Game

You’ll see colorful nodes and edges showing buildings, entrances, under-construction zones, and external areas like hostels or parking.

🧠 Graph Theory Concepts Used

  • Graph Representation: The campus map is modeled as a NetworkX.Graph where:
    • Nodes represent campus locations (Blocks, Library, Church, Hostel, etc.)
    • Edges represent paths or corridors connecting them.
  • Weighted Edges: Edges have distances (length) and attributes like stairs, lift, or closed.
  • Shortest Path Computation: Uses nx.shortest_path() with edge weights to calculate optimal routes.
  • Interactive Visualization: The graph layout uses a spring layout to minimize clutter and overlap.
  • Dynamic UI: Built using ipywidgets for buttons, dropdowns, and game state display.

🖥️ Tech Stack

Component Purpose
Python 3 Core programming language
NetworkX Graph creation, traversal, and pathfinding
Matplotlib Visualization of nodes, edges, and paths
IpyWidgets Interactive controls (buttons, dropdowns)
Jupyter Notebook Interactive development and execution

🖼️ Screenshots

🏫 Campus Map Overview

image

🚶 Gameplay — Path in Progress

image image

🏁 Final Result — User vs Optimal Path

image image image

The visual graph shows different node types:

  • 🟦 Regular nodes (classrooms, library)
  • 🟩 Entrances
  • 🟨 External areas (hostels, parking)
  • 🟥 Under construction areas

About

An interactive Jupyter Notebook game that visualizes and finds the shortest path across a campus using graph theory algorithms like BFS, DFS, and Dijkstra’s Algorithm.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages