- java.lang.Object
-
- org.logicng.graphs.generators.HypergraphGenerator
-
public final class HypergraphGenerator extends Object
A generator for hypergraphs from formulas.- Since:
- 1.4.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description HypergraphGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Hypergraph<Variable>fromCNF(List<Formula> cnf)Generates a hypergraph from a CNF given as a list of clauses.static Hypergraph<Variable>fromCNF(Formula cnf)Generates a hypergraph from a CNF.static Hypergraph<Variable>fromCNF(Formula... cnf)Generates a hypergraph from a CNF given as a list of clauses.
-
-
-
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
-
-