The DAG class is actually not a DAG because it allows cycles. Rename to more general Graph.
The DAG class is actually not a DAG because it allows cycles. Rename to more general Graph.