The aim of this graph is to find the shortest route and route around the city This project implements a graph data structure and algorithms in Python to find routes between cities. It focuses on:
Creating a Graph: Represents a city network as a graph using a dictionary to store connections between cities (start: [connected_cities]). Finding All Paths: Implements a recursive function get_paths to explore all possible routes between a starting and ending city, avoiding revisiting cities. Finding the Shortest Path: Implements a recursive function get_shortest_path to discover the route with the fewest connections between two cities. Running the Script:
Save the code: Create a Python file (e.g., graph.py) and paste the provided code. Execute the script: Open a terminal in the project directory and run python graph.py.