2
INFORMATION PROCESSING LETTERS .kmuary 1976 SUBGRAPH ~O~O~HI~~, MATCHING RELATIONAL EfT’RWTUIWS AN H.C. BARROW and R.M. BURSTALL Department of Artificiial Intell&nce, Universiry of E&S&u& Edinburgh, WK Received 1 September 1975 CIiques, graphs, isomorahism, me tchtng. 1. introduction Wemay wish to descnbe some collection of objec;s, with cctrtain properties of those objects and certain binary relationsbetween them. Such a description is IQIOWII variously as a graph, coloured graph, relational structure,or semantic net. Wemay then encounter the problem of determining what two such descriptionshave in common. For example, knowing a description of a scene in terms of blocks, their propertiesand relations,and a descrip tion of an arch in the same terms, are there any archesin the scene? Are thereany partsof arches (arches partlyhidden by other objects)? The situation is complicatedby the fact that it is not sufficient in general,simply to determine whether one description contains the other: we want to know if prt of one descriptioncorrespondsto plvt of tie other, For simplicity consi<iter the case of graphs, where a graphis a set with a single binary relation over it; the generahsation tosets with propertiesand more than one binary relation will be straightforward. C&en two graphs C, and C2 we may distin~ish four problems of inclreasrngdifficulty, each a special case of the one which follows it. (i) Graph ~somorp~sm: is G, isomorphic. to G,? (ii) Subgraph isomorphism: is Cl isomorphic to a sub~aph of C2? (iii) Common subgraphs (or just maximal common ones): fund the (maximal) isomorphic pairs (HI&) such that HI is a subgraph of G1 and Hz ofG,. (iv) aximal matches: find the vernal matches, where a match is a correspondence (many- many relation) between a subgraph pf, of G, and a subgraph Hz of Gz, which preserves the! relation. Problem (ii) is known to be polynomial complete [4] and hence it is conjectured that no algorithm fcu solving it in polynomial time exists. Our interest he:e is problems (iii) and (iv) and we give a method for the more general problem (iv); the methiod has proved to be useful in practice and is based upon the simple observzkn that algorithms for fmding cliques can F,ke used for this problem. Quite efficient clique fmding algorithms are known, so this is a practical method; we have used it to analyse TV pictures of scenes. 2. Maximali matches between two graphs AgrophisasetNandarelationRW3.1f UV1,RI) and <&,R$ are graphs, by a mntch we me%n a correspondence o C N, X A$, such that for any (m~,m2)Ea and (ntln2Eu, Rl(ml,n,) iffR2@r2,n& A match is axial if there is no other match wfuch includes it. We now show how to tranliform this proble;sr, into the mammal cliques problem. Defoe the property P, EN, , by PI(n) iff R,lrt, n); somilarlyP#) iff R2@2,n).Cat1 a pair (n,,n,) E IV1 X Nz gsod if the pair preserves the property. That is, PI (~21) iff 83

Subgraph isomorphism, matching relational structures and maximal cliques

Embed Size (px)

Citation preview

Page 1: Subgraph isomorphism, matching relational structures and maximal cliques

INFORMATION PROCESSING LETTERS .kmuary 1976

SUBGRAPH ~O~O~HI~~, MATCHING RELATIONAL EfT’RWTUIWS AN

H.C. BARROW and R.M. BURSTALL Department of Artificiial Intell&nce, Universiry of E&S&u& Edinburgh, WK

Received 1 September 1975

CIiques, graphs, isomorahism, me tchtng.

1. introduction

We may wish to descnbe some collection of objec;s, with cctrtain properties of those objects and certain binary relations between them. Such a description is IQIOWII variously as a graph, coloured graph, relational structure, or semantic net.

We may then encounter the problem of determining what two such descriptions have in common. For example, knowing a description of a scene in terms of blocks, their properties and relations, and a descrip tion of an arch in the same terms, are there any arches in the scene? Are there any parts of arches (arches partly hidden by other objects)? The situation is complicated by the fact that it is not sufficient in general, simply to determine whether one description contains the other: we want to know if prt of one description corresponds to plvt of tie other,

For simplicity consi<iter the case of graphs, where a graph is a set with a single binary relation over it; the generahsation tosets with properties and more than one binary relation will be straightforward.

C&en two graphs C, and C2 we may distin~ish four problems of inclreasrng difficulty, each a special case of the one which follows it. (i) Graph ~somorp~sm: is G, isomorphic. to G,? (ii) Subgraph isomorphism: is Cl isomorphic to a

sub~aph of C2? (iii) Common subgraphs (or just maximal common

ones): fund the (maximal) isomorphic pairs (HI&) such that HI is a subgraph of G1 and Hz ofG,.

(iv) aximal matches: find the vernal matches,

where a match is a correspondence (many- many relation) between a subgraph pf, of G, and a subgraph Hz of Gz, which preserves the! relation.

Problem (ii) is known to be polynomial complete [4] and hence it is conjectured that no algorithm fcu solving it in polynomial time exists. Our interest he:e is problems (iii) and (iv) and we give a method for the more general problem (iv); the methiod has proved to be useful in practice and is based upon the simple observzkn that algorithms for fmding cliques can F,ke used for this problem. Quite efficient clique fmding algorithms are known, so this is a practical method; we have used it to analyse TV pictures of scenes.

2. Maximali matches between two graphs

AgrophisasetNandarelationRW3.1f UV1,RI) and <&,R$ are graphs, by a mntch we me%n a correspondence o C N, X A$, such that for any (m~,m2)Ea and (ntln2Eu, Rl(ml,n,) iffR2@r2,n& A match is axial if there is no other match wfuch includes it.

We now show how to tranliform this proble;sr, into the mammal cliques problem. Defoe the property P, EN, , by PI(n) iff R,lrt, n); somilarly P#) iff R2@2,n). Cat1 a pair (n,,n,) E IV1 X Nz gsod if the pair preserves the property. That is, PI (~2 1) iff

83

Page 2: Subgraph isomorphism, matching relational structures and maximal cliques

IN~~R~~~~~N PROCESSING LETTERS January 1976

plclw #at X g 1v, X A!2 be the set ofgu0d pairs ancl G G X2 the refation of compatibility between pairs; C; is regave and symmetric. tX’, cr) defines a graph

& &he dprived gmph af WI,R, ) and By a ~~~~ of a graph tju; G) we mean a set *

X au& tbt G(c,d) for all c,d E 6. A clique is

from the definitions that pairs which are mutually

1 rand hwx the maximaf matches ~t~~~ee~~ are +t the maxim81 cliques of their

so w can use drry of the available al~r~th~ to find the maximal

o finding maximal commoix sub- d to the definition of compatible

*’ to ensure that thG correst

for R3WW $Jnetat etntchunes

tr~form a matching ~rob~ern em for the paradigm case of

rmation is of much more b

structures, which are sets with

relations. Now defixe a “good” g a8 prowrties and say two pairs

definitions of “gooC and

‘kompatible” if t’fie 12-D ions ~distance, lisle in

aHy depict the 3-D r~?~at~on- The ~~~~ cliques of the te ~te~r~~~ons of parfi c&x? wer Can compute by some arbitra~ sub-

routines; the clique finding proce ss is unchanged, A more radticai ~eneraijs~ti~n is wIhen the properties

(and the relations) exhibit some Izumerica! degree of similarity or discrepancy. Instead of demanding that they be absoi~ltely preserved we bnay demand preser- vatian to within some tolerance fvhen added up fwr

e the whok match. Provided such ;.ln overaN d~~~~ncy is not decreased by adding new pairs to the corres- pondence, it is possible to adapt the clique ~nd~g ~~or~thrns to handle it, ~thou~ paying a price in efficiency.

4. using the theory

An algorithm for illding ma~irna~ cor~s~nden~s of deser~ptions in this way via maximal cliques has been implemented and used to recognise objects seen by a TV earner8 [I] ) with input graphs of up to 15 nodes and the derived graphs of about SO nodes. It uses an ~~r~~rn we developed (described in ref. [I]) which is tolterabiy effricietit and has a refinement to find only biggest rn~rn~ clique. Better clique- snug al~~th~s have been developed by Bran and Kerbosch [2] and Johnston [3].

Than~s~e due to S.R.C. for support, and to Eleanor Kerse for typing.

A.P. Ambler, H.G. Barrow* CM. Rrown, R.M. BurstaAI anisl R.J. PoppIestone, A mmatifo oomputer_ccmtroUed assembly system. Proc. of Third Intern. Joint Conk Artificial In telligencts, Stanford, California (t9?3) pp. 298- 307. C Bran and J, Kerbosch, Algorithm 457: find cliques of an ~i~~ct~ gaph, C.A,C,M., 16 ( H.C, Johnston, Cliqurrss of a graph - putaf Science ~~rt~nt~ Queen‘s Un 119?4), to K&l* Kaap tn Comple Miller and J.W. (Plenum E&-103*

the 575.