Skip to content

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

@tomasonjo

Description

@tomasonjo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions