This Python script provides a visual representation of Dijkstra's algorithm on a graph. It allows users to input the number of nodes, specify the nodes, input the edges with weights, and choose a starting node. The script then visualizes the shortest distances and paths from the chosen starting node using networkx and matplotlib.
Make sure you have Python installed on your system. Additionally, install the required libraries using the following command:
pip install networkx
pip install matplotlib
git clone https://github.com/AnanteshG/Dijkstra-Visualizer.git
cd your-repository
cd your-repository
python dijkstra_visualizer.py
Follow the on-screen prompts to input the graph details:
- Enter the number of nodes
- Specify the name of each node
- Enter the number of edges
- Provide edge details in the format: source, destination, value
Enter the starting node for Dijkstra's algorithm when prompted. The script will then visualize the process and display the shortest distances and paths from the chosen starting node.
Feel free to contribute to the project by opening issues or submitting pull requests. Any contributions are welcome!