union method
Returns the union of this graph and other
. This is a graph with the
nodes and edges present in either of the two graphs. edgeMerge
specifies
how parallel edges are merged, if unspecified the last one is used.
Implementation
Graph<V, E> union(Graph<V, E> other,
{E Function(V source, V target, E a, E b)? edgeMerge}) {
final result = copy(empty: true);
unionAll<V, E>(result, [this, other], edgeMerge: edgeMerge);
return result;
}