I have to find the APSP between Subnet to subnet and remove all those paths which have tgw2 in their pathways.
Things I tried:
Projection:
CALL gds.graph.project(
'subAndTGWAndNet1',
['Subnet', 'Network','TGW'],
{
SUB_OF: {
type: 'SUB_OF',
orientation: 'UNDIRECTED'
},
connects_to: {
type: 'connects_to',
orientation: 'UNDIRECTED'
}
}
)
YIELD
graphName AS graph, nodeProjection, nodeCount AS nodes, relationshipCount AS rels
APSP
CALL gds.allShortestPaths.stream('subAndTGWAndNet1') YIELD sourceNodeId, targetNodeId, distance
WHERE gds.util.isFinite(distance) AND sourceNodeId <> targetNodeId
WITH gds.util.asNode(sourceNodeId) AS source, gds.util.asNode(targetNodeId) AS target, distance
WHERE NONE(n IN [source, target] WHERE n:TGW ) AND NONE(n IN [source, target] WHERE n:Network )
WITH source, target, distance, [(source)-[]-(node:TGW{name:"tgw1"})-[]-(target) | node] AS tgwNodes
WHERE all(x IN tgwNodes WHERE x IS NULL)
RETURN source.name AS source, target.name AS target, distance
ORDER BY distance DESC, source ASC, target ASC
but I am getting 0 paths