https://www.geeksforgeeks.org/detect-cycle-undirected-graph/