Class MD

  • All Implemented Interfaces:
    F
    Direct Known Subclasses:
    MDRk

    public class MD
    extends Object
    implements F
    Min Degree heuristic
    Since:
    01/01/2014
    Author:
    Jean-Guillaume Fages
    • Field Detail

      • n

        protected int n
      • inMIS

        protected BitSet inMIS
      • nbNeighbours

        protected int[] nbNeighbours
      • fifo

        protected int[] fifo
    • Constructor Detail

      • MD

        public MD​(UndirectedGraph graph)
        Creates an instance of the Min Degree heuristic to compute independent sets on graph
        Parameters:
        graph - the graph
    • Method Detail

      • prepare

        public void prepare()
        Description copied from interface: F
        Potentially performs some calculation before computing independent sets
        Specified by:
        prepare in interface F
      • computeMIS

        public void computeMIS()
        Description copied from interface: F
        Computes an Independent Set as large as possible, although it is not necessarily maximum
        Specified by:
        computeMIS in interface F
      • addToMIS

        protected void addToMIS​(int node)
      • getMIS

        public BitSet getMIS()
        Specified by:
        getMIS in interface F
        Returns:
        a BitSet representing vertices that belong to the independent set
      • hasNextMIS

        public boolean hasNextMIS()
        Specified by:
        hasNextMIS in interface F
        Returns:
        true iff the heuristic can compute another independent set