GraphTheory
CartesianProduct
compute Cartesian product of graphs
TensorProduct
compute tensor product of graph
ConormalProduct
compute conormal product of graphs
LexicographicProduct
compute lexicographic product of graphs
ModularProduct
compute modular product of graph
StrongProduct
compute strong product of graphs
Calling Sequence
Parameters
Description
Definitions
Examples
Compatibility
CartesianProduct(G1, G2, ...)
TensorProduct(G1, G2, ...)
ConormalProduct(G1, G2, ...)
LexicographicProduct(G1, G2, ...)
ModularProduct(G1, G2, ...)
StrongProduct(G1, G2, ...)
G1, G2, ...
-
graphs
CartesianProduct accepts a sequence of graphs as its arguments and returns the Cartesian product of those graphs.
TensorProduct accepts a sequence of graphs as its arguments and returns the tensor product of those graphs.
ConormalProduct accepts a sequence of graphs as its arguments and returns the Cartesian product of those graphs.
LexicographicProduct accepts a sequence of graphs as its arguments and returns the lexicographic product of those graphs.
ModularProduct accepts a sequence of graphs as its arguments and returns the modular product of those graphs.
StrongProduct accepts a sequence of graphs as its arguments and returns the strong product of those graphs.
Let G and H be undirected graphs.
Define V to be the set of pairs u:v with u a vertex in G and v a vertex in H.
The Cartesian product of G and H is the graph with vertex set V and edges defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1 is adjacent to u2 and v1 = v2, or u1 = u2 and v1 is adjacent to v2.
The tensor product of G and H is the graph with vertex set V and defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1 is adjacent to u2 in G1 and v1 is adjacent to v2 in G2.
The conormal product of G and H is the graph with vertex set V and defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1 is adjacent to u2 in G1 or v1 is adjacent to v2 in G2.
The lexicographic product of G and H is the graph with vertex set V and defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1 is adjacent to u2, or u1=u2 and v1 is adjacent to v2.
The modular product of G and H is the graph with vertex set V and defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1 is adjacent to u2 in G1 and v1 is adjacent to v2 in G2, or u1 is not adjacent to u2 in G1 and v1 is not adjacent to v2 in G2.
The strong product of G and H is the graph with vertex set V and defined by this rule: for u1,u2 vertices in G and v1,v2 vertices in H, there is an edge from u1:v1 to u2:v2 if and only if u1=u2 and v1 is adjacent to v2, or if u1 is adjacent to u2 and v1=v2, or if u1 is adjacent to u2 and v1 is adjacent to v2.
with⁡GraphTheory:
G≔Graph⁡0,1
G≔Graph 1: an undirected graph with 2 vertices and 1 edge(s)
H≔CartesianProduct⁡G,G
H≔Graph 2: an undirected graph with 4 vertices and 4 edge(s)
Vertices⁡H
0:0,0:1,1:0,1:1
Edges⁡H
0:0,0:1,0:0,1:0,0:1,1:1,1:0,1:1
with⁡StringTools:
with⁡SpecialGraphs:
H≔CartesianProduct⁡G,G,G
H≔Graph 3: an undirected graph with 8 vertices and 12 edge(s)
V≔map⁡v↦Select⁡IsBinaryDigit,v,sort⁡Vertices⁡H
V≔000,001,010,011,100,101,110,111
Q≔RelabelVertices⁡H,V
Q≔Graph 4: an undirected graph with 8 vertices and 12 edge(s)
evalb⁡Edges⁡Q=Edges⁡HypercubeGraph⁡3
true
T≔TensorProduct⁡G,G
T≔Graph 5: an undirected graph with 4 vertices and 2 edge(s)
Vertices⁡T
Edges⁡T
0:0,1:1,0:1,1:0
G1≔PathGraph⁡2
G1≔Graph 6: an undirected graph with 2 vertices and 1 edge(s)
G2≔Graph⁡4,Trail⁡1,2,3,4,1,2,4:
ConormalProduct⁡G,G
Graph 7: an undirected graph with 4 vertices and 6 edge(s)
LG1≔GraphTheory:-LexicographicProduct⁡G1,G2
LG1≔Graph 8: an undirected graph with 8 vertices and 26 edge(s)
Edges⁡LG1
1:1,1:2,1:1,1:4,1:1,2:1,1:1,2:2,1:1,2:3,1:1,2:4,1:2,1:3,1:2,1:4,1:2,2:1,1:2,2:2,1:2,2:3,1:2,2:4,1:3,1:4,1:3,2:1,1:3,2:2,1:3,2:3,1:3,2:4,1:4,2:1,1:4,2:2,1:4,2:3,1:4,2:4,2:1,2:2,2:1,2:4,2:2,2:3,2:2,2:4,2:3,2:4
LG2≔GraphTheory:-LexicographicProduct⁡G2,G1
LG2≔Graph 9: an undirected graph with 8 vertices and 24 edge(s)
Edges⁡LG2
1:1,1:2,1:1,2:1,1:1,2:2,1:1,4:1,1:1,4:2,1:2,2:1,1:2,2:2,1:2,4:1,1:2,4:2,2:1,2:2,2:1,3:1,2:1,3:2,2:1,4:1,2:1,4:2,2:2,3:1,2:2,3:2,2:2,4:1,2:2,4:2,3:1,3:2,3:1,4:1,3:1,4:2,3:2,4:1,3:2,4:2,4:1,4:2
T≔ModularProduct⁡G,G
T≔Graph 10: an undirected graph with 4 vertices and 2 edge(s)
H≔StrongProduct⁡G,G
H≔Graph 11: an undirected graph with 4 vertices and 6 edge(s)
0:0,0:1,0:0,1:0,0:0,1:1,0:1,1:0,0:1,1:1,1:0,1:1
The GraphTheory[ConormalProduct], GraphTheory[LexicographicProduct], GraphTheory[ModularProduct] and GraphTheory[StrongProduct] commands were introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
DisjointUnion
GraphJoin
GraphUnion
Download Help Document