Graph Algorithm - A* algorithm returns java.lang.ArrayIndexOutOfBoundsException: -1

Hey all, I'm trying to follow this talk by Will Lyon and Craig Taverner - I've loaded an OSM Map extract using this OSM Importer for Neo4j and have managed to construct the routing graph and the point-of-interest graph. I'm now attempting to route by running the following query (essentially calling algo.shortestPath.astar.stream as mentioned in the talk):

MATCH (a:PointOfInterest) WHERE a.name = 'from_this_location'
MATCH (b:PointOfInterest) WHERE b.name = 'to_this_location'
CALL algo.shortestPath.astar.stream(a,b,'distance','lat','lon',{relationshipQuery:'ROUTE', nodeQuery:'Routable', direction:'BOTH', defaultValue:1.0})
YIELD nodeId, cost
MATCH (n) WHERE id(n)=nodeId
RETURN COLLECT({lat:n.location.latitude, lon:n.location.longitude}) AS route

However, the following error is returned:

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure `algo.shortestPath.astar.stream`: Caused by: java.lang.ArrayIndexOutOfBoundsException: -1

I've tried this on the following docker images to no avail:

  • Neo4j 3.5.5 Enterprise (with graph algorithms 3.5.7) and
  • Neo4j 3.5.9 Enterprise (with graph algorithms 3.5.9)

Any idea what may be the issue - am I missing something or is this likely a bug?

1 Like