Package org.neo4j.gds.msbfs
Class ANPStrategy
- java.lang.Object
-
- org.neo4j.gds.msbfs.ANPStrategy
-
- All Implemented Interfaces:
ExecutionStrategy
public class ANPStrategy extends java.lang.Object implements ExecutionStrategy
"Aggregated Neighbor Processing" (ANP) strategy as described in The More the Merrier: Efficient Multi-Source Graph Traversal http://www.vldb.org/pvldb/vol8/p449-then.pdfThe ANP strategy provides two invariants:
-
For a single thread, a single node is traversed at most once at a given depth
– That is, the combination of
(nodeId, depth)appears at most once per thread. It may be that a node is traversed multiple times, but then always at different depths. -
For multiple threads, the
(nodeId, depth)may appear multiple times, but then always for different sources.
-
-
Constructor Summary
Constructors Constructor Description ANPStrategy(BfsConsumer perNodeAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidprepareNextVisit(org.neo4j.gds.api.RelationshipIterator relationships, long nodeVisit, long nodeId, org.neo4j.gds.core.utils.paged.HugeLongArray nextSet, int depth)voidrun(org.neo4j.gds.api.RelationshipIterator relationships, long totalNodeCount, org.neo4j.gds.msbfs.SourceNodes sourceNodes, org.neo4j.gds.core.utils.paged.HugeLongArray visitSet, org.neo4j.gds.core.utils.paged.HugeLongArray visitNextSet, org.neo4j.gds.core.utils.paged.HugeLongArray seenSet, @Nullable org.neo4j.gds.core.utils.paged.HugeLongArray seenNextSet)protected booleanstopTraversal(boolean hasNext, int depth)
-
-
-
Constructor Detail
-
ANPStrategy
public ANPStrategy(BfsConsumer perNodeAction)
-
-
Method Detail
-
run
public void run(org.neo4j.gds.api.RelationshipIterator relationships, long totalNodeCount, org.neo4j.gds.msbfs.SourceNodes sourceNodes, org.neo4j.gds.core.utils.paged.HugeLongArray visitSet, org.neo4j.gds.core.utils.paged.HugeLongArray visitNextSet, org.neo4j.gds.core.utils.paged.HugeLongArray seenSet, @Nullable @Nullable org.neo4j.gds.core.utils.paged.HugeLongArray seenNextSet)- Specified by:
runin interfaceExecutionStrategy
-
stopTraversal
protected boolean stopTraversal(boolean hasNext, int depth)
-
prepareNextVisit
protected void prepareNextVisit(org.neo4j.gds.api.RelationshipIterator relationships, long nodeVisit, long nodeId, org.neo4j.gds.core.utils.paged.HugeLongArray nextSet, int depth)
-
-