public boolean hasNext(){
  if (isBruteForce) {
    return (currentIndex < numEdges);
  }
 else {
    return currentIndexInCandidates < candidates.size();
  }
}

public boolean hasNext ( ) { if ( isBruteForce ) { return ( currentIndex < numEdges ) ; } else { return currentIndexInCandidates < candidates . size ( ) ; } }
false if there are no more candidates ; true otherwise .
