Skip to main content

To measure the shortest distance of any nodes or any particular points, we can use this package. By using this package, we will get the shortest path and also the distance.

Project description

DijsktraAlgorithm

Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later. Here, I used his method in python to find the shortest path and also the distance.

Installing

Run the following code to install on your terminal:

pip install DijkstraAlgorithm

Using

Follow the given way to use it:

'''First Import our module'''
import DijkstraAlgo as da
'''Initializing the Class Attributes'''
x = da.DijkstraAlgorithm()

'''Now pass the arguments through the following method'''
x.dijkstraWithPath(graph, source, destination)  #Here, this graph is about the distance between each nodes.

'''Lets define some methods'''
shortest_path = x.path()
distance = x.distance()
print(*shortest_path)   #It will print the path
print(*distance)         #It will print the distance

Plugins

Few useful links:

Plugin README
2D Model https://github.com/MizanMustakim/Dijkstra-s-Shortest-Path-Algorithm/tree/main/Shortest%20Path%20in%202D%20model
3D Model https://github.com/MizanMustakim/Dijkstra-s-Shortest-Path-Algorithm/tree/main/Shortest%20Path%20in%203D%20model

License

MIT

Free Software, Happy Coding!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DijkstraAlgo-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

DijkstraAlgo-0.0.1-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page