Module logicng

Class QuineMcCluskeyAlgorithm


  • public class QuineMcCluskeyAlgorithm
    extends Object
    An implementation of the Quine-McCluskey algorithm for minimizing canonical DNFs. This implementation is fairly efficient but keep in mind that Quine-McCluskey can be a very expensive procedure for large canonical DNFs. So we would not recommend using this implementation for super large DNFs.
    Since:
    1.4.0
    Version:
    2.0.0
    • Constructor Detail

      • QuineMcCluskeyAlgorithm

        public QuineMcCluskeyAlgorithm()
    • Method Detail

      • compute

        public static Formula compute​(Formula formula,
                                      Collection<Variable> relevantVariables)
        Computes a minimized DNF for a given formula projected to a given set of variables. First a projected canonical DNF of the formula is computed for the given variables. Then for this canonical DNF the Quine-McCluskey algorithm is computed.
        Parameters:
        formula - the formula
        relevantVariables - the relevant formulas for the projected canonical DNF
        Returns:
        the minimized DNF due to Qune-McCluskey
      • compute

        public static Formula compute​(Formula formula)
        Computes a minimized DNF for a given formula. First the canonical DNF of the formula is computed. Then for this canonical DNF the Quine-McCluskey algorithm is computed.
        Parameters:
        formula - the formula
        Returns:
        the minimized DNF due to Quine-McCluskey