Can anyone tell how to divide nodes of a graph into cycles so that each node of the graph occurs in exactly one cycle. I have tried dfs but my solution is giving very large comp