I think I found an useful example myself!
Perhaps I was a little vague, but I was looking for a problem that met the following specifications:
- The problem itself should be easy to explain to someone studying social sciences.
- It should have an obvious but ineffective algorithm.
- It should have a better algorithm that is also easy to explain to someone studying social sciences.
For Eulerian Cycle it's easy to explain that it's a necessary condition that every node must have even degree, but it isn't as easy to explain why it's a sufficient condition.
This is the problem that I think so far best meets the specification above:
FORM_TARGET_SET_WITH_UNIONS
Collection $C=\{S_1, S_2,...,S_n\}$ of sets
Target set $T$
Question: Is it possible to form target set $T$ by taking the union of some of the sets in $C$ ?
Obvious but ineffective algorithm:
- Form all $2^n$ possible unions
- See if one of them corresponds to $T$
Better algorithm
- Mark the sets in $C$ that are contained in $T$
- Form the union $S_{_\cup}$ of these sets
- If $|S_{_\cup}|=|T|$ answer $YES$, otherwise answer $NO$
There is also the sister problem
FORM_TARGET_SET_WITH_INTERSECTIONS
for which the better algorithm is
- Mark the sets in $C$ that contain $T$
- Form the intersection $S_{_\cap}$ of these sets
- If $|S_{_\cap}|=|T|$ answer $YES$, otherwise answer $NO$
As you can see I was looking for something really simple (almost as simple as SUBSET_PRODUCT_IS_ZERO).
The problem can also be contrasted with SUBSET SUM and SUBSET PRODUCT, which are NP-complete but similar in their formulation. In all these problems one is presented with a collection of objects and asked if an operation on a selection of these objects can produce a desired result.
I think 2-CNF SAT is a little too technical.
I know subset-product-is-zero is silly. That's why I'm asking for a better example. :)
– sixpanbass Mar 08 '13 at 19:55