An open API service indexing awesome lists of open source software.

https://github.com/aymanmomin/the-harry-potter-reunion


https://github.com/aymanmomin/the-harry-potter-reunion

adjacency-list bfs-algorithm dijkstra-algorithm graph matplotlib networkx normalization python3 shortest-path-algorithm shortest-time-path

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# 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:
```bash
pip install networkx matplotlib
```

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

## Example Output
```python
=== 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](https://docs.python.org/3/library/socket.html)
2. ASCII Art Inspiration/Used from: [ASCII Archive](https://www.asciiart.eu/) and [Emoji Combos](https://emojicombos.com/panda)

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