.cnfc COMMENT_TEXT
p cnf VARS CONSTRAINTS
It is assumed that |k| is at most the value of VARS in the tag line and the number of constraints is at most CONSTRAINTS.
.cnfxThere are two differences from cnf format:
p cnfx VARS CONSTRAINTS
0 0..lpxThere are several fundamental differences between lpx and cnf, since the former needs to address general optimization problems.
-3x1 + 2x2 - x4
- 3 x1+2 x2 -x4
-- spaces don't matter.
\ COMMENT_TEXT. In
contrast to cnf format, these
comments can be anywhere in the file.
Min (since this is a minimization problem)
<, =, >, <=, >=
-- and a
numerical constant, for example
x1 - 3 x2 + x3 <= -1
Binary (since the variables are 0/1)
End
c A weighted set cover instance. c InstanceProfile: c nVars=8, nClauses=5 c nLitsPos=5 nLitsNeg=0 nLitsTot=5 ImbalanceOfLits=1 c c Variable weights - x1: 6, x2: 12, x3: 10, x4: 8 c x5: 5, x6: 7, x7: 3, x8: 3 p cnfx 8 5 1 6 2 12 3 10 4 8 5 5 6 7 7 3 8 3 0 0 1 2 4 7 0 1 2 3 5 8 0 2 3 4 6 0 5 7 0 6 8 0And the corresponding lpx format (created using an automatic conversion program):
\ File sample.lpx, created Wed Jun 06 02:16:47 UTC 2007 \ - created from covering/sat instance sample.cnfx \ A weighted set cover instance. \ InstanceProfile: \ nVars=8, nClauses=5 \ nLitsPos=5 nLitsNeg=0 nLitsTot=5 ImbalanceOfLits=1 \ \ Variable weights - x1: 6, x2: 12, x3: 10, x4: 8 \ x5: 5, x6: 7, x7: 3, x8: 3 \ 5 rows, 8 columns Min obj: +6 x1 +12 x2 +10 x3 +8 x4 +5 x5 +7 x6 +3 x7 +3 x8 st c1: +x1 +x2 +x4 +x7 >= 1 c2: +x1 +x2 +x3 +x5 +x8 >= 1 c3: +x2 +x3 +x4 +x6 >= 1 c4: +x5 +x7 >= 1 c5: +x6 +x8 >= 1 Binary x1 x2 x3 x4 x5 x6 x7 x8 End
http://people.engr.ncsu.edu/mfms
(
Matt_Stallmann AT ncsu.edu)
Last modified: Wed Jun 6 16:09:26 2007