Fix the configuration resolution algorithm.

The initial graph of the old algorithm contained edges to configurations that
couldn't themselves resolve all dependencies. These are now skipped, so that
only valid sub graphs exist. This avoids bogus "Could not resolve configuration
for package X" errors.