Fixed up some bugs in the graph generation (although as it happened, it was a case of two wrongs making a right - was still getting DAGs but for the wrong reasons). Also fixed a bug in the graph rooting so that the dependency chains in a generated DAG aren't forced to have the vertex ids in ascending order.