dagify: correctly calculate distance back to graph root
dagify: correctly calculate distance back to graph root

This was a major bug that would have generated extremely large graphs during
alignment to cyclic graphs. I suspect it was causing problems for me in
alignment tests, but that needs to be checked.

ekg/vg,ekg/vg,ekg/vg