Solver algorithm in #3 Paper: Diversified Top-K MaxSAT Solving with MaxSAT.
/home/zhoujp/liangll/PM_Coding
g++ -std=c++11 PM-Coding.cpp -o PM-Coding
./PM-Coding XXX.XXX K 1
XXX.XXX
: input fileK
: number of extended variables1
: the firstvertex sorting method
, currently tentatively1
- V2.wcnf
- K = 3
p wcnf 4 5 20
20 1 3 0
20 -2 -3 -4 0
1 -1 2 0
1 -2 0
1 -3 0
./PM-Coding V2.wcnf 3 1
-
Extended Variables
X11 X12 X13 1 2 3 X21 X22 X23 4 5 6 X31 X32 X33 7 8 9 X41 X42 X43 10 11 12
-
Hard Clause
X11 ∨ X31 1 7 X12 ∨ X32 2 8 X13 ∨ X33 3 9 ㄱX21 ∨ ㄱX31 ∨ ㄱX41 -4 -7 -10 ㄱX22 ∨ ㄱX32 ∨ ㄱX42 -5 -8 -11 ㄱX23 ∨ ㄱX33 ∨ ㄱX43 -6 -9 -12
-
Soft Clause
ㄱX11 ∨ ㄱX12 ∨ ㄱX13 ∨ X21 ∨ X22 ∨ X23 -1 -2 -3 4 5 6 ㄱX21 ∨ ㄱX22 ∨ ㄱX23 -4 -5 -6 ㄱX31 ∨ ㄱX32 ∨ ㄱX33 -7 -8 -9
-
{3, 1, 2, 4}
-
X31 X32 X33 X11 X12 X13 X21 X22 X23 X41 X42 X43
-
X32 = X33 = X13 = 0
-
Renumber the Extension Variable
X11 X12 1 2 X21 X22 X23 3 4 5 X31 6 X41 X42 X43 7 8 9
-
Hard Clause
X11 ∨ X31 1 6 X12 2 ㄱX21 ∨ ㄱX31 ∨ ㄱX41 -3 -6 -7
-
Soft Clause
ㄱX11 ∨ ㄱX12 ∨ X21 ∨ X22 ∨ X23 -1 -2 3 4 5 ㄱX21 ∨ ㄱX22 ∨ ㄱX23 -3 -4 -5 ㄱX31 -6
p wcnf 7 6 20
1 -1 -2 3 4 5 0
1 -3 -4 -5 0
1 -6 0
20 1 6 0
20 2 0
20 -3 -6 -7 0