I want to calculate betweenness in a very large graph in neo4j using py2neo.
I am using a cypher query like this:
MATCH p=allShortestPaths((source:DOLPHIN)-[*]-(target:DOLPHIN))
WHERE id(source) < id(target)
AND length(p) > 1
UNWIND nodes(p)[1..-1] as n
RETURN n.name, count(*) as betweenness
ORDER BY betweenness DESC
It is working for small graph but not working for a large graph with 1 million nodes. I have passed this query using py2neo.
Earlier I was getting error timeout which have resolved but now after running for sometime it is saying query cannot be processed. I am getting following error:-
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/core.py", line 111, in execute
results = tx.commit()
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/core.py", line 306, in commit
return self.post(self.__commit or self.__begin_commit)
File "/usr/local/lib/python2.7/dist-packages/py2neo/cypher/core.py", line 261, in post
raise self.error_class.hydrate(error)
py2neo.cypher.error.statement.ExecutionFailure: The statement has been closed.
I have searched a lot about it. Please help me with this