The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Algorithm::PageRank - Calculating PageRank

SYNOPSIS

  use Algorithm::PageRank;
  $pr = Algorithm::PageRank->new( dbprefix => $prefix);

  $pr->graph([
              0 => 1,
              0 => 2,
              1 => 0,
              2 => 1,
              ]
              );

  $pr->iterate(100);

  $pr->pagerank();

DESCRIPTION

This is a simple implementation of pagerank algorithm exploited by Google. Please do not expect it to be potent to cope with zilla-size of data.

new

The contructor. Please specify the prefix of db files.

graph

Feeding the graph topology. Vertices count from 0, which are all of integer, and there is not expected to be any gap within the integer series.

iterate

Calculating the pagerank vector. The parameter is the maximal number of iterations. If the vector does not converge before reaching the threshold, then calculation will stop at the maximum. Default is 100.

pagerank

Returns the pagerank vector. You can give an extra index number for retrieval of a scalar.

COPYRIGHT

xern <xern@cpan.org>

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.