Exception: The graph must be a DAG.
