Floyd-Warshall algorithm: Difference between revisions

m
m (J: might as well make nodes connect to themselves...)
Line 196:
The graph matrix holds the costs of each directed node. Row index corresponds to starting node. Column index corresponds to ending node. Unconnected nodes have infinite cost.
 
This approach turns out to be faster than the more concise <./ .+~^:_ for many relatively small graphs (though floyd happens to be slightly slower for the task example).
 
=={{header|Java}}==
6,962

edits