use of org.neo4j.graphalgo.BasicEvaluationContext in project neo4j by neo4j.
the class TestExactDepthPathFinder method testExactDepthPathsLoopsAllowed.
@Test
void testExactDepthPathsLoopsAllowed() {
//
try (Transaction transaction = graphDb.beginTx()) {
graph.makeEdgeChain(transaction, "a,b,c,d,b,c,e");
Node a = graph.getNode(transaction, "a");
Node e = graph.getNode(transaction, "e");
var context = new BasicEvaluationContext(transaction, graphDb);
assertPaths(new ExactDepthPathFinder(context, forDirection(Direction.OUTGOING), 6, Integer.MAX_VALUE, true).findAllPaths(a, e), "a,b,c,d,b,c,e");
transaction.commit();
}
}
use of org.neo4j.graphalgo.BasicEvaluationContext in project neo4j by neo4j.
the class TestShortestPath method testDirectedFinder.
@Test
void testDirectedFinder() {
//
try (Transaction transaction = graphDb.beginTx()) {
graph.makeEdgeChain(transaction, "a,b,c,d,e,f,m");
graph.makeEdgeChain(transaction, "a,g,h,i,j,k,l,m");
var context = new BasicEvaluationContext(transaction, graphDb);
testShortestPathFinder(context, finder -> assertPaths(finder.findAllPaths(graph.getNode(transaction, "a"), graph.getNode(transaction, "j")), "a,g,h,i,j"), forTypeAndDirection(R1, OUTGOING), 4);
transaction.commit();
}
}
Aggregations