Skip to main content

Module johnson

Module johnson 

Source
Expand description

Johnson’s algorithm: all-pairs shortest path via reweighting (Bellman-Ford then Dijkstra).

Functions§

johnson
Returns row-major n x n distance matrix using Johnson’s reweighting trick.