GraphTheory
GraphIntersection
compute graph intersection of graphs
Calling Sequence
Parameters
Description
Examples
Compatibility
GraphIntersection(G1,...,Gs)
G1,...,Gs
-
graphs
The GraphIntersection function returns a graph G which is the intersection of the graphs G1,...,Gs, such that
Vertices⁡G=Vertices⁡G1∪⋯∪Vertices⁡Gs
Edges⁡G=Edges⁡G1∩⋯∩Edges⁡Gs
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 weighted graphs, the resulting graph is a weighted graph where the weight of any edge is the minimum of the weights of that edge in G1,...,Gs.
with⁡GraphTheory:
G1≔Graph⁡5,1,2,1,3,1,4,1,5
G1≔Graph 1: an undirected graph with 5 vertices and 4 edge(s)
G2≔Graph⁡5,1,2,1,3,1,4,1,5,2,3,2,5,3,4,4,5
G2≔Graph 2: an undirected graph with 5 vertices and 8 edge(s)
DrawGraph⁡G1
DrawGraph⁡G2
DrawGraph⁡GraphIntersection⁡G1,G2
The GraphTheory[GraphIntersection] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
DisjointUnion
GraphUnion
Download Help Document