neuler icon indicating copy to clipboard operation
neuler copied to clipboard

With shortest path, if you select the label, it should also take that into consideration when matching start and end node

Open tomasonjo opened this issue 4 years ago • 0 comments

I have selected label and rel type:

:param config => ({
  nodeProjection: 'Person',
  relationshipProjection: {
    relType: {
      type: 'HELPS',
      orientation: 'UNDIRECTED',
      properties: {
        weight: {
          property: 'weight',
          defaultValue: 1
        }
      }
    }
  },
  relationshipWeightProperty: 'weight'
});

But start and end node can be of other labels:

CALL db.propertyKeys() YIELD propertyKey MATCH (start) WHERE start[propertyKey] contains $startNode
WITH start
LIMIT 1
CALL db.propertyKeys() YIELD propertyKey MATCH (end) WHERE end[propertyKey] contains $endNode
WITH start, end

So an error can occur then

Algorithm failed to complete Error: Neo4jError: Failed to invoke procedure gds.alpha.shortestPath.stream: Caused by: java.lang.IllegalArgumentException: startNode with id 802 was not loaded

tomasonjo avatar Sep 10 '20 17:09 tomasonjo