Cycles recognition