function r = power_method ( A, its )

%*****************************************************************************80
%
%% power_method estimates the page rank vector using the power method.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    29 February 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A(N,N): the transition matrix or the Google matrix.
%
%    integer ITS: the number of iterations.
%
%  Output:
%
%    real R(N): the estimated page rank vector.
%
  n = size ( A, 1 );
  r = rand ( n, 1 );
  for k = 1 : its
    r = A * r;
    r = r / norm ( r, 1 );
  end

  return
end

