algorithm - Optimizing search of all the shortest paths in a Graph with N vertices and N edges -
i need find shortest paths between pairs in graph g
. i'm using floyd–warshall algorithm compute solution.
i need know if there better option find shortest paths given these facts g
:
g
undirected graph.- the numbers of vertices , edges same.
- all edge weights positive.
is there better solution floyd–warshall given these facts?
there modification of dijkstra shortest path algorithm sparse graphs works fast , reveals log-linear (close linear) asymptotic behavior. need n searches n vertices gives o(n^2*logn) asymptotic time better o(n^3) floyd–warshall algorithm.
probably graph has special topology allows more efficient approaches...
c++ code russian description (may translated google chrome)
i have delphi implementation grid graph here.
Comments
Post a Comment