Perform a shortest-path graph search on a positive directed or undirected graph.
As currently implemented, Dijkstra’s algorithm does not work for graphs with direction-dependent distances when directed == False. i.e., if dist_matrix[i,j] and dist_matrix[j,i] are not equal and both are nonzero, method=’D’ will not necessarily yield the correct result.
Also, these routines have not been tested for graphs with negative distances. Negative distances can lead to infinite cycles that must be handled by specialized algorithms.
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.