The problem is as the title suggests, the graph is given in Adjacency List Form. My approach is to call DFS in any one vertex and whenever I hit a visited vertex during my DFS recursive step I increment the counter of a global variable starting from 0 and do not call DFS for that visited vertex (as we do in general). Is this going to work, am I thinking right ? I haven't found any relevant article in the internet as well to learn about #Number of cycles in undirected graph.
Elaboration: I mean to use a simple DFS method. While we do nothing in the recursive step in encountering a visited vertex, I increase the counter
global variable value for that situation. I do this, since whenever I am encountering a visited vertex, implies I am completing a cycle. I claim that : every cycle in the graph is encountered only once (atleast and atmost once) in any DFS run. AM I CORRECT IN THIS CLAIM ?
Edit: No back edges