简体   繁体   中英

Neo4J PathFinder Optimization

I have a very large (Several million nodes and many more relationships) embedded Neo4J graph database. I'm using version 2.1.5 of Neo4J. I often need to see how/if two nodes are connected. I use the GraphAlgoFactory to build a PathFinder that I then call findSinglePath on. If I build a Djikstra's PathFinder, it runs about an order of magnitude slower than if I run a ShortestPath PathFinder when the nodes are in fact connected. However, when not connected, ShortestPath runs slower than DJikstra's. Anybody know why it might behave like this?

Also, how does one optimize these calls? When two nodes aren't connected, it takes 60-120 seconds to figure that out. For my purposes, that is too slow.

What is the degree-distribution of your network?

Can you filter stronger on rel-types, directions or attributes or labels of nodes in between? Just to reduce the amount of paths looked at?

It might also help to use a different uniqueness, eg Node-Global.

You should probably provide an upper limit of your expected length.

Both Dijkstra and shortest path are actually bi-directional.

You can also use the bi-directional traverser yourself.

See this blog post: http://maxdemarzi.com/2015/11/20/bidirectional-traversals-in-space/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM