I'm using Neo4J 2.2.5 with Spring Data and I want to calculate the shortest path between 2 nodes using Dijkstra.
This is my code :
PathFinder<WeightedPath> finder = GraphAlgoFactory
.dijkstra(PathExpanders.forTypeAndDirection(RelationshipTypes.SEM_SIM, Direction.BOTH),
Constants.ADVERTISED_COST);
WeightedPath path = finder.findSinglePath(startVertexNode, goalVertexNode);
How can I get the startVertexNode and goalVertexNode parameters? Using the cypher approach below I get to the correct data but how can I convert the Result into a Node?
Map<String, Object> params = new HashMap<String, Object>();
params.put( "id", 0 );
String query = "MATCH n WHERE id(n) = {id} RETURN n";
org.neo4j.ogm.session.result.Result result = this.neo4jOperations.query(query, params);
Thanks in advance for helping me out!
Kind regards, Johan,