When I do a BFS, I can check if the graph has cycles and I can count them. The algorithm explained here "https://www.youtube.com/watch?v=vXrv3kruvwE" is very strong ! I solved an algorithm problem with this