Dijkstras Algorithm
Hey,
I am writing a python script that implements Dijkstras Open Shortest Path First Algorithm.
My plan is to read in 2 text files,
network.txt, which is a multi-line file, with node, nearest neighbour and distance metric info:
(this is just the distance metric info, the other details will be added when the file gets read into a list in the script)
0,2,4,1,6,0,0
2,0,0,0,5,0,0
4,0,0,0,0,5,0
1,0,0,0,1,1,0
6,5,0,1,0,5,5
0,0,5,1,5,0,0
0,0,0,0,5,0,0
and route.txt which is a single line file with start and destination information:
(this is only a starting point, as it will get updated within the algorithm)
B>F
once the algorithm has run, i want to produce an output file called spf.txt which contains the shortest path from source to destination.
If anyone could give me some pointers on how to approach this that would be awesome!
cheers
martin
|