Module logicng

Class HypergraphGenerator


  • public final class HypergraphGenerator
    extends Object
    A generator for hypergraphs from formulas.
    Since:
    1.4.0
    Version:
    2.0.0
    • Constructor Detail

      • HypergraphGenerator

        public HypergraphGenerator()
    • Method Detail

      • fromCNF

        public static Hypergraph<Variable> fromCNF​(Formula... cnf)
        Generates a hypergraph from a CNF given as a list of clauses. Each variable is represented by a node in the hypergraph, each clause is represented by a hyperedge between all variables of the clause.
        Parameters:
        cnf - the list of clauses of the CNF for the hypergraph
        Returns:
        the hypergraph for the CNF formula
      • fromCNF

        public static Hypergraph<Variable> fromCNF​(List<Formula> cnf)
        Generates a hypergraph from a CNF given as a list of clauses. Each variable is represented by a node in the hypergraph, each clause is represented by a hyperedge between all variables of the clause.
        Parameters:
        cnf - the list of clauses of the CNF for the hypergraph
        Returns:
        the hypergraph for the CNF formula
      • fromCNF

        public static Hypergraph<Variable> fromCNF​(Formula cnf)
        Generates a hypergraph from a CNF. Each variable is represented by a node in the hypergraph, each clause is represented by a hyperedge between all variables of the clause.
        Parameters:
        cnf - the CNF formula for the hypergraph
        Returns:
        the hypergraph for the CNF formula