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.

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

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?

2 REPLIES 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.

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".