private boolean convergence(List<Page> pages){
  double aveHubDelta=100;
  double aveAuthDelta=100;
  if (pages == null) {
    return true;
  }
  double[] currHubVals=new double[pages.size()];
  double[] currAuthVals=new double[pages.size()];
  for (int i=0; i < pages.size(); i++) {
    Page currPage=pages.get(i);
    currHubVals[i]=currPage.hub;
    currHubVals[i]=currPage.authority;
  }
  if (prevHubVals == null || prevAuthVals == null) {
    prevHubVals=currHubVals;
    prevAuthVals=currAuthVals;
    return false;
  }
  aveHubDelta=getAveDelta(currHubVals,prevHubVals);
  aveAuthDelta=getAveDelta(currAuthVals,prevAuthVals);
  if (aveHubDelta + aveAuthDelta < DELTA_TOLERANCE || (Math.abs(prevAveHubDelta - aveHubDelta) < 0.01 && Math.abs(prevAveAuthDelta - aveAuthDelta) < 0.01)) {
    return true;
  }
 else {
    prevHubVals=currHubVals;
    prevAuthVals=currAuthVals;
    prevAveHubDelta=aveHubDelta;
    prevAveAuthDelta=aveAuthDelta;
    return false;
  }
}

private boolean convergence ( List < Page > pages ) { double aveHubDelta = 100 ; double aveAuthDelta = 100 ; if ( pages == null ) { return true ; } double [ ] currHubVals = new double [ pages . size ( ) ] ; double [ ] currAuthVals = new double [ pages . size ( ) ] ; for ( int i = 0 ; i < pages . size ( ) ; i ++ ) { Page currPage = pages . get ( i ) ; currHubVals [ i ] = currPage . hub ; currHubVals [ i ] = currPage . authority ; } if ( prevHubVals == null || prevAuthVals == null ) { prevHubVals = currHubVals ; prevAuthVals = currAuthVals ; return false ; } aveHubDelta = getAveDelta ( currHubVals , prevHubVals ) ; aveAuthDelta = getAveDelta ( currAuthVals , prevAuthVals ) ; if ( aveHubDelta + aveAuthDelta < DELTA_TOLERANCE || ( Math . abs ( prevAveHubDelta - aveHubDelta ) < 0.01 && Math . abs ( prevAveAuthDelta - aveAuthDelta ) < 0.01 ) ) { return true ; } else { prevHubVals = currHubVals ; prevAuthVals = currAuthVals ; prevAveHubDelta = aveHubDelta ; prevAveAuthDelta = aveAuthDelta ; return false ; } }
pg . 872 : " if we then normalize the scores and repeat k times the process will converge "
