dwavebinarycsp.io.cnf.load_cnf#

load_cnf(fp)[source]#

Load a constraint satisfaction problem from a .cnf file.

Parameters:

fp (file, optional) – .write()-supporting file object DIMACS CNF formatted file.

Returns:

ConstraintSatisfactionProblem a binary-valued SAT problem.

Examples

>>> import dwavebinarycsp as dbcsp
...
>>> with open('test.cnf', 'r') as fp: 
...     csp = dbcsp.cnf.load_cnf(fp)