Class MispDominance

java.lang.Object
org.ddolib.examples.layered.misp.MispDominance
All Implemented Interfaces:
Dominance<BitSet>

public class MispDominance extends Object implements Dominance<BitSet>
Implementation of a dominance relation for the Maximum Independent Set Problem (MISP).

In this context, one state state1 is considered dominated by another state state2 if all vertices selected in state1 are also selected in state2. This allows pruning suboptimal states during the search.

  • Constructor Details

    • MispDominance

      public MispDominance()
      Creates a new instance of this dominance rule.
  • Method Details

    • getKey

      public Integer getKey(BitSet state)
      Returns a key for the dominance relation.

      This implementation always returns 0: all the states of a layer share the same key. A key groups the states that can be compared, and must thus be equal for a state and the states dominating it. With a dominance by inclusion, such states do not share any property that could be used as key (neither the set of vertices nor its size), so that a single group is needed.

      This has a cost: with a SimpleDominanceChecker, each new state is compared with all the non-dominated states of its layer, i.e. a number of comparisons quadratic in the number of states of a layer, each comparison taking a time linear in the number of vertices. MispDominanceChecker reduces this cost by grouping the states by their number of remaining vertices.

      Specified by:
      getKey in interface Dominance<BitSet>
      Parameters:
      state - the current state
      Returns:
      a key for the dominance relation, always 0
    • isDominatedOrEqual

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

      A state state1 is dominated by state2 if all vertices selected in state1 are also selected in state2.

      Specified by:
      isDominatedOrEqual in interface Dominance<BitSet>
      Parameters:
      state1 - the first state to compare
      state2 - the second state to compare
      Returns:
      true if state1 is dominated by or equal to state2, false otherwise