3.1.13. cnfgen.families.tseitin module

Implementation of Tseitin formulas

TseitinFormula(G, charges=None)

Build a Tseitin formula based on the input graph.

By default, an odd charge is put on the first vertex, unless another pattern of charges are specified. The pattern is specified via a sequence of boolean values in the charges variable (True means odd). If the sequence is shorter than the sequence of vertices, it is padded with Falses. If it is longer, excessive values will be ignored. Any non-boolean value in charges is interpreted as boolean via bool cast.

Parameters:
G : cnfgen.Graph or networkx.Graph
charges: a sequence of boolean