https://www.geeksforgeeks.org/detect-cycle-in-a-graph/