Quine–McCluskey algorithm (or the method of prime implicants) is a method used for minimization of boolean functions. Right now, it gives only a single answer if there should be more than one. Soon improving.