|
Calling Sequence
|
|
GraphUnion(G1,...,Gs)
|
|
Parameters
|
|
|
|
Description
|
|
•
|
The GraphUnion function returns a graph G which is the union of the graphs G1,...,Gs, such that
|
•
|
Note that the graphs G1,...,Gs must all be directed or all undirected, and the resulting graph is directed or undirected, respectively. Likewise, the graphs G1,...,Gs must all be weighted or all unweighted, and the resulting graph is then weighted or unweighted, respectively.
|
•
|
Moreover, if G1,...,Gs are all weighted graphs, the resulting graph is a weighted graph where the weight of any common edge is the sum of the weights of that edge in G1,...,Gs.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
| (5) |
In this example, note that the vertices of G1 and G2 are permuted differently.
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
| (10) |
>
|
|
| (11) |
In this example, note that there is one common vertex between the two graphs
>
|
|
| (12) |
>
|
|
| (13) |
>
|
|
| (14) |
| (16) |
|
|
|