edge detection now uses graph cycles