Floyd-Warshall algorithm: Difference between revisions

m
(J: oops, wasn't actually implementing floyd (result was fine, timing was too slow))
Line 180:
 
Example use:
 
<lang J>graph=:".;._2]0 :0
_ _ _2 _ NB. 1->3 costs _2
4 _ 3 _ NB. 2->1 costs 4; 2->3 costs 3
_ _ _ 2 NB. 3->4 costs 2
_ _1 _ _ NB. 4->2 costs _1
)
 
 
<lang J>graph=:".;._2]0 :0
6,962

edits