CartesianProduct - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

Calling Sequence

CartesianProduct(G1, G2, ...)

TensorProduct(G1, G2, ...)

ConormalProduct(G1, G2, ...)

LexicographicProduct(G1, G2, ...)

ModularProduct(G1, G2, ...)

StrongProduct(G1, G2, ...)

Parameters

G1, G2, ...

-

graphs

Description

• 

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.

Definitions

• 

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.

Examples

withGraphTheory:

GGraph0,1

GGraph 1: an undirected graph with 2 vertices and 1 edge(s)

(1)

HCartesianProductG,G

HGraph 2: an undirected graph with 4 vertices and 4 edge(s)

(2)

VerticesH

0:0,0:1,1:0,1:1

(3)

EdgesH

0:0,0:1,0:0,1:0,0:1,1:1,1:0,1:1

(4)

withStringTools:

withSpecialGraphs:

HCartesianProductG,G,G

HGraph 3: an undirected graph with 8 vertices and 12 edge(s)

(5)

VmapvSelectIsBinaryDigit,v,sortVerticesH

V000,001,010,011,100,101,110,111

(6)

QRelabelVerticesH,V

QGraph 4: an undirected graph with 8 vertices and 12 edge(s)

(7)

evalbEdgesQ=EdgesHypercubeGraph3

true

(8)

TTensorProductG,G

TGraph 5: an undirected graph with 4 vertices and 2 edge(s)

(9)

VerticesT

0:0,0:1,1:0,1:1

(10)

EdgesT

0:0,1:1,0:1,1:0

(11)

G1PathGraph2

G1Graph 6: an undirected graph with 2 vertices and 1 edge(s)

(12)

G2Graph4,Trail1,2,3,4,1,2,4:

ConormalProductG,G

Graph 7: an undirected graph with 4 vertices and 6 edge(s)

(13)

LG1GraphTheory:-LexicographicProductG1,G2

LG1Graph 8: an undirected graph with 8 vertices and 26 edge(s)

(14)

EdgesLG1

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

(15)

LG2GraphTheory:-LexicographicProductG2,G1

LG2Graph 9: an undirected graph with 8 vertices and 24 edge(s)

(16)

EdgesLG2

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

(17)

TModularProductG,G

TGraph 10: an undirected graph with 4 vertices and 2 edge(s)

(18)

VerticesT

0:0,0:1,1:0,1:1

(19)

EdgesT

0:0,1:1,0:1,1:0

(20)

HStrongProductG,G

HGraph 11: an undirected graph with 4 vertices and 6 edge(s)

(21)

VerticesH

0:0,0:1,1:0,1:1

(22)

EdgesH

0:0,0:1,0:0,1:0,0:0,1:1,0:1,1:0,0:1,1:1,1:0,1:1

(23)

Compatibility

• 

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