Generalized Ramsey numbers through adiabatic quantum optimization