#!/usr/bin/perl
print "Content-Type: text/html\n\n<pre>\n";
$damp = 0.85;
$a = $b = $c = $d = $e = 0;
$f = 1; # We'll give the external site an "average" pagerank
$iterate = 40; # loop 40 times
# Extensive Interlinking - "Fully Meshed"
# forward links
# a -> b,c,d - 3 outgoing links - home
# b -> c,d,a - 3 outgoing links - about
# c -> d,a,b,e - 4 outgoing links - products
# d -> a,b,c - 3 outgoing links - more info
# e - nothing - site B
# f -> a - 1 outgoing link - exclusive link!
# i.e. "backward" links (what's pointing to me?)
# a <= b/3,c/4,d/3,f
# b <= c/4,d/3,a/3
# c <= d/3,a/3,b/3
# d <= a/3,b/3,c/3
# e <= c/4
# f <= we're going to assume it has enough incoming links to maintain a PR of 1.
while ($iterate--) {
printf("a: %.5f b: %.5f c: %.5f d: %.5f e: %.5f f: %.5f\n", $a, $b, $c, $d, $e, $f);
$a = 1 - $damp + $damp * ($b/3 + $c/4 + $d/3 + $f);
$b = 1 - $damp + $damp * ($c/4 + $d/3 + $a/3);
$c = 1 - $damp + $damp * ($d/3 + $a/3 + $b/3);
$d = 1 - $damp + $damp * ($a/3 + $b/3 + $c/4);
$e = 1 - $damp + $damp * ($c/4);
$f = 1; # this site has average SEO
}
print("</pre><a href=http://www.ianrogers.net/google-page-rank/#ex10>Back to example 10</a>");
Design by Ian Rogers based on Connections 1.0
