Where is APOC's PageRank implementation, i.e. source code?

Hello,

I would like to learn how APOC's PageRank algorithm is implemented code-wise. I have checked its GitHub (https://github.com/neo4j-contrib/neo4j-apoc-procedures), searched all files for the keyword pagerank, but didn't find a real implementation. I assume the implementation should be in Java (*.java files).

Sorry if this question seems naive. Did I miss something basic that everybody should know but I don't?

Thank you.

Hello,

If I'm right, the PageRank algo is in Graph Data Science library now: https://github.com/neo4j/graph-data-science/tree/master/algo-common/src/main/java/org/neo4j/graphalgo/pagerank

This is from APOC: https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/4.0/docs/asciidoc/algorithms/pagerank.adoc

2 Likes

You're right. Since version 4, the implementation is moved to Graph Data Science library.

For completeness, in case someone is still using an older version of Neo4j, e.g. v3.5, like me, they can get the version number of APOC library via RETURN apoc.version(); in Neo4j Browser. Then clone the repo with git clone; and git branch -vv --all to see all the branches, and git checkout the right branch, following the version number. They should find the algorithm implementation that matches the Neo4j/APOC version being used.