add graph features util, check if cyclic