def _has_converged(pi_star, pi):
    """Checks if the random walk has converged.

    :param pi_star: the new vector
    :param pi: the old vector
    :returns: bool-- True iff pi has converged.

    """
    node_count = pi.shape[0]
    EPS = 1e-05
    for i in range(node_count):
        if pi[i] - pi_star[i] > EPS:
            return False
    return True
