We are going to use the PageRank procedure as an example, which assigns an importance score to each node based on the importance of its neighbors. For further explanation about the PageRank algorithm, refer to Chapter 5, Node Importance.
The signature of the PageRank procedure in the GDS is as follows:
gds.pageRank.stream(<graphName>, <algoConfiguratioMap>)
So, let's first define the configuration map. If we want to use a damping factor different from the default value of 0.85, we need to specify it in this way:
algoConfig = {
"dampingFactor": 0.8,
}
Similar to the graph creation query, we will build a query with parameters:
"CALL gds.pageRank.stream($graphName, $algoConfig)"
It can be executed in the following way:
with driver.session() as session:
result = session.run(
"CALL gds.pageRank.stream($graphName, $algoConfig)",
graphName=graphName,
algoConfig=algoConfig,
)
We can check the results with a loop on...