Hello,
I got the dataset from my boss but nodes don't have labels. I want to find all pairs shortest path.
the dataset has about 10000 nodes.
Please check my code is right?
CALL gds.alpha.allShortestPaths.stream({
nodeProjection: '*',
relationshipProjection: {
ROAD: {
type: 'RELATED',
properties: 'length'
}
},
relationshipWeightProperty: 'length'
})
YIELD sourceNodeId, targetNodeId, distance
WITH sourceNodeId, targetNodeId, distance
WHERE gds.util.isFinite(distance) = true
MATCH (source) WHERE id(source) = sourceNodeId
MATCH (target) WHERE id(target) = targetNodeId
WITH source, target, distance WHERE source <> target
RETURN source.name AS source, target.name AS target, distance
ORDER BY distance DESC, source ASC, target ASC
LIMIT 10
please help me