Archives are data structures for storing and managing collections of solutions during the optimization process.
jMetalPy provides several archive implementations for different use cases:
Archive: Base abstract class for all archives
BoundedArchive: Archive with size limits
NonDominatedSolutionsArchive: Maintains only non-dominated solutions
CrowdingDistanceArchive: Uses crowding distance for diversity
DistanceBasedArchive: Adaptive distance-based selection
Bases: BoundedArchive
[S
]
Archive that maintains solutions using adaptive distance-based subset selection.
This archive extends BoundedArchive to use a sophisticated selection mechanism: - For 2 objectives: Uses crowding distance selection - For >2 objectives: Uses robust distance-based subset selection with normalization
The implementation follows the Java jMetal SafeBestSolutionsArchive algorithm.
The DistanceBasedArchive
class provides adaptive selection strategies based on the number of objectives:
2 objectives: Uses crowding distance selection for optimal diversity along Pareto fronts
>2 objectives: Uses distance-based subset selection with normalization
Key Features:
Automatic strategy adaptation based on problem dimensionality
Robust normalization handling constant objectives
Support for custom distance measures
Non-dominated solution filtering using Pareto dominance
Memory-efficient in-place list modifications
Algorithm for Many-Objective Problems:
Normalize objectives to [0,1] range using min-max normalization
Select random objective for initial sorting
Choose extreme solutions (best and worst in random objective)
Select remaining solutions using maximum minimum distance criterion
Example Usage:
from jmetal.util.archive import DistanceBasedArchive
from jmetal.util.distance import EuclideanDistance
# Create archive with custom distance measure
archive = DistanceBasedArchive(
maximum_size=10,
distance_measure=EuclideanDistance()
)
# Add solutions - automatically adapts strategy
for solution in solutions:
archive.add(solution)
Backward compatibility wrapper for distance_based_subset_selection_robust.
solution_list: List of solutions to select from subset_size: Number of solutions to select distance_measure: Deprecated parameter (ignored) metric: Distance metric to use weights: Optional weights for TCHEBY_WEIGHTED metric random_seed: Optional seed for reproducible results
List of selected solutions
Standalone function for distance-based subset selection that can be used independently of the archive.
Parameters:
solution_list
: List of solutions to select from
subset_size
: Number of solutions to select
distance_measure
: Distance function (default: EuclideanDistance)
Selection Strategy:
For 2 objectives: Delegates to crowding distance selection
For >2 objectives: Uses distance-based algorithm with normalization
Example:
from jmetal.util.archive import distance_based_subset_selection
# Select 5 best solutions from a larger set
selected = distance_based_subset_selection(
solution_list=all_solutions,
subset_size=5
)
Bases: Archive
[S
]
Bases: Archive
[S
]
Archive that maintains only non-dominated solutions using Pareto dominance.
This implementation efficiently manages a collection of solutions by: - Adding new non-dominated solutions - Removing solutions dominated by new ones - Preventing duplicate solutions based on objectives
Time Complexity: O(n) per insertion, where n is archive size Space Complexity: O(n) for storing solutions
Add a solution to the archive if it’s non-dominated and not duplicate.
This method efficiently handles the archive by: 1. Checking if the new solution is dominated by existing ones 2. Removing existing solutions dominated by the new one 3. Preventing addition of duplicate solutions
solution: Solution to add to the archive
True if solution was added, False if rejected (dominated or duplicate)
Time Complexity: O(n) where n is the number of solutions in archive
Bases: BoundedArchive
[S
]
Time Complexity:
DistanceBasedArchive.add()
: O(n²) for >2 objectives, O(n log n) for 2 objectives
distance_based_subset_selection()
: O(n²) worst case
Space Complexity: O(n) for all archive implementations
Scalability: Efficient for typical archive sizes (< 1000 solutions)
Recommendations:
Use CrowdingDistanceArchive
for 2-objective problems requiring only crowding distance
Use DistanceBasedArchive
for mixed or many-objective problems
Use NonDominatedSolutionsArchive
when size limits are not needed
../distance - Distance measures and metrics
../comparator - Solution comparison utilities
../normalization - Objective normalization functions
../../algorithm/multiobjective - Multi-objective algorithms using archives