cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Run for ever and no output from allshortestpath

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

0 REPLIES 0