Class SRFLPRanking

java.lang.Object
org.ddolib.examples.srflp.SRFLPRanking
All Implemented Interfaces:
Comparator<SRFLPState>, StateRanking<SRFLPState>

public class SRFLPRanking extends Object implements StateRanking<SRFLPState>
Implements a ranking between two SRFLPState instances for use in decision diagram or search-based algorithms.

The ranking is based on the number of departments that still need to be placed, i.e., the sum of departments in the must and maybe sets of a state. A state with fewer remaining departments is considered "better" (ranked lower).

This class implements the StateRanking interface and can be used to prioritize states during search, pruning, or frontier management in SRFLP solvers.

  • Constructor Details

    • SRFLPRanking

      public SRFLPRanking()
  • Method Details

    • compare

      public int compare(SRFLPState o1, SRFLPState o2)
      Compares two SRFLP states based on the total number of remaining departments.
      Specified by:
      compare in interface Comparator<SRFLPState>
      Parameters:
      o1 - the first state to compare
      o2 - the second state to compare
      Returns:
      a negative integer if o1 has fewer remaining departments than o2, zero if they have the same number of remaining departments, or a positive integer if o1 has more remaining departments than o2.