allshortestPaths problem - new with 3.2.x versions...

170 views
Skip to first unread message

Alan Robertson

unread,
Sep 5, 2017, 10:47:20 AM9/5/17
to Neo4J, Michael Hunger
I'm getting an error message when running the query below:

MATCH p = allshortestPaths( (start:Class_Drone)-[:tcpclient|:tcpservice|:hosting|:baseip|:nicowner|:monitoring|:wiredto|:ipowner*]-(m) )
        WHERE m.nodetype IN ['IPaddrNode', 'SystemNode', 'MonitorAction', 'ProcessNode', 'IPtcpportNode', 'Drone', 'NICNode']
        UNWIND nodes(p) AS n
        UNWIND rels(p) AS r
        RETURN [x in COLLECT(DISTINCT n) WHERE x.nodetype in ['IPaddrNode', 'SystemNode', 'MonitorAction', 'ProcessNode', 'IPtcpportNode', 'Drone', 'NICNode']] AS nodes,
        COLLECT(DISTINCT r) AS relationships

I have this statement in my neo4j config file:

cypher.forbid_shortestpath_common_node=false

And I get this message:
The shortest path algorithm does not work when the start and end nodes are the same. This can happen if you
perform a shortestPath search after a cartesian product that might have the same start and end nodes for some
of the rows passed to shortestPath. If you would rather not experience this exception, and can accept the
possibility of missing results for those rows, disable this in the Neo4j configuration by setting
`cypher.forbid_shortestpath_common_node` to false. If you cannot accept missing results, and really want the
shortestPath between two common nodes, then re-write the query using a standard Cypher variable length pattern
expression followed by ordering by path length and limiting to one result.

I did this, but still get that message...

FWIW, this query used to work in earlier (3.0.x) versions of Neo4j. The intent of the query is to return the selected portions of the graph  as a subgraph. This particular one returns basically the entire graph, but other variations are more selective. They all get the same message...


--
  Alan Robertson

Alan Robertson

unread,
Sep 5, 2017, 11:11:12 AM9/5/17
to Neo4J, Michael Hunger

I forgot to say - yes, I did restart Neo4j (several times).

--
  Alan Robertson

Reply all
Reply to author
Forward
0 new messages