Cache the hash key.
Check for solvability before traversing graph.
Performance improvements.