Floyd-Warshall algorithm: Difference between revisions
m
J: might as well make nodes connect to themselves...
m (→{{header|J}}) |
m (J: might as well make nodes connect to themselves...) |
||
Line 182:
<lang J>graph=:".;._2]0 :0
4
_ _
_ _1 _
)
floyd graph
4
5 1
3 _1 1
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.
|