abstract graph processing, add cycle