I want to count total number of directed cycles available in a directed graph (Only count is required).
You can assume graph is given as adjacency matrix.
I know DFS
but could not make a working algorithm for this problem.
Please provide some pseudo code using DFS
.
num_cycles++
can be very very slow. – Tubing