Class MaxCoverDominance

java.lang.Object
org.ddolib.examples.maximumcoverage.MaxCoverDominance
All Implemented Interfaces:
Dominance<MaxCoverState>

public class MaxCoverDominance extends Object implements Dominance<MaxCoverState>
Dominance rule for MaxCoverState used in the Maximum Coverage problem.

This class implements the Dominance interface and defines a dominance relationship between states based on set inclusion: a state is dominated if its set of covered items is a subset of another state's covered items.

All states are assigned the same dominance key, meaning that any two states are comparable for dominance checking.

  • Constructor Details

    • MaxCoverDominance

      public MaxCoverDominance()
  • Method Details

    • getKey

      public Integer getKey(MaxCoverState state)
      Returns the dominance key associated with a state.

      All states share the same key (0), which indicates that dominance comparisons are allowed between any pair of states.

      Specified by:
      getKey in interface Dominance<MaxCoverState>
      Parameters:
      state - the state for which the key is requested
      Returns:
      the dominance key (always 0)
    • isDominatedOrEqual

      public boolean isDominatedOrEqual(MaxCoverState state1, MaxCoverState state2)
      Determines whether state1 is dominated by or equal to state2.

      A state state1 is considered dominated by state2 if the set of items covered by state1 is a subset of the set of items covered by state2. Equality is included as a special case.

      Specified by:
      isDominatedOrEqual in interface Dominance<MaxCoverState>
      Parameters:
      state1 - the potentially dominated state
      state2 - the dominating state
      Returns:
      true if state1 is dominated by or equal to state2, false otherwise