Update cycles.py

Speeding up simple_cycles (issue 604 / trac 613)