Skip to content

aymanmomin/The-Harry-Potter-Reunion

Repository files navigation

The Harry Potter Reunion

Overview

This Python program helps Hogwarts alumni find optimal paths to reunite in Ottawa, Canada. It calculates routes based on:

  • Shortest hop path
  • Shortest distance path
  • Shortest time path
  • Fewest Dementors path
  • Combined optimal path (extra credit)

Features

  • Graph representation of provinces and magical paths
  • Pathfinding algorithms (BFS, Dijkstra)
  • Visualization of the magical network
  • Output for all 4 criteria + combined path (extra credit)

Installation

  1. Ensure Python 3.x is installed.
  2. Install required libraries:
    pip install networkx matplotlib

Usage

  1. Save the code as Assignment4.py.
  2. Run the script:
    python Assignment4.py
  3. Output:
  • Optimal paths printed in the terminal
  • Graph visualization saved as magical_network.png

Example Output

=== Harry Potter (British Columbia) ===
SHP: British Columbia -> Quebec -> Ottawa (Hops: 2)
SDP: British Columbia -> Saskatchewan -> Ottawa (Distance: 1400 km)
STP: British Columbia -> Alberta -> Ottawa (Time: 42 hrs)
FDP: British Columbia -> Quebec -> Ottawa (Dementors: 9)
== Extra Credit: Combined Optimal Path (All Criteria Minimized) ==
Path: British Columbia -> Saskatchewan -> Quebec -> Ottawa
Hops: 3, Distance: 1400 km, Time: 24 hrs, Dementors: 9
Combined Score: 0.4321

Outputs

  1. User Joins: 🐼 Sarah joined the grove!
  2. ASCII Art Broadcast: "Test it your self 😜"
  3. Invalid Command (Private Error): 🐼 No ASCII found for this mood! Try: hey, shy, sleeping, dab, shocked, swag, thanks,

Referred Links

  1. Python socket module: Official Documentation
  2. ASCII Art Inspiration/Used from: ASCII Archive and Emoji Combos

python pandas postgresql html5 css3 javascript react tailwind bootstrap java mysql sqlite nodejs figma git bash linux qt