I am using Neo4J to store a network topology and execute some graphs algorithms like Dijkstra and allSimplePaths (using apoc procedures).
I need to know if is possible use the output of allSimplePaths as input to the Dijkstra algorithm. In other words, run the Dijkstra algorithm on the subgraph returned by the allSimplePaths procedure.
My queries are:
1)
MATCH (startNode:Hosts {IP:"10.0.0.1"}), (endNode:Hosts {IP:"10.0.0.4"})
CALL apoc.algo.allSimplePaths(startNode, endNode, 'Link2', 6 ) YIELD path
RETURN path
2)
MATCH (startNode:Hosts {IP:"10.0.0.1"}), (endNode:Hosts {IP:"10.0.0.4"})
CALL apoc.algo.dijkstra(startNode, endNode, 'Link2', 'BANDOUT') YIELD path, weight
RETURN path, weight
So, how I bond these two queries into one? I am using Neo4j 3.0.3 and apoc 3.0.4.