code: private int numDeletions(Set<Integer> remCandidates, SubsetSolution sol){
          int d = Math.min(numDeletions, Math.min(remCandidates.size(), sol.getNumSelectedIDs()-minSubsetSize));
          return Math.max(d, 0);
      }
docs: Computes the number of deletions that are to be performed, given the set of remove candidates
  and the current subset solution. Takes into account the desired number of deletions \(k\)
  specified at construction, the number of currently selected non-fixed items and the minimum
  allowed subset size (if any).
  
  @param remCandidates candidate IDs to be removed from the selection
  @param sol subset solution for which moves are being generated
  @return number of deletions to be performed