Class Hybrid<T>
java.lang.Object
org.ddolib.ddo.core.heuristics.cluster.Hybrid<T>
- Type Parameters:
T- the type of states in the decision diagram
- All Implemented Interfaces:
ReductionStrategy<T>
Hybrid reduction strategy that combines cost-based and distance-based clustering
for decision diagram layers.
This strategy is a hybridation between cost based selection and GHP.
It preserves the w * alpha best nodes (alpha between 0 and 1) and merge the other nodes using clustering.
It requires a problem-specific StateRanking comparator to break the ties between nodes of same cost,
and a problem-specif StateDistance to quantify the dissimilarity between states.
This class implements ReductionStrategy and merges two strategies:
CostBased: preserves a fraction of nodes based on their rankingGHP: clusters the remaining nodes based on a distance metric
The combination is controlled by a weighting parameter alpha:
alphafraction of the clusters are preserved using cost-based ranking1-alphafraction of the clusters are formed using the GHP distance-based method
-
Constructor Summary
ConstructorsConstructorDescriptionHybrid(StateRanking<T> ranking, StateDistance<T> distance) Constructs a Hybrid reduction strategy with default alpha (0.5) and seed.Hybrid(StateRanking<T> ranking, StateDistance<T> distance, double alpha, long seed) Constructs a Hybrid reduction strategy with specified ranking, distance, alpha, and seed. -
Method Summary
Modifier and TypeMethodDescriptionList<NodeSubProblem<T>>[]defineClusters(List<NodeSubProblem<T>> layer, int maxWidth) Defines clusters from a layer of nodes using a hybrid strategy.voidsetSeed(long seed) Sets the random seed used for the distance-based GHP clustering.
-
Constructor Details
-
Hybrid
Constructs a Hybrid reduction strategy with specified ranking, distance, alpha, and seed.- Parameters:
ranking- state ranking used for cost-based preservationdistance- state distance used for GHP clusteringalpha- fraction of clusters preserved using cost-based strategyseed- random seed for distance-based clustering
-
Hybrid
Constructs a Hybrid reduction strategy with default alpha (0.5) and seed.- Parameters:
ranking- state ranking used for cost-based preservationdistance- state distance used for GHP clustering
-
-
Method Details
-
setSeed
public void setSeed(long seed) Sets the random seed used for the distance-based GHP clustering.- Parameters:
seed- the new random seed
-
defineClusters
Defines clusters from a layer of nodes using a hybrid strategy.A fraction
alphaof nodes are clustered using cost-based ranking, while the remaining nodes are clustered using the GHP distance-based method.- Specified by:
defineClustersin interfaceReductionStrategy<T>- Parameters:
layer- the list of nodes at the current layermaxWidth- the desired maximum width after clustering- Returns:
- an array of clusters, each cluster being a list of nodes
-