Purpose and use of `maxDepth` in `algo.kShortestPaths`


(Rickhg12hs) #1

What is the maxDepth parameter of algo.kShortestPaths?

Can this parameter be used to make the algorithm more efficient by not searching beyond some depth? Depth of what?

For example, after determining the shortest path, can this parameter be used to constrain the maximum number of nodes in a path?

(Michael Hunger) #2

Yes, that's the max length, i.e. if a path has reached that lenght but then end node not reached that path will be aborted.

(Rickhg12hs) #3

I was hoping that's what it meant, but it didn't behave the way I expected. It seems it's controlling some other algorithm feature.

Please see the comments in Stackoverflow question "Implementing Dijkstra's algorithm in Neo4j with max hops".