We have to find out the minimum number of edges to be deleted in a directed graph to just remove the all cycles.enter image description here
For example:- in this graph, there are 3 cycles:
1) 0-1-2-0
2) 0-2-0
3) 3-3
There are two possible combinations to remove all the cycles:
1) Delete edges 2-0 and 3-3.
2) Delete edges 0-2, 1-2 and 3-3.
In first case we have to delete 2 edges and in second case, we have to delete 3 edges.
First combination is the solution.