Search in sources :

Example 1 with PathEvaluator

use of org.neo4j.graphdb.traversal.PathEvaluator in project neo4j by neo4j.

the class Dijkstra method traverser.

private Traverser traverser(Node start, final Node end, PathInterest<Double> interest) {
    PathExpander dijkstraExpander;
    PathEvaluator dijkstraEvaluator;
    if (stateInUse) {
        dijkstraExpander = expander;
        dijkstraEvaluator = Evaluators.includeWhereEndNodeIs(end);
    } else {
        MutableDouble shortestSoFar = new MutableDouble(Double.MAX_VALUE);
        dijkstraExpander = new DijkstraPathExpander(expander, shortestSoFar, epsilon, interest.stopAfterLowestCost());
        dijkstraEvaluator = new DijkstraEvaluator(shortestSoFar, end, costEvaluator);
    }
    lastTraverser = new MonoDirectionalTraversalDescription().uniqueness(Uniqueness.NODE_PATH).expand(dijkstraExpander, stateFactory).order(new DijkstraSelectorFactory(interest, costEvaluator)).evaluator(dijkstraEvaluator).traverse(start);
    return lastTraverser;
}
Also used : PathEvaluator(org.neo4j.graphdb.traversal.PathEvaluator) MutableDouble(org.apache.commons.lang3.mutable.MutableDouble) MonoDirectionalTraversalDescription(org.neo4j.kernel.impl.traversal.MonoDirectionalTraversalDescription) PathExpander(org.neo4j.graphdb.PathExpander) DijkstraSelectorFactory(org.neo4j.graphalgo.impl.util.DijkstraSelectorFactory)

Aggregations

MutableDouble (org.apache.commons.lang3.mutable.MutableDouble)1 DijkstraSelectorFactory (org.neo4j.graphalgo.impl.util.DijkstraSelectorFactory)1 PathExpander (org.neo4j.graphdb.PathExpander)1 PathEvaluator (org.neo4j.graphdb.traversal.PathEvaluator)1 MonoDirectionalTraversalDescription (org.neo4j.kernel.impl.traversal.MonoDirectionalTraversalDescription)1