Package org.ddolib.examples.misp
Class MispRanking
java.lang.Object
org.ddolib.examples.misp.MispRanking
- All Implemented Interfaces:
Comparator<BitSet>,StateRanking<BitSet>
Implements a ranking strategy for states in the Maximum Independent Set Problem (MISP).
The ranking is based on the number of remaining nodes in the state: a state with more remaining nodes is considered more promising for exploration in a decision diagram.
This ranking can be used by solvers to prioritize which states to expand first when building or traversing the search space.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
MispRanking
public MispRanking()
-
-
Method Details
-
compare
Compares two states based on the number of remaining nodes.- Specified by:
comparein interfaceComparator<BitSet>- Parameters:
o1- the first state to compareo2- the second state to compare- Returns:
- a negative integer, zero, or a positive integer as the first state has fewer, equal, or more remaining nodes than the second state
-