*D)\e);
fprintf('exact pi\n');  disp(pi(:)')

figure; bar(pi);printPmtkFigure('smallwebPagerank'); 


%% Power method
fprintf('pi over time using power method\n');
format compact
pi = e/n;
z = ((1-p)*(c~=0) + (c==0))/n;
A = p*G*D + e*z;
for i=1:10
  pi = normalize(A*pi); 
  disp(pi')
end

%% Matrix free power method
[pi,cnt] = pagerankpow(G);
fprintf('matrix free power method\n'); disp(pi(:)')


%% Now run it on the Harvard web site
loadData('harvard500');
figure;spy(G);
printPmtkFigure('harvard500spy'); 
t