Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mzohaib364/graph-based-travel-analysis-shortest-path-simulation
https://github.com/mzohaib364/graph-based-travel-analysis-shortest-path-simulation
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mzohaib364/graph-based-travel-analysis-shortest-path-simulation
- Owner: MZohaib364
- Created: 2024-07-06T06:45:11.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-27T02:35:10.000Z (15 days ago)
- Last Synced: 2024-12-27T03:23:38.989Z (15 days ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Graph-Based Travel Analysis: Shortest Path Simulation
This project implements a simulation for analyzing travel between cities using graph traversal techniques. It employs Breadth-First Search (BFS) for traversal and a custom shortest path algorithm to compute minimum travel days between cities.
## Features
- **Graph Representation**: Cities and routes are represented as an adjacency list.
- **BFS Traversal**: Explore the city graph level by level.
- **Shortest Path Calculation**: Calculate the minimum travel days required to reach the destination using a custom algorithm.
- **Dynamic Input Handling**: Supports multiple test cases with user-defined city counts and routes.
- **Memory Management**: Dynamically allocates and deallocates memory for graph structures.## Code Highlights
- Custom `Queue` class for BFS traversal.
- Adjacency list representation for efficient graph operations.
- Functions for adding edges, performing BFS, and computing shortest paths.
- Interactive input handling for multiple cases.## Input Format
1. **Number of Cases**: Enter the number of test cases.
2. For each case:
- **Number of Cities**: Total cities in the graph.
- **Number of Aerial Routes**: Count of direct city-to-city connections.
- **Route Details**: Enter pairs of source and destination cities for each aerial route.## Output
For each test case, the program outputs the minimum number of travel days required to reach the destination.