complex-networks

Complex Networks-Finding all possible shortest paths between a pair of nodes


I have a database that describes a huge network. It consists of about 18000 vertices. Now I need to find all possible shortest paths between a pair of nodes. I have tried implementing the iterative DFS, but the problem there is the exponential growth.The amount of time needed gets huge, since there vertices having a high out-degree. Can you suggest of some algorithm that would work faster. The complex network that I have is directed and weighted.Any suggestions would be great help.

Thanks, Ekta


Solution

  • For a weighted graph with positive weights, one generally uses uniform-cost search, aka Dijkstra's algorithm. Other algorithms can be faster in specific cases. For example, if your data allow you to define a heuristic function, you could use A* instead. Or if your network is scale-free (i.e. its degree is power law distributed), you can use a variant of Dijkstra's algorithm described in Peng et al.'12.

    There are also a bunch of related SO questions you might want to look at, such as Is there better way than a Dijkstra algorithm for finding fastest path that do not exceed specified cost or Are there faster algorithms than Dijkstra?.

    EDIT: to find all shortest paths between a given pair of nodes, you can still use Dijkstra, with a few changes:

    You can also have a look at this question (although it concerns unweighted graphs): Finding all the shortest paths between two nodes in unweighted undirected graph