|
Algorithm::PageRank - Calculating PageRank |
Algorithm::PageRank - Calculating PageRank
use Algorithm::PageRank; $pr = Algorithm::PageRank->new( dbprefix => $prefix);
$pr->graph([
0 => 1,
0 => 2,
1 => 0,
2 => 1,
]
);
$pr->iterate(100);
$pr->pagerank();
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.
The contructor. Please specify the prefix of db files.
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.
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.
Returns the pagerank vector. You can give an extra index number for retrieval of a scalar.
xern <xern@cpan.org>
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
|
Algorithm::PageRank - Calculating PageRank |