Uses of Interface
org.neo4j.graphdb.PathExpander
Package
Description
Scalable graph algorithms like shortest path and others for Neo4j which
can be easily accessed via
GraphAlgoFactory
.The core graph database API.
Traversal framework.
-
Uses of PathExpander in org.neo4j.graphalgo
Modifier and TypeMethodDescriptionstatic PathFinder<Path>
GraphAlgoFactory.allPaths
(EvaluationContext context, PathExpander expander, int maxDepth) Returns an algorithm which can find all available paths between two nodes.static PathFinder<Path>
GraphAlgoFactory.allSimplePaths
(EvaluationContext context, PathExpander expander, int maxDepth) Returns an algorithm which can find all simple paths between two nodes.static PathFinder<WeightedPath>
GraphAlgoFactory.aStar
(EvaluationContext context, PathExpander expander, CostEvaluator<Double> lengthEvaluator, EstimateEvaluator<Double> estimateEvaluator) Returns anPathFinder
which uses the A* algorithm to find the cheapest path between two nodes.static PathFinder<WeightedPath>
GraphAlgoFactory.dijkstra
(EvaluationContext context, PathExpander<Double> expander, String relationshipPropertyRepresentingCost) SeeGraphAlgoFactory.dijkstra(EvaluationContext, PathExpander, CostEvaluator)
for documentation.static PathFinder<WeightedPath>
GraphAlgoFactory.dijkstra
(EvaluationContext context, PathExpander<Double> expander, CostEvaluator<Double> costEvaluator) Returns aPathFinder
which uses the Dijkstra algorithm to find the cheapest path between two nodes.static PathFinder<WeightedPath>
GraphAlgoFactory.dijkstra
(PathExpander<Double> expander, String relationshipPropertyRepresentingCost, int numberOfWantedPaths) SeeGraphAlgoFactory.dijkstra(EvaluationContext, PathExpander, CostEvaluator)
for documentation Instead of finding all shortest paths with equal cost, find the topnumberOfWantedPaths
paths.static PathFinder<WeightedPath>
GraphAlgoFactory.dijkstra
(PathExpander<Double> expander, CostEvaluator<Double> costEvaluator, int numberOfWantedPaths) SeeGraphAlgoFactory.dijkstra(EvaluationContext, PathExpander, CostEvaluator)
for documentation Instead of finding all shortest paths with equal cost, find the topnumberOfWantedPaths
paths.static PathFinder<Path>
GraphAlgoFactory.pathsWithLength
(EvaluationContext context, PathExpander expander, int length) Returns an algorithm which can find simple all paths of a certain length between two nodes.static PathFinder<Path>
GraphAlgoFactory.shortestPath
(EvaluationContext context, PathExpander expander, int maxDepth) Returns an algorithm which can find all shortest paths (that is paths with as shortPath.length()
as possible) between two nodes.static PathFinder<Path>
GraphAlgoFactory.shortestPath
(EvaluationContext context, PathExpander expander, int maxDepth, int maxHitCount) Returns an algorithm which can find all shortest paths (that is paths with as shortPath.length()
as possible) between two nodes. -
Uses of PathExpander in org.neo4j.graphdb
Modifier and TypeMethodDescriptionstatic <STATE> PathExpander<STATE>
PathExpanders.allTypesAndDirections()
A very permissivePathExpander
that follows any type in any direction.<STATE> PathExpander<STATE>
PathExpanderBuilder.build()
Produce aPathExpander
from the configuration you have built up.static <STATE> PathExpander<STATE>
PathExpanders.forConstantDirectionWithTypes
(RelationshipType... types) An expander forcing constant relationship directionstatic <STATE> PathExpander<STATE>
PathExpanders.forDirection
(Direction direction) A very permissivePathExpander
that follows any type indirection
.static <STATE> PathExpander<STATE>
PathExpanders.forType
(RelationshipType type) A very permissivePathExpander
that followstype
relationships in any direction.static <STATE> PathExpander<STATE>
PathExpanders.forTypeAndDirection
(RelationshipType type, Direction direction) static <STATE> PathExpander<STATE>
PathExpanders.forTypesAndDirections
(RelationshipType type1, Direction direction1, RelationshipType type2, Direction direction2, Object... more) static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor, PrintStream out) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths using givenPaths.PathDescriptor
.PathExpander.reverse()
Returns a new instance with the exact expansion logic, but reversed.Modifier and TypeMethodDescriptionstatic <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor, PrintStream out) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
PathExpanders.printingWrapper
(PathExpander<STATE> source, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths using givenPaths.PathDescriptor
. -
Uses of PathExpander in org.neo4j.graphdb.traversal
Modifier and TypeMethodDescriptionBranchOrderingPolicy.create
(TraversalBranch startBranch, PathExpander expander) Instantiates aBranchSelector
withstartBranch
as the first branch to base a decision on "where to go next".TraversalDescription.expand
(PathExpander<?> expander) Sets thePathExpander
as the expander of relationships, discarding all previous calls toTraversalDescription.relationships(RelationshipType)
andTraversalDescription.relationships(RelationshipType, Direction)
or any other expand method.<STATE> TraversalDescription
TraversalDescription.expand
(PathExpander<STATE> expander, InitialBranchState<STATE> initialState) Sets thePathExpander
as the expander of relationships, discarding all previous calls toTraversalDescription.relationships(RelationshipType)
andTraversalDescription.relationships(RelationshipType, Direction)
or any other expand method.void
TraversalBranch.initialize
(PathExpander expander, TraversalContext metadata) Initializes thisTraversalBranch
, the relationship iterator,Evaluation
etc.TraversalBranch.next
(PathExpander expander, TraversalContext metadata) Returns the next expansion source from the expanded relationships from the current node.