What of the paths returned by shortest path do you want to send to dijkstra?
You can just get
* nodes(path) for all nodes
* nodes(path)[0] for the first, and [-1] for the last etc.
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
as shortest
call apoc.algo.dijkstra(shortest[0], shortest[-1], 'Link2', 'BANDOUT')
YIELD path, weight
RETURN path, weight, shortest
On Wed, Apr 26, 2017 at 6:49 PM, Andre Beltrami Rocha <[email protected]>
wrote:
> Hi, my name is André Beltrami. I am a Master Degree student in Brazil.
> My project is about Software Defined Networks, and I am using Neo4J to
> storage my 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 this two queries in one?
> I am using Neo4j 3.0.3 and apoc 3.0.4.
>
> All Regards, André Beltrami.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.