Source: https://perso.liris.cnrs.fr/amelie.cordier/teaching/algo/aut2015/IntroAlAlgo.pdf