On introduction to the theory of computation - 2nd edition by Michael Sipser, there's this question with the solution:
Question: "7.31: In the following solitaire game, you are given an m x m board. On each of the m² positions lies either a blue stone, a red stone, or nothing at all. You play by removing stones from the board so that each column contains only stones of a single color and each row contains at least one stone. You win if you achieve this objective. Winning may or may not be possible, depending upon the initial configuration. Let SOLITAIRE = {| is a winnable game configuration}. Prove that SOLITAIRE is NP-complete."
Solution:
" First, SOLITAIRE E NP because we can verify that a solution works, in polynomial time. Second, we show that 3SAT is reductible in polynomial time to SOLITAIRE. Given Phi with m variables x1, ..., xm and k clauses c1, ..., ck, construct the following k x m game G. We assume that Phi has no clauses that contain both xi and ¬xi, because such clauses may be removed without affecting satisfiability.
If xi is in clause cj, put a blue stone on the row cj, column xi. if ¬xi is in clause cj, put a red stone on the row cj, column xi. We can make the board square by repeating a row or adding a blank column as necessary without affecting solvability. We show that Phi is satisfiable iff G has a solution.
(->) Take a satisfying assignment. If xi is true (false), remove the red(blue), stones from the corresponding column. So, stones corresponding to true literals remain. Because every clause has a true literal, every row has a stone.
(<-) Take a game solution. If the red(blue) stones were removed from a column, set the corresponding variable true (false). Every row has a stone remaining, so every clause has a true literal. Therefore phi is satisfied."
Why is it reduced to 3-SAT instead of k-SAT? the board is m x m so every line is associated with a clause and there can be more or less than three stones (literals) on each line (clause). I see this way:
for instance m = 6:
x1 x2 x3 x4 x5 x6
|R |B |R | |R | | c1 = (¬x1 v x2 v ¬x3 v ¬x5)
|B |B |R |R | | | c2 = ( x1 v x2 v ¬x3 v ¬x4)
| |R | |B | | | c3 = (¬x2 v x4)
| | |R | |B | | c4 = (¬x3 v x5)
| |R | | | |B | c5 = (¬x2 v x6)
|R |B | |B |B |B | c6 = (¬x1 v x2 v x4 v x5 v x6)
I know that I can reduce 3-SAT to k-SAT by repeating a literal (eg. (x1 v x2) = (x1 v x2 v x1)) or by dividing a clause into two or more (eg. (x1 v x2 v x3 v x4 v x5) = (x1 v x2 v ¬s1) and (¬s2 v x3 v x4) and (s1 v s2 v x5)). Am I seeing this wrong?
Sorry for bad formatting, never really posted anything on forums.