Dijkstra's algorithm: Difference between revisions

m
Line 3,323:
.
read
#
len cost[] n
len prev[] n
#
proc dijkstra . .
for i = 2 to len cost[]
Line 3,356:
.
dijkstra
#
func$ gpath nd$ .
nd = strcode nd$ - 96
while nd <> 1
s$ = " -> " & strchar (nd + 96) & s$
nd = prev[nd]
.
Line 3,367:
print gpath "e"
print gpath "f"
#
input_data
a b 7
2,046

edits