I\'m looking for an algorithm to \"invert\" (reverse? turn inside-out?) a DAG:
A* # I can\'t ascii-art the arrows, so just / \\ # pretend
Just do a depth-first search marking where you have already been, and each time you traverse an arrow you add the reverse to your result DAG. Add the leaves as roots.