Class MSCTDominance

java.lang.Object
org.ddolib.examples.layered.msct.MSCTDominance
All Implemented Interfaces:
Dominance<MSCTState>

public class MSCTDominance extends Object implements Dominance<MSCTState>
Implements the dominance relation for the Maximum Sum of Compatible Tasks (MSCT) problem.

This class defines how two states of the MSCT problem can be compared in terms of dominance. In this context, a state state1 is said to be dominated or equal to another state state2 if both states have the same set of remaining jobs to schedule, and state2 achieves the same or an earlier current time (i.e., a better schedule in terms of completion time).

The dominance relation is used in search algorithms (such as DDO or A*) to prune suboptimal states — if one state dominates another, the dominated state can be safely discarded without affecting optimality.

Example:

 MSCTState s1 = new MSCTState(remainingJobs1, 10);
 MSCTState s2 = new MSCTState(remainingJobs1, 8);

 MSCTDominance dominance = new MSCTDominance();
 // true, since s2.currentTime() is less than s1.currentTime()
 boolean result = dominance.isDominatedOrEqual(s1, s2);
 
  • Constructor Details

    • MSCTDominance

      public MSCTDominance()
      Creates a new instance of this dominance relation.
  • Method Details

    • getKey

      public Set<Integer> getKey(MSCTState state)
      Returns a key used for grouping states before applying dominance checks.

      Only states with the same set of remaining jobs can dominate each other (see isDominatedOrEqual(org.ddolib.examples.layered.msct.MSCTState, org.ddolib.examples.layered.msct.MSCTState)), so this set is the key: each state is only compared with the states having the same remaining jobs, instead of all the states of its layer.

      Specified by:
      getKey in interface Dominance<MSCTState>
      Parameters:
      state - the state from which to extract the key
      Returns:
      the set of remaining jobs of the state
    • isDominatedOrEqual

      public boolean isDominatedOrEqual(MSCTState state1, MSCTState state2)
      Checks whether the first state state1 is dominated or equal to the second state state2.

      A state state1 is dominated by state2 if:

      • Both states have the same set of remaining jobs to schedule, and
      • The current time of state2 is less than or equal to that of state1.

      This indicates that state2 represents a better (or equivalent) scheduling situation, making state1 redundant in the search process.

      Specified by:
      isDominatedOrEqual in interface Dominance<MSCTState>
      Parameters:
      state1 - the first state to test for dominance
      state2 - the second state, potentially dominating the first
      Returns:
      true if state1 is dominated or equal to state2; false otherwise