So right now I am working on using SAT to resolve the minimum vertex cover problem, and here is my encoding for the graph G = {V,E} has k vertex cover, and here are the clauses:
Let n = sizeof(V);
Firstly, at lease one vertex is in the vertex cover:
For i in {1..k}
Add clause (x<1,i> ∨ x<2,i> ∨ ··· ∨ x<n,i>);
Then, no one vertex can appear twice in vertex cover:
For j in {1..n}
For l and m in {1..k} with l < m
Add clause (¬x<j,l> ∨ ¬x<j,m>)
After that, only one vertex can appear at a specific position in vertex cover:
For j in {1..k}
For l and m in {1..n} with l < m
Add clause (¬x<l,j> ∨ ¬x<m,j>)
Finally, at least one vertex in vertex cover should come from edges:
For i and j in each edge e from E
Add clause (x<i,1> ∨ x<i,2> ∨ ... ∨ x<i,k> ∨ x<j,1> ∨ ... ∨ x<j,k>)
Now I am able to get the minimum vertex cover by using this encoding but the efficiency is pretty bad. I can only get a result for any graph with < 20 vertices, otherwise it will just take minutes and hours for getting me a result. I am now thinking to reduce it from SAT further more, maybe to 3SAT. But looks like that I cannot simply change all clause from nCNF to 3CNF for getting the same result. Could anyone please help me to figure out what should I do next? Do I need a brand new encoding?
Thank you so much.
BTW, I am using MiniSAT for the solver.