Source: https://bioinfo.mnhn.fr/abiens/mv448/doc/TD_GraphPy.pdf