function [ a, h ] = hits_iteration ( A, k )

  [ m, n ] = size ( A );
  a = ones ( n, 1 );
  h = ones ( n, 1 );

  for step = 1 : k
    
    for j = 1 : n
      in = find ( A(:,j) );
      a(j) = sum ( h(in) );
    end
    a = a / norm ( a, 2 );

    for i = 1 : n
      out = find ( A(i,:) );
      h(i) = sum ( a(out) );
    end
    h = h / norm ( h, 2 );

  end

  return
end
