User Tools

Site Tools


gibson:teaching:fall-2012:math445:lab6

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 Lab 6: Google Page Rank ====== **Part 1:** Compute the Google Page Rank for a very small network of links. **(a)** The following directed graph represents links between eight webpages: {{:gibson:teaching:fall-2012:math445:network1.png?direct&400|}} Give the Page Rank of each page, and provide a list of the page indices sorted by their Page Ranks. You can refer to class notes or [[http://www.ams.org/samplings/feature-column/fcarc-pagerank]] for details of the Google Page Rank algorithm. Hints * It's good to have a firm grasp on the mathematics before writing the code. * Write your code in a script file and run the script from within Matlab. * Use ''G = zeros(8,8)'' to allocate an 8 x 8 matrix of zeros, and then insert 1s at the required spots with statements like ''G(3,4) = 1''. * Better yet, store the set of nonzero indices as a ''N x 2'' matrix in a file ''links.asc'', then load that matrix into Matlab with ''L = load links.asc'', and then loop over the ''N'' rows of ''L'' and assign ones into the specified elements of ''G'' with ''G(L(n,2), L(n,1)) = 1'' where ''n'' is the loop index. * The transition matrix ''H'' has a ''1/n'' everywhere ''G'' has a 1, where ''n'' is the number of nonzero entries in the same column of ''G''. Instead of calculating ''H'' yourself and typing it in, use Matlab to calculate it from ''G''. Hints: ''s = sum(G)'' will give you an 8d row vector ''s'' whose elements are the sums of each of the eight columns of G. You can then calculate ''H'' by allocating it as an 8 x 8 matrix of zeros, and then assigning into each of its eight columns with ''H(:,j) = G(:,j)/s(j)'' (looping over ''j''). **(b)** Suppose that, instead of representing links between web pages, the directed graphs tell who likes whom among a your circle of friends, and that you use the same algorithm to compute a Likeability Rank, with the same numerical results. Would this give true quantitative values and rankings of how likeable your friends are? Why or why not? What does your answer here say about Google Page Rank as a method of ranking web pages? I don't have a specific answer in mind here. Just be thoughtful. ---- **Part 2:**

gibson/teaching/fall-2012/math445/lab6.1350322965.txt.gz · Last modified: 2012/10/15 10:42 by gibson