Two-SAT
-
class TwoSat
Public Functions
-
inline TwoSat(const int variableCount)
-
inline int negation(const int x) const
Returns the negation of a variable.
-
inline int neg(const int x) const
Alias for negation.
-
inline void addConstraint(const int x, const int y)
Add the constraint (x v y)
-
inline void addConstraint(const int x)
Add the constraint (x)
-
inline bool solve()
Tries to solve the 2-SAT instance, and returns if a solution exists.
-
inline bool isTrue(const int x) const
If a solution exists, returns a possible value for the variable (the solve function must have been called beforehand).
-
inline TwoSat(const int variableCount)