Algorithm::PageRank - Calculate PageRank in Perl


Algorithm-PageRank documentation  | view source Contained in the Algorithm-PageRank distribution.

Index


NAME

Top

Algorithm::PageRank - Calculate PageRank in Perl

SYNOPSIS

Top

  use Algorithm::PageRank;
  $pr = new Algorithm::PageRank;

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

  $pr->iterate();
  $pr->iterate(50);

  $pr->result();

DESCRIPTION

Top

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

graph

Feed the graph topology. Vertices count from 0.

iterate

Calculate 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 iteration number is 100.

You can also reset the dampening factor ($Algorithm::PageRank::d_factor). The default value is 0.05.

result

Return the pagerank vector in PDL object format.

COPYRIGHT

Top


Algorithm-PageRank documentation  | view source Contained in the Algorithm-PageRank distribution.