Tarjan’s Cycle Enumeration Algorithm – Python Implementation