In graph theory, the Cartesian product G H of graphs G and H is a graph such that
Cartesian product graphs can be recognized efficiently, in linear time. The operation is commutative as an operation on isomorphism classes of graphs, and more strongly the graphs G H and H G are naturally isomorphic, but it is not commutative as an operation on labeled graphs. The operation is also associative, as the graphs (F G) H and F (G H) are naturally isomorphic.