neighbors(v) {
    var preds = this.predecessors(v);
    if (preds) {
      const union = new Set(preds);
      for (var succ of this.successors(v)) {
        union.add(succ);
      }

      return Array.from(union.values());
    }
  }
Return all nodes that are predecessors or successors of the specified node or undefined if
node v is not in the graph.
Complexity: O(|V|).