A reasonably efficient procedure for testing pairs of directed graphs for isomorphism is important in information retrieval and other application fields in which structured data have to be matched. One such procedure, a backtrack procedure based on a representation of directed graphs by linear formulas, is described. A procedure for finding a partial subdigraph of a digraph that is isomorphic to a given digraph is also described.KEY WORDS AND PHRASES: backtrack programming, digraph isomorphism, representation of digraphs CR CATEGOnI~S: 5.32
DefinitionsA directed graph or digraph is the ordered pair D = (A, P}, where A is a set and P is a relation in A. We shall assume that A is finite, and put A = {aj, a2, • • •, a~}. Members of A are cMled nodes; members of P are arcs of the digraph. Arc (a~, aj} is said to originate from node a~ and to terminate at node ai. An are (ai, al} is called a sling. Digraph Dis completely specified by its adjace~cy matrix X, which is a square matrix of order n, defined as follows: xlj = 1 if ~al,as} E P, x~i= 0 if (at,as} ¢~ P.A digraph is total if every element of its adjacency matrix is 1.In digraph (A, P}, if certain members of P can be placed in a sequence (al, as}, (as, ak}, • • • , (as, at}, in which the first coordinate of each ordered pair is equal to the second coordinate of its predecessor in the sequence, then at is reachable from a~, and the set of arcs in the sequence is a path from a~ to at. Write the path as a node sequence (a~, as, ak, • .. , as, at). If this node sequence contains every node of the digraph exactly once, then the path is Hamiltonian; addition of arc tat, a~} to the Hamiltonian path gives a Hamiltonian cycle. We assume that every node is reachable from itself. If no arc originates from or terminates at a~, then a~ is an isolated node. The smallest set of nodes from which all nodes of a digraph are reachable is a node base of the digraph. A node base need not be unique, but all node bases of the one digraph contain the same number of nodes.If D = (A, P} is a digraph, and B is a subset of A, then D' = (B, (B X B) A P} is a subdigraph of D. If Q is a subset of P, .then D" = (A, Q} is a partial digraph of D.The concept of a partial subdigraph is an obvious extension.Two digraphs are isomorphic if some permutation of the rows and corresponding