The Google PageRank Algorithm in 126 Lines of Python
kraeutler.net
kraeutler.net
It's actually not all that easy to implement this stuff efficiently when n grows to any sort of useful size. E.g. the article uses an n x n adjacency matrix, so if we take n = 1 million pages, we need 4TB just to represent it, assuming no overhead. (Adjacency lists help here.)
See http://dbpubs.stanford.edu:8090/pub/showDoc.Fulltext?lang=en....
(I hacked together a script to compute this on MediaWiki wikis a while ago, by examining the DB directly -- http://collison.ie/code/pagerank.rb)
By that of course I don't mean to say you can use this script to build your own google.... but the problems lie elsewhere.