patternModerate
Is generalized XOR-SAT efficiently solvable?
Viewed 0 times
generalizedxorefficientlysatsolvable
Problem
I've seen how XOR-3-SAT is efficiently solvable (for instance, see the "XOR-satisfiability" section in the Wikipedia entry for Boolean satisfiability problem).
I'm wondering a basic question: Is XOR-k-SAT efficiently solvable, for formulas with varying amounts of literals per clause?
I'd really like to know if we can increase the amounts of literals per clause beyond 3, and if we can have mixed clause lengths.
I'm wondering a basic question: Is XOR-k-SAT efficiently solvable, for formulas with varying amounts of literals per clause?
I'd really like to know if we can increase the amounts of literals per clause beyond 3, and if we can have mixed clause lengths.
Solution
It looks like the Wikipedia article you linked to says that XORSAT (not just 3-XORSAT) is in P. The method by which they are solving that 3-XORSAT formula in their example very easily generalizes to formulas in which the clauses can have arbitrarily large numbers of variables and differing numbers of variables.
You just look at the formula as a system of linear equations where you have an equation for each clause, and a variable for each variable. For example, the formula:
$$(x_1\oplus x_2\oplus\lnot x_3\oplus x_5)\land (x_2\oplus x_3)$$
has a satisfying assignment if and only if the following system of equations has a solution:
$$x_1+x_2+(1+x_3)+x_5\equiv 1 \mod 2$$
$$x_2+x_3\equiv 1 \mod 2$$
And we can find solutions to linear systems of equations like these in polynomial time using Gaussian elimination!
You just look at the formula as a system of linear equations where you have an equation for each clause, and a variable for each variable. For example, the formula:
$$(x_1\oplus x_2\oplus\lnot x_3\oplus x_5)\land (x_2\oplus x_3)$$
has a satisfying assignment if and only if the following system of equations has a solution:
$$x_1+x_2+(1+x_3)+x_5\equiv 1 \mod 2$$
$$x_2+x_3\equiv 1 \mod 2$$
And we can find solutions to linear systems of equations like these in polynomial time using Gaussian elimination!
Context
StackExchange Computer Science Q#41334, answer score: 15
Revisions (0)
No revisions yet.