pagerank#

pagerank(graph, iter_count=20, max_diff=None, use_l2_norm=True, damping_factor=0.85)#

Pagerank – pagerank centrality value of the nodes in a graph

This function calculates the Pagerank value of each node in a graph. See https://en.wikipedia.org/wiki/PageRank for more information on PageRank centrality. A default damping factor of 0.85 is used. This is an iterative algorithm which terminates if the sum of the absolute difference in pagerank values between iterations is less than the max diff value given.

Parameters:
  • graph (GraphView) – Raphtory graph

  • iter_count (int) – Maximum number of iterations to run. Note that this will terminate early if convergence is reached. Defaults to 20.

  • max_diff (Optional[float]) – Optional parameter providing an alternative stopping condition. The algorithm will terminate if the sum of the absolute difference in pagerank values between iterations is less than the max diff value given.

  • use_l2_norm (bool) – Flag for choosing the norm to use for convergence checks, True for l2 norm, False for l1 norm. Defaults to True.

  • damping_factor (float) – The damping factor for the PageRank calculation. Defaults to 0.85.

Returns:

Mapping of nodes to their pagerank value.

Return type:

NodeStateF64