Dijkstra algorithm using Fibonacci Heaps
Parameters : | csgraph : array, matrix, or sparse matrix, 2 dimensions
directed : bool, optional
indices : array_like or int, optional
return_predecessors : bool, optional
unweighted : bool, optional
|
---|---|
Returns : | dist_matrix : ndarray
predecessors : ndarray
|
Notes
As currently implemented, Dijkstra’s algorithm does not work for graphs with direction-dependent distances when directed == False. i.e., if csgraph[i,j] and csgraph[j,i] are not equal and both are nonzero, setting directed=False will not yield the correct result.
Also, this routine does not work for graphs with negative distances. Negative distances can lead to infinite cycles that must be handled by specialized algorithms such as Bellman-Ford’s algorithm or Johnson’s algorithm.