cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

All pairs shortest path

kaptenh
Node Clone

Hi!
I have a bunch of nodes, and I would like to get the shortest path between each pair of them.
There is an "allPairsShortestPath" algorithm in GDS, but that seems to calculate the shortest path for all nodes in the database, which would be too much work.
Is there any clever way to call this to just do the work for supplied nodes that I have missed?
I could just call shortest path for each pair, but that would do extra work most of the time in my setting.

Thanks

1 REPLY 1

Hi, @kaptenh

Algorithm can be applied to selected subgraph. Take a look on docs "configuration" samples
Moreover, you can predefine subgraph and keep it in catalog for reusability.
Take a look on docs.
Hope it helps.

Cheers,
Vlad