This repository contains a Python implementation of Dijkstra's algorithm for finding the shortest path in a weighted graph. The code demonstrates how to visualize the graph, compute the shortest paths, and interactively display the shortest path to a node upon clicking on it.
Key features:
Uses NetworkX library for graph representation and manipulation Visualizes the graph using Matplotlib for a clear understanding of the node and edge relationships Implements Dijkstra's algorithm to find the shortest paths from a given start node to all other nodes in the graph Reconstructs the shortest path from start node to a target node using the previous nodes information Animates the shortest path when a node is clicked on the graph, providing an interactive way to explore the shortest paths Provides a clear display of the shortest path distances and the actual paths from the start node to other nodes on the graph To run the code, simply execute the script. The graph is defined within the script, and you can modify it as needed. By default, the start node is set to 'A', but you can change it as desired. After running the script, a graphical representation of the graph will be displayed. Click on any node to see the shortest path from the start node to the clicked node animated on the graph.
GUI :