https://codeanddebug.in/blog/detect-cycle-in-an-undirected-graph-using-bfs/