Algorithm for computing girth

girth.py