code: function leaveEdge(tree) {
    var edges = tree.edges();
    for (var n in edges) {
      var e = edges[n];
      var treeValue = tree.edge(e);
      if (treeValue.cutValue < 0) {
        return e;
      }
    }
    return null;
  }
docs: /*
  Return an edge from the tree with a negative cut value, or null if there
  is none.