Class BNPReplacement<T>
- Type Parameters:
T- the representation of population members
- All Implemented Interfaces:
Splittable<ReplacementStrategy<T>>, ReplacementStrategy<T>
The BNP has been demonstrated to be effective in continuous and combinatorial optimization problems:
Cornejo-Acosta, J. A., Segura, C., Garcia-Diaz, J., and Perez-Sansalvador, J. C. (2026). Diversity Management Techniques for the Upper-Bounded Hamiltonian p-Median Problem. Mathematical and Computational Applications, 31(2). https://doi.org/10.3390/mca31020064
Segura, C., Lugo, L., Miranda, G., and Serrano Cardenas, E. D. (2024). PACE Solver Description: CIMAT_Team. In E. Bonnet and P. Rzazewski (Eds.), 19th International Symposium on Parameterized and Exact Computation (IPEC 2024) (Vol. 321, p. 31:1-31:4). Schloss Dagstuhl – Leibniz-Zentrum fur Informatik. https://doi.org/10.4230/LIPIcs.IPEC.2024.31
Lugo, L., Segura, C., and Miranda, G. (2022). A diversity-aware memetic algorithm for the linear ordering Problem. Memetic Computing, 14(4), 395-409. https://doi.org/10.1007/s12293-022-00378-5
Hernandez Constantino, O., and Segura, C. (2022). A parallel memetic algorithm with explicit management of diversity for the job shop scheduling problem. Applied Intelligence, 52(1), 141–153. https://doi.org/10.1007/s10489-021-02406-2
Chacón Castillo, J., and Segura, C. (2020). Differential evolution with enhanced diversity maintenance. Optimization Letters, 14(6), 1471–1490. https://doi.org/10.1007/s11590-019-01454-5
Romero Ruiz, E., and Segura, C. (2018). Memetic Algorithm with Hungarian Matching Based Crossover and Diversity Preservation. Computación y Sistemas, 22(2), 347–361. https://doi.org/10.13053/CyS-22-2-2951
Segura, C., Hernandez-Aguirre, A., Luna, F., and Alba, E. (2017). Improving Diversity in Evolutionary Algorithms: New Best Solutions for Frequency Assignment. IEEE Transactions on Evolutionary Computation, 21(4), 539–553. https://doi.org/10.1109/TEVC.2016.2641477
-
Nested Class Summary
Nested classes/interfaces inherited from interface ReplacementStrategy
ReplacementStrategy.Replacements -
Constructor Summary
ConstructorsConstructorDescriptionBNPReplacement(BiFunction<T, T, Double> distanceFunction) Constructs the replacement strategy, with a default initialDiversityFactor 0.4.BNPReplacement(BiFunction<T, T, Double> distanceFunction, double initialDiversityFactor) Constructs the replacement strategy. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(int generations) Initializes the replacement strategy with the specified number of generations.voidreplace(PopulationCandidates.DoubleFitness<T> parentPopulation, PopulationCandidates.DoubleFitness<T> childPopulation, ReplacementStrategy.Replacements replacements, int targetPopulationSize) Chooses the members of the population of the next generation from among those currently in the population and the pool of candidates formed from crossover and mutation.voidreplace(PopulationCandidates.IntegerFitness<T> parentPopulation, PopulationCandidates.IntegerFitness<T> childPopulation, ReplacementStrategy.Replacements replacements, int targetPopulationSize) Chooses the members of the population of the next generation from among those currently in the population and the pool of candidates formed from crossover and mutation.voidsetInitialDiversityFactor(double initialDiversityFactor) Sets the initial diversity factor.split()Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms.
-
Constructor Details
-
BNPReplacement
Constructs the replacement strategy, with a default initialDiversityFactor 0.4.- Parameters:
distanceFunction- Function to measure the distance between two candidate solutions.
-
BNPReplacement
Constructs the replacement strategy.- Parameters:
distanceFunction- Function to measure the distance between two candidate solutions.initialDiversityFactor- Factor to modify the initial diversity threshold.
-
-
Method Details
-
replace
public void replace(PopulationCandidates.IntegerFitness<T> parentPopulation, PopulationCandidates.IntegerFitness<T> childPopulation, ReplacementStrategy.Replacements replacements, int targetPopulationSize) Description copied from interface:ReplacementStrategyChooses the members of the population of the next generation from among those currently in the population and the pool of candidates formed from crossover and mutation. Implementations must not attempt to further manipulate the state of the individuals in these sets. Doing so can lead to undefined behavior.- Specified by:
replacein interfaceReplacementStrategy<T>- Parameters:
parentPopulation- the current populationchildPopulation- the members of the population chosen by the selection operator which have already gone through crossover, mutation, both, or neither (based on crossover rates, mutation rates, etc)replacements- records which members of the parent and child populations serve as replacementstargetPopulationSize- the size of the target population for the next generation. In most cases this will likely be the same as parentPopulation.size(). But, do not make that assumption in your implementation to allow less common EA structures where population size may vary
-
replace
public void replace(PopulationCandidates.DoubleFitness<T> parentPopulation, PopulationCandidates.DoubleFitness<T> childPopulation, ReplacementStrategy.Replacements replacements, int targetPopulationSize) Description copied from interface:ReplacementStrategyChooses the members of the population of the next generation from among those currently in the population and the pool of candidates formed from crossover and mutation. Implementations must not attempt to further manipulate the state of the individuals in these sets. Doing so can lead to undefined behavior.- Specified by:
replacein interfaceReplacementStrategy<T>- Parameters:
parentPopulation- the current populationchildPopulation- the members of the population chosen by the selection operator which have already gone through crossover, mutation, both, or neither (based on crossover rates, mutation rates, etc)replacements- records which members of the parent and child populations serve as replacementstargetPopulationSize- the size of the target population for the next generation. In most cases this will likely be the same as parentPopulation.size(). But, do not make that assumption in your implementation to allow less common EA structures where population size may vary
-
split
Description copied from interface:SplittableGenerates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms. The state of the object that is returned may or may not be identical to that of the original. Thus, this is a distinct concept from the functionality of theCopyableinterface. Classes that implement this interface must ensure that the object returned performs the same functionality, and that it does not share any state data that would be either unsafe or inefficient for concurrent access by multiple threads. The split method is allowed to simply return the this reference, provided that it is both safe and efficient for multiple threads to share a single copy of the Splittable object. The intention is to provide a multithreaded search with the capability to provide spawned threads with their own distinct search operators. Such multithreaded algorithms can call the split method for each thread it spawns to generate a functionally identical copy of the operator, but with independent state.- Specified by:
splitin interfaceSplittable<T>- Returns:
- A functionally identical copy of the object, or a reference to this if it is both safe and efficient for multiple threads to share a single instance of this Splittable object.
-
setInitialDiversityFactor
public void setInitialDiversityFactor(double initialDiversityFactor) Sets the initial diversity factor. The default value is 0.4.- Parameters:
initialDiversityFactor- the initial diversity factor
-
init
public void init(int generations) Initializes the replacement strategy with the specified number of generations.- Specified by:
initin interfaceReplacementStrategy<T>- Parameters:
generations- the number of generations to run the algorithm- Throws:
IllegalArgumentException- if generations is less than or equal to 0
-