I am implementing the unit clause propagation algorithm into c++. I have read in the CNF file to a vector with each clause in individual element of a vector, so for example
1 2 0
1 2 3 0
1 0
3 4 0
So far I am able to isolate individual elements and set them as a string, so in this example i would set the string to be "1".
The next step would be to remove all elements in the vector which contain a 1, so in this example the 1st, 2nd and 3rd elements would be removed. However when i run the vector remove command
clauses.erase(std::remove(clauses.begin(), clauses.end(), "1"), clauses.end());
It will only remove elements which are exactly "1", not the elements which contain a 1 as well as other characters. Is there anyway to remove any element of a vector which contains the string?
(I hope this makes sense, thank you for your time)