 Any directed graph may be made into a DAG by removing a feedback vertex set or a feedback arc set , a set of vertices or edges ( respectively ) that touches all cycles . However , the smallest such set is NP @-@ hard to find . An arbitrary directed graph may also be transformed into a DAG , called its condensation , by contracting each of its strongly connected components into a single <unk> . When the graph is already acyclic , its smallest feedback vertex sets and feedback arc sets are empty , and its condensation is the graph itself . 
