Source: https://perso.esiee.fr/~talboth/ESIEE/IF4-ALG2/pdf/poly_optim_2009.pdf