added parallel edge and self loop detection in DirectedCycle