 GraphIntersection - Maple Help

GraphTheory

 GraphIntersection
 compute graph intersection of graphs Calling Sequence GraphIntersection(G1,...,Gs) Parameters

 G1,...,Gs - graphs Description

 • The GraphIntersection function returns a graph G which is the intersection of the graphs G1,...,Gs, such that

$\mathrm{Vertices}\left(G\right)=\mathrm{Vertices}\left(\mathrm{G1}\right)\cup \cdots \cup \mathrm{Vertices}\left(\mathrm{Gs}\right)$

$\mathrm{Edges}\left(G\right)=\mathrm{Edges}\left(\mathrm{G1}\right)\cap \cdots \cap \mathrm{Edges}\left(\mathrm{Gs}\right)$

 • 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. Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{G1}≔\mathrm{Graph}\left(5,\left\{\left\{1,2\right\},\left\{1,3\right\},\left\{1,4\right\},\left\{1,5\right\}\right\}\right)$
 ${\mathrm{G1}}{≔}{\mathrm{Graph 1: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (1)
 > $\mathrm{G2}≔\mathrm{Graph}\left(5,\left\{\left\{1,2\right\},\left\{1,3\right\},\left\{1,4\right\},\left\{1,5\right\},\left\{2,3\right\},\left\{3,4\right\},\left\{4,5\right\},\left\{5,2\right\}\right\}\right)$
 ${\mathrm{G2}}{≔}{\mathrm{Graph 2: an undirected graph with 5 vertices and 8 edge\left(s\right)}}$ (2)
 > $\mathrm{DrawGraph}\left(\mathrm{G1}\right)$ > $\mathrm{DrawGraph}\left(\mathrm{G2}\right)$ > $\mathrm{DrawGraph}\left(\mathrm{GraphIntersection}\left(\mathrm{G1},\mathrm{G2}\right)\right)$  Compatibility

 • The GraphTheory[GraphIntersection] command was introduced in Maple 2018.