Skip to content

Simple python implementation of dijkstra shortest path algorithm

License

Notifications You must be signed in to change notification settings

niyazed/Py-Dijkstra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example.png

Py-Dijkstra

Simple python implementation of dijkstra shortest path algorithm

Instructions

inputs.txt file looks like this -

a b 2
a d 8
a c 9
b a 3
b c 4
c d 1

Take input from text file like below -

    $ python dijkstra.py <filename.txt> <src> <dest>
Example -
> python dijkstra.py inputs.txt a d

Graph: 
-------
{'a': {'c': 9, 'b': 2, 'd': 8}, 'c': {'d': 1}, 'b': {'a': 3, 'c': 4}}

Shortest Paths: 
---------------
a -> b -> c -> d : 7

About

Simple python implementation of dijkstra shortest path algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages