A generalized hare and tortoise algorithm to detect each cycle in a directed graph. The code is written in python. The directed graph is created using Pydot. Each cycle is shown by coloring it's edges.