use of org.neo4j.graphalgo.impl.util.StopAfterWeightIterator in project neo4j-mobile-android by neo4j-contrib.
the class ExperimentalAStar method findAllPaths.
public Iterable<WeightedPath> findAllPaths(Node start, final Node end) {
Predicate<Path> filter = new Predicate<Path>() {
public boolean accept(Path position) {
return position.endNode().equals(end);
}
};
final Traverser traverser = traversalDescription.order(new SelectorFactory(end)).filter(filter).traverse(start);
return new Iterable<WeightedPath>() {
public Iterator<WeightedPath> iterator() {
return new StopAfterWeightIterator(traverser.iterator(), costEvaluator);
}
};
}
use of org.neo4j.graphalgo.impl.util.StopAfterWeightIterator in project neo4j-mobile-android by neo4j-contrib.
the class Dijkstra method findAllPaths.
public Iterable<WeightedPath> findAllPaths(Node start, final Node end) {
Predicate<Path> filter = new Predicate<Path>() {
public boolean accept(Path position) {
return position.endNode().equals(end);
}
};
final Traverser traverser = TRAVERSAL.expand(expander).order(new SelectorFactory(costEvaluator)).filter(filter).traverse(start);
return new Iterable<WeightedPath>() {
public Iterator<WeightedPath> iterator() {
return new StopAfterWeightIterator(traverser.iterator(), costEvaluator);
}
};
}
use of org.neo4j.graphalgo.impl.util.StopAfterWeightIterator in project graphdb by neo4j-attic.
the class Dijkstra method findAllPaths.
public Iterable<WeightedPath> findAllPaths(Node start, final Node end) {
Predicate<Path> filter = new Predicate<Path>() {
public boolean accept(Path position) {
return position.endNode().equals(end);
}
};
final Traverser traverser = TRAVERSAL.expand(expander).order(new SelectorFactory(costEvaluator)).filter(filter).traverse(start);
return new Iterable<WeightedPath>() {
public Iterator<WeightedPath> iterator() {
return new StopAfterWeightIterator(traverser.iterator(), costEvaluator);
}
};
}
use of org.neo4j.graphalgo.impl.util.StopAfterWeightIterator in project graphdb by neo4j-attic.
the class ExperimentalAStar method findAllPaths.
public Iterable<WeightedPath> findAllPaths(Node start, final Node end) {
Predicate<Path> filter = new Predicate<Path>() {
public boolean accept(Path position) {
return position.endNode().equals(end);
}
};
final Traverser traverser = traversalDescription.order(new SelectorFactory(end)).filter(filter).traverse(start);
return new Iterable<WeightedPath>() {
public Iterator<WeightedPath> iterator() {
return new StopAfterWeightIterator(traverser.iterator(), costEvaluator);
}
};
}
Aggregations