#16924: Read DIMACS files
-------------------------------------+-------------------------------------
Reporter: malb | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: interfaces: | Resolution:
optional | Merged in:
Keywords: | Reviewers: Martin Albrecht
Authors: Travis Scholl | Work issues:
Report Upstream: N/A | Commit:
Branch: | 34d8f00f1175b40bb7274934d217261eab2025e0
u/tscholl2/read_dimacs_16924 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by tscholl2):
Sorry it took me a while, I'm at a Sage days working on other things. But
I asked people here and got directed to a SAT solver competition website
[http://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html].
I copied their rules here
- The file can start with comments, that is lines begining with the
character c.
- Right after the comments, there is the line p cnf nbvar nbclauses
indicating that the instance is in CNF format; nbvar is the exact number
of variables appearing in the file; nbclauses is the exact number of
clauses contained in the file.
- Then the clauses follow. Each clause is a sequence of distinct non-
null numbers between -nbvar and nbvar ending with 0 on the same line; it
cannot contain the opposite literals i and -i simultaneously. Positive
numbers denote the corresponding variables. Negative numbers denote the
negations of the corresponding variables.
The clause about "ending with 0 on the same line" means they don't allow
the multi-line clauses. So it sounds like the definition of "DIMACS
standards" depends on who you ask.
I will modify the docstring to clearly describe the variation it assumes
the file is in.
Should I post links to these pages describing different rules for DIMACS
files in the docstring as well?
--
Ticket URL: <http://trac.sagemath.org/ticket/16924#comment:26>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.