The problem is coNP-Complete, so there is no efficient algorithm to solve it.
I will show that 3SAT can be reduced to the complement of this problem (checking if the union of all Si is not equal to S).
Consider the 3SAT problem with variables a, b, ..., k and Boolean formula
f = c1 ∧ c2 ∧ ... ∧ cn
where
ci = xi,1 ∨ xi,2 ∨ xi,3
and xi,j is a literal (either a variable or the negation of a variable).
Set A = B = C = ... = K = { true, false }.
Set Ai to
- { false } if ci contains the variable a
- { true } if ci contains the negation of variable a
- { true, false } if ci does not mention a
and similarly for Bi through Ki for all 1 ≤ i ≤ n.
Any tuple (a, b, ..., k) ∈ Si = Ai ⨯ Bi ⨯ ... ⨯ Ki will not satisfy ci since all the literals in ci will be negated.
Consider the tuples (a, b, ..., k) ∈ S1 ⋃ S2 ⋃ ... ⋃ Sn. These tuples belong to at least one Si so they will not satisfy ci and therefore fail to satisfy f.
If S1 ⋃ S2 ⋃ ... ⋃ Sn is equal to S = A ⨯ B ⨯ ... ⨯ K, all the tuples fail to satisfy f and so f is unsatisfiable. It can be similarly shown that if the union is not equal to S there exists a tuple which satisfies f.
So 3SAT can be reduced to the complement of the original problem. But the complement of the original problem is in NP, because testing if a given tuple is not in the union can be done in polynomial time. So the complement of the original problem is NP-Complete, and the original problem itself is coNP-Complete.