@ Override public List < SubsetMove > getAllMoves ( SubsetSolution solution ) { // check minimum size if ( minSizeReached ( solution ) ) { return Collections . emptyList ( ) ; } // get set of candidate IDs for deletion (possibly fixed IDs are discarded) Set < Integer > removeCandidates = getRemoveCandidates ( solution ) ; // check if there are any candidates to be removed if ( removeCandidates . isEmpty ( ) ) { return Collections . emptyList ( ) ; } // create deletion move for all candidates return removeCandidates . stream ( ) . map ( del -> new DeletionMove ( del ) ) . collect ( Collectors . toList ( ) ) ; }
Generates a list of all possible deletion moves that remove a single ID from the selection of a given subset solution . Possible fixed IDs are not considered to be removed and the minimum subset size is taken into account . May return an empty list if no deletion moves can be generated .