Skip to content

Onesmus-dev/Intro-to-Graphs-Python-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Intro-to-Graphs-Python-

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.

About

The aim of this graph is to find the shortest route and route around the city

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages