/*
Given a graph that has had the acyclic operation applied, this function
undoes that operation. More specifically, any edge with the `reversed`
attribute is again reversed to restore the original direction of the edge.
function undo(g) {
  g.eachEdge(function(e, s, t, a) {
    if (a.reversed) {
      delete a.reversed;
      g.delEdge(e);
      g.addEdge(e, t, s, a);
    }
  });
}