There is no way to find an optimal const solution without trying every possible const solution. (IIRC what "NP Complete" is, might be "NP really stinking hard" I'm thinking of <G>)