Skip to content

This repo contains a Python implementation of Dijkstra's algorithm with interactive visualization. It uses NetworkX and Matplotlib to display the graph, compute shortest paths, and animate paths upon clicking nodes. Modify the graph and start node as needed, then run the script to explore paths.

Notifications You must be signed in to change notification settings

abraxas4/dijkstra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

dijkstra

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 :

image

About

This repo contains a Python implementation of Dijkstra's algorithm with interactive visualization. It uses NetworkX and Matplotlib to display the graph, compute shortest paths, and animate paths upon clicking nodes. Modify the graph and start node as needed, then run the script to explore paths.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages