Checking for optimal solutions in some NP-complete problems.