0

Let's say i have this problem and wanted to solve it using dimacs and maxsat solvers

There's 10 police patrols and i want solver to pick the best police patrol to go to intervention, each patrol is described by 3 variables (status, distance, districts) so there will be 3 group of clauses

for example first patrol will be PP1 = x1,x11,x21, PP2 = x2,x12,x22 PP3 = x3,x13,x23 .. PP10 = x10,x20,x30

group 1 describing police patrol status, (300 means weight)

300 C1 - (x1 v x2 v x3)
50 C2 - (x4 v x5)
10 C3 - (x6 v x7 v x8 v x9 v x10)

C1 means their status is the best and C3 means it's the worst

group 2 describing police patrol distance to some incident or crime happening

300 C4 -  (x11 v x12 v x13)
50 C5 - (x14 v x15)
10 C6 - (x16 v x17 v x18 v x19 v x20 )

C4 means they are the closest to incident, in C6 they are farthest

group 3 describing in what district they are

300 C7 - (x21 v x22 v x23)
50 C8 - (x24 v x25)
10 C9 - (x26 v x27 v x28 v x29 v x30)

C7 will be the safest etc.

So this is my wcnf file in dimacs, i don't know if it's good but will be pleased if you correct me what's wrong with it

p wcnf 30 9
300 1 2 3 0
50 4 5 0
10 6 7 8 9 10 0
300 20 11 14 0
50 15 16 17 0
10 12 13 18 19 0
300 29 21 27 0
50 22 23 24 25 0
10 26 28 30 0

I tested it in 2 solvers, rc2 maxsat solver and EvalMaxSAT and output was like this:

EvalMaxSAT
s OPTIMUM FOUND
o 0
v -1 2 -3 4 -5 6 -7 -8 -9 -10 11 12 -13 -14 15 -16 -17 -18 -19 -20 21 22 -23 -24 -25 26 -27 -28 -29 -30
c Total time: 335 µs
-

rc2
c formula: 30 vars, 0 hard, 9 soft
s OPTIMUM FOUND
o 0
v 1 -2 -3 4 -5 6 -7 -8 -9 -10 11 12 -13 -14 15 -16 -17 -18 -19 -20 21 22 -23 -24 -25 26 -27 -28 -29 -30

but looking at my wcnf file, I think ideal output should get values 1,11,21 as true because they are in the clauses with highest weight

0 Answers0