initial checkin
tarjan cycle detection and filtering of graphs