Skip to content
Pagerank algorithm for graphology.
Branch: master
Clone or download
Latest commit 829e3dc Mar 27, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Mar 15, 2018
.travis.yml Initial commit Mar 15, 2018
LICENSE.txt Initial commit Mar 15, 2018
index.js Fixing weighted pagerank Mar 27, 2018
package.json Fixing graphology Mar 27, 2018
test.js Fixing weighted pagerank Mar 27, 2018

Build Status

Graphology Pagerank Algorithm

Pagerank algorithm for graphology.


npm install graphology-pagerank


import pagerank from 'graphology-pagerank';

// To compute pagerank and return the score per node:
const p = pagerank(graph);

// To directly map the result to nodes' attributes:

// Note that you can also pass options to customize the algorithm:
const p = pagerank(graph, {alpha: 0.9, weighted: false})


  • graph Graph: target graph.
  • options ?object: options:
    • attributes ?object: attributes' names:
      • pagerank ?string [pagerank]: name of the node attribute that will be assigned the pagerank score.
      • weight ?string [weight]: name of the edges' weight attribute.
    • alpha ?number [0.85]: damping parameter of the algorithm.
    • maxIterations ?number [100]: maximum number of iterations to perform.
    • tolerance ?number [1.e-6]: convergence error tolerance.
    • weighted ?boolean [false]: whether to use available weights or not.
You can’t perform that action at this time.