An Efficient Algorithm to Recognize Prime Undirected Graphs

A graph is said to be prime if it has no non-trivial substitution decomposition, or module. This paper introduces a simple but efficient (O(n + m ln n)) algorithm to test the primality of undirected graphs. The fastest previous algorithm is due to Muller and Spinrad [MS89] and requires quadratic time. Our approach can be seen as a common generalization of Spinrad's work on P4-tree structure and substitution decomposition [Spi89] and Ille's one about the structure of prime graphs [Ill90] (see also Schmerl and Trotter [ST91] which contains similar results).