Algorithm::PageRank::XS is a Perl module that implements a simple PageRank algorithm in C. The goal is to quickly get a vector that is closed to the eigenvector of the stochastic matrix of a graph.
Algorithm::PageRank does some pagerank calculations, but it's slow and memory intensive. This module was developed to compute pagerank on graphs with millions of arcs. This module will not, however, scale up to quadrillions of arcs (see the TODO).
SYNOPSYS
use Algorithm::PageRank::XS;
my $pr = Algorithm::PageRank::XS->new();
$pr->graph([
'John' => 'Joey',
'John' => 'James',
'Joey' => 'John',
'James' => 'Joey',
]
);
$pr->result();
# {
# 'James' => '0.569840431213379',
# 'Joey' => '1',
# 'John' => '0.754877686500549'
# }
#
#
# The following simple program takes up arcs and prints the ranks.
use Algorithm::PageRank::XS;
my $pr = Algorithm::PageRank::XS->new();
while () {
chomp;
my ($from, to) = split(/ /, $_);
$pr->add_arc($from, $to);
}
my $r = $pr->results();
while (my ($name, $rank) = each(%{$r})) {
print "$name,$rank
";
}
Product's homepage
Requirements:
· Perl