We present a polynomial-time algorithm for deciding whether a given connected graph is a non-trivial Cartesian product. The method entails first representing the graph as an isometric subgraph of a Cartesian product of graphs, then finding a suitable partition of the factors. The Cartesian product G x H of graphs G and H has as vertices the pairs (g, h) with g a vertex of G and h a vertex of H; (gl, hI) is connected by an edge to (g2' h 2 ) in G x H just when {gl' g2} is an edge of G and hI = h2' or when g, = g2 and {h" h 2 } is an edge of H. The Cartesian product admits unique factorization (Sabidussi [4]) but until recently no efficient algorithm was known for producing such a factorization. If unconnected graphs are permitted then the factorization problem is at least as difficult as 'graph isomorphism'; for, one could determine whether two connected graphs G and H are isomorphic by deciding whether a graph with two vertices and no edge is a factor of the disjoint union of G and H. The question of whether there is a polynomial algorithm for deciding if a connected graph is a non-trivial Cartesian product--equivalently, for finding its unique factorization-was posed by Welsh
A different polyonimial-time algorithm for connected graphs has been independently discovered by Winkler REF .
Factoring a Graph in Polynomial Time
Eur. J. Comb.
Eur. J. Comb.
Mathematics Computer Science