java,algorithm,graph,cycle,cycle-detection

Tarjan's algorithm does not find all cycles. It finds all strongly connected components, which is not the same thing. It is not possible to find all cycles efficiently in the general case(for a full graph the size of the output is exponential. Moreover, just finding the longest cycle is already...