graph optimal monomorphism algorithms

8
IEEE TRANSACnONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. SMC-10, NO. 4, APmL 1980 Graph Optimal Monomorphism Algorithms DAVID E. GHAHRAMAN, MEMBER, IEEE, ANDREW K. C. WONG, MEMBER, IEEE, AND TUNG AU Abstract-The characterization of graph morphisms in terms of the subgraphs of the Cartesian graph product is extended and used to develop algorithms for an optimal graph monomorphism problem. The objective functional considered is defined as the sum of the weights associated with vertex and arc mappings. A reduction algorithm is proposed to obtain sharp lower bounds on the value of the solution. The lower bounds are used in a branch-and-bound algorithm for the optimal graph monomor- phism problem. I. INTRODUCTION RAPH monomorphism has been used in applica- _ tions such as information retrieval [1], [27] and pic- ture processing [3], [23], [31]. The task to be performed in these applications generally is to find a monomorphism of two graphs, one representing an inquiry or an image, the other representing a relational data base or a reference scene, respectively. More realistic tasks, however, can be performed by requiring the desired monomorphism to be optimal with respect to a suitable objective function. In matching graph representable scenes [2], [19], [24], [29], for instance, it may not be possible to obtain a perfect match of the graphs describing two scenes. Local measures of similarity can be defined for such cases and a search initiated to determine the monomorphism yielding the best value for the overall similarity measure [6], [18], [33]. In some tasks imperfect information may dictate the use of probabilistic or fuzzy models with objective functions representing probability or degree of membership, respec- tively [26], [30]. Matching of graph-representable scenes can thus be formulated as an optimization problem. Optimal graph monomorphism is also applicable to formulating and solving certain well-known combinatorial assignment problems. For instance, facility location prob- lems concern building functionally related facilities in a physical environment [21], [28]. The facilities and their functional relation as well as the sites and their physical relation can be represented as graphs. An assignment of facilities to locations is then equivalent to a morphism of the graph of activities into the graph of sites. The cost of an assignment is usually expressed in terms of the ex- Manuscript received June 11, 1979; revised January 11, 1980. This work was supported by the National Science Foundation under Grant GK31080 and the National Research Council Operating Grant A4716, Canada. D. E. Ghahraman is with Megatest Corporation, Santa Clara, CA. A. K. C. Wong is with the University of Waterloo, Waterloo, ON, Canada. T. Au is with Carnegie-Mellon University, Pittsburgh, PA 15213. pected volume of traffic between the facilities and the distance between their sites. Such problems have been formulated as the quadratic assignment problem [1 1], [12], [22], [25] which itself can be formulated as a special case of the optimal graph monomorphism problem [10]. The advantage of the reformulations, scene matching as an optimization problem and facility location as a graph morphism problem, in the previous two examples, respec- tively, is that the elements which are changeable are now stated explicitly. Thus in the facility location problem, the objective function has a concrete meaning while the graphs of facilities may be altered to determine the cost of implementing alternative plans. In contrast, the graphs which are to be matched represent physical entities while the measures of similarity are based on subjective judge- ment and can be varied. The method of solution presented in this paper for the optimal graph monomorphism problem is based on a recent characterization of graph morphisms [9], [10]. Con- sider graphs G = (M,A) and H = (N, B) with vertex sets M and N and arc sets A and B, respectively. For simplicity, refer to G and H as the pattern graph and base graph, respectively. Finding monomorphisms of the pattern graph into the base graph is the statement of the graph monomorphism problem. The Cartesian product G x H is a graph with vertex set M x N. For i, i'E M and jJ'E N there is an arc ((ij), (i',j')) in the product when there are arcs (i, i') in G and (j,j') in H. The product is referred to as the net of G and H and its subgraphs are called subnets. For a subnet, its projection on G is defined as a subgraph of G. For each vertex (i,j) of the subnet there is a vertex i in the projec- tion; and for each arc ((i,j),(i',j')) there is an arc (i,i') in the projection. A subnet whose projection on G is G is called a pattern subnet. In [9], [10] it is shown that there is a one-to-one correspondence between morphisms of G into H and the pattern subnets of G x H. In particular, a feasible pattern subnet is a pattern subnet with at most one vertex in any row or column of M x N and corre- sponds to a monomorphism. The properties of feasible pattern subnets have been utilized to develop algorithms for the graph monomor- phism problem. The algorithms work in a manner similar to that of relaxation techniques [5], [14], [26] and look- ahead operators [8], [13] proposed for more general homo- morphism problems. The reader is referred to a compan- ion paper [9] for complete definition of the terminology and statements of the graph monomorphism algorithms. 0018-9472/80/0300-181$00.75 01980 IEEE 181

Upload: tung

Post on 25-Sep-2016

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Graph Optimal Monomorphism Algorithms

IEEE TRANSACnONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. SMC-10, NO. 4, APmL 1980

Graph Optimal Monomorphism AlgorithmsDAVID E. GHAHRAMAN, MEMBER, IEEE, ANDREW K. C. WONG, MEMBER, IEEE, AND TUNG AU

Abstract-The characterization of graph morphisms in terms of thesubgraphs of the Cartesian graph product is extended and used to developalgorithms for an optimal graph monomorphism problem. The objectivefunctional considered is defined as the sum of the weights associated withvertex and arc mappings. A reduction algorithm is proposed to obtainsharp lower bounds on the value of the solution. The lower bounds areused in a branch-and-bound algorithm for the optimal graph monomor-phism problem.

I. INTRODUCTION

RAPH monomorphism has been used in applica-_ tions such as information retrieval [1], [27] and pic-

ture processing [3], [23], [31]. The task to be performed inthese applications generally is to find a monomorphism oftwo graphs, one representing an inquiry or an image, theother representing a relational data base or a referencescene, respectively. More realistic tasks, however, can beperformed by requiring the desired monomorphism to beoptimal with respect to a suitable objective function. Inmatching graph representable scenes [2], [19], [24], [29], forinstance, it may not be possible to obtain a perfect matchof the graphs describing two scenes. Local measures ofsimilarity can be defined for such cases and a searchinitiated to determine the monomorphism yielding thebest value for the overall similarity measure [6], [18], [33].In some tasks imperfect information may dictate the useof probabilistic or fuzzy models with objective functionsrepresenting probability or degree of membership, respec-tively [26], [30]. Matching of graph-representable scenescan thus be formulated as an optimization problem.

Optimal graph monomorphism is also applicable toformulating and solving certain well-known combinatorialassignment problems. For instance, facility location prob-lems concern building functionally related facilities in aphysical environment [21], [28]. The facilities and theirfunctional relation as well as the sites and their physicalrelation can be represented as graphs. An assignment offacilities to locations is then equivalent to a morphism ofthe graph of activities into the graph of sites. The cost ofan assignment is usually expressed in terms of the ex-

Manuscript received June 11, 1979; revised January 11, 1980. Thiswork was supported by the National Science Foundation under GrantGK31080 and the National Research Council Operating Grant A4716,Canada.

D. E. Ghahraman is with Megatest Corporation, Santa Clara, CA.A. K. C. Wong is with the University of Waterloo, Waterloo, ON,

Canada.T. Au is with Carnegie-Mellon University, Pittsburgh, PA 15213.

pected volume of traffic between the facilities and thedistance between their sites. Such problems have beenformulated as the quadratic assignment problem [1 1], [12],[22], [25] which itself can be formulated as a special caseof the optimal graph monomorphism problem [10].The advantage of the reformulations, scene matching as

an optimization problem and facility location as a graphmorphism problem, in the previous two examples, respec-tively, is that the elements which are changeable are nowstated explicitly. Thus in the facility location problem, theobjective function has a concrete meaning while thegraphs of facilities may be altered to determine the cost ofimplementing alternative plans. In contrast, the graphswhich are to be matched represent physical entities whilethe measures of similarity are based on subjective judge-ment and can be varied.The method of solution presented in this paper for the

optimal graph monomorphism problem is based on arecent characterization of graph morphisms [9], [10]. Con-sider graphs G = (M,A) and H = (N, B) with vertex sets Mand N and arc sets A and B, respectively. For simplicity,refer to G and H as the pattern graph and base graph,respectively. Finding monomorphisms of the patterngraph into the base graph is the statement of the graphmonomorphism problem.The Cartesian product G x H is a graph with vertex set

M x N. For i, i'E M and jJ'EN there is an arc ((ij),(i',j')) in the product when there are arcs (i, i') in G and(j,j') in H. The product is referred to as the net of G andH and its subgraphs are called subnets. For a subnet, itsprojection on G is defined as a subgraph of G. For eachvertex (i,j) of the subnet there is a vertex i in the projec-tion; and for each arc ((i,j),(i',j')) there is an arc (i,i') inthe projection. A subnet whose projection on G is G iscalled a pattern subnet. In [9], [10] it is shown that there isa one-to-one correspondence between morphisms of Ginto H and the pattern subnets of G x H. In particular, afeasible pattern subnet is a pattern subnet with at mostone vertex in any row or column of M x N and corre-sponds to a monomorphism.The properties of feasible pattern subnets have been

utilized to develop algorithms for the graph monomor-phism problem. The algorithms work in a manner similarto that of relaxation techniques [5], [14], [26] and look-ahead operators [8], [13] proposed for more general homo-morphism problems. The reader is referred to a compan-ion paper [9] for complete definition of the terminologyand statements of the graph monomorphism algorithms.

0018-9472/80/0300-181$00.75 01980 IEEE

181

Page 2: Graph Optimal Monomorphism Algorithms

182 IEEE TRANSA

II. STATEMENT OF THE PROBLEM

The optimal graph monomorphism problem is a gener-alization of the graph nionomorphism problem. Let G=(M,A) and H =(N,B) be the given pattern graph andbase graph, respectively. Suppose that g is a real-valuedfunctional which associates a weight g(y) with everymonomorphism y: G-*H. The optimal graph monomor-phism problem is defined by

min g(y)yeT

where F is the set of monomorphisms of the pattern graphinto the base graph. It can equivalently be stated as theproblem of finding a minimum-weight feasible patternsubnet of the net T= G x H. The problem has a solutionif and only if the set F is nonempty.

In most applications of optimal graph monomorphism,the weight functional g can be written in a simpler form interms of vertex mappings ji and arc mappings a of -y =( i, a). Suppose that v(i,j) and u(a, b) are the weightsassociated with the vertex mappings i--j, iE M, jE N,and those with the arc mappings a-*b, aeA, beB. Thefunctional g can then be written as

LCTIONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. SMC-10, NO. 4, APIRL 1980

H

(a)

w

(1)

C_)

g() = IE v(i,a(i))+E u(a,a(a))ic-M a E-A

_-I I --

I--

0

0

0

i = 2

i -=3

3 j = 4

The optimal graph monomorphism problem with theweight functional (1) is the subject of this paper.Without loss of generality it can be assumed that the

base graph H and the pattern graph G are both completegraphs and of the same order. First, if the order of G isless than that of H, a sufficient number of isolated vert-ices can be added to G to make the orders equal. Theweights of the vertex mappings involving the added vert-ices can then be set equal to zero.

Second, if either G or H is not complete, dummy arcscan be added to obtain complete graphs. Let A' and B' bethe sets of dummy arcs added to G and H, respectively.The weights of arc mappings can be modified as follows:

u'(a, b) = u(a, b),

u'(a,b')= ox,u' (a', b) = u'(a', b') = 0,

where a, a', b, and b' denote arbitrary arcs aEA, a'E A',b E B, and b' E B', respectively. The reason for the secondmodification is that an (existing) arc aC A cannot corre-

spond to a dummy arc b' E B' in any monomorphism.Thus let both graphs G and H be complete graphs of

order n, M=N={1,- ,n} and A=B={(i,i'), i,i'EN,i#i'}. In this case the net T= G x H is called the com-

plete square net of order n and is exemplified in Fig. l(a).The weights of vertex and arc mappings can be

arranged in an array W-= 1 vY,I , i, i',j,j'E N. The array Wcan be represented as an n2 x n2 partitioned matrix withn2 minors Wi, each of size n x n; see Fig. l(b).The matrixW is called the weight matrix and is reminiscent of thestar matrix [7]. A diagonal element wi', i= i', j=j' (writ-ten as w!J for convenience) is the weight of the vertex

mapping i-j (equivalently, the weight of vertex (i,j) of

(b)

Fig. 1. Net and weight matrix. (a) Complete square net. (b) Weightmatrix. 0 Diagonal element. -Semidiagonal element.

T). An off-diagonal element wY., i #i' j/7j', is the weightof the arc mapping (i,i')-*(j,j') (or the weight of arc((i,j),(i',j')) of the net). The semidiagonal elements aregiven an infinitely large value.A feasible pattern subnet of the complete square net is

a complete graph of order n with its vertices in distinctlines (rows or columns) of the net. It is easily shown thatany complete subnet of order n has this property and ismaximal with respect to completeness, i.e., no vertices orarcs of T can be added to it to obtain a complete subnetof larger order. Hence the set of feasible pattern subnetscoincides with the set of cliques (maximal complete sub-graphs) of the complete square net (Fig. 2).The complement of an arc of a clique is also present in

the clique. In other words, the term Will,+ w,,, I,appears in the weight of every clique with vertices (i,j)and (i',j'). Hence every two symmetrical off-diagonal ele-ments can be replaced by the value of their sum andwithout changing the problem. After this invariant trans-formation is made, two symmetrical off-diagonal elementsrefer to the same edge [(i,j), (i',j')] of T and are equal, i.e.,the weight matrix is symmetric in the sense that wi§=willfor all i, i',j,j' e N. Moreover, adding a positive number to

the elements of W increases clique weights by a constant.It can be assumed, therefore, that the smallest element ofW is nonnegative.The pair (T, W) is called a weighted net. The optimal

graph monomorphism problem has been formulated as

I

3 11

4

4

Page 3: Graph Optimal Monomorphism Algorithms

GHAHRAmAN et al.: GRAPH OPTIMAL MONOMORPHISM ALGORITHMS

T

Fig. 2. Clique.

0

0

0

0

0

0 0 0

Fig. 3. Rooted star.

that of finding a minimum-weight clique of a completesquare weighted net with a nonnegative symmetric weightmatrix. The latter problem is called the optimal cliqueproblem.A rooted star at a vertex (i,j) of T consists of the root

(i,j), n -1 other vertices in distinct lines and all the edgesincident with the root and each of these vertices (Fig. 3).A cluster is defined to be a subnet of T which contains arooted star at each vertex of it.

Let 8 >0 be used to denote the accuracy of the solutionof the optimal clique problem. A 6-star is a rooted starwith the property that each vertex and each edge of it is ofweight less than or equal to 6. A 8-clique is a clique witheach vertex weight and each arc weight less than or equalto 6. Likewise, a 6-cluster is defined to be a clusterconsisting entirely of 6-stars. A necessary condition forthe existence of a 6-clique is the existence of a 8-cluster.

III. TRANSFORMATION AND REDUCTION

The purpose of reduction is to transform the weightednet (T, W) in such a way that the weights of cliques arereduced equally while maintaining the nonnegativity andthe symmetry of the weight matrix. The reduction clearlyhas no effect on the identity of the optimal clique. If suchtransformations are possible, then the existence of 8-cliques for successively smaller values of 8 can be investi-gated. If in the limit 6-*0, a 8-clique is found, then thatclique would be a solution to the optimal clique problem,correct to within the accuracy 6. However, the optimalityof a 6-clique is guaranteed by the proper choice of 6 (seeSection V).Two types of transformations will be considered:

a) transformations which affect the elements of W butleave clique weights unchanged (invariance transfor-mation); and

b) transformations which reduce the weight of eachclique by a constant (reduction transformation).

The two types will then be combined to produce thereduction algorithm formally presented in Section IV.

T oZ/0

0

Fig. 4. Incident edge set.

Consider the set of edges incident with a vertex (i,j) ofT. As shown in Fig. 4., the set can be decomposed into"rows" and "columns"

R,J= { [ (i,j), (i',j')], for all j'E N, j' #j},citCUJ= [(i,j),(i',j')], for all i'E N, i'7#i}. (2)

A rooted star at (i,j) has one edge in common with every"row" and every "column." Subtracting a number fromthe weights of edges in a "row" (or "column") and addingit to the weight of the root has no effect on the weights ofcliques. Let Q be an n X n matrix which is identical to theminor Wu. The linear assignment problem (see Appendix)of matrix Q ' can be solved by a sequence of operations ineach of which a number is subtracted from a row or acolumn of Q U. Let qij denote the value of the optimalsolution to the assignment problem and suppose Q'i' is thefinal reduced matrix. An invariance transformation of(T, W) is obtained as follows:

wij,-qij,

wu<--w,g' <q,p for all i',j' E N, i' zj,j' ij* (3)

The weight of root is replaced by the value qoof thesolution and the weight of each edge [(i,j), (i',j')], incidentwith the root and represented by the symmetrical ele-ments wi',1 and w,7J of W, is modified accordingly. Inpractice, row i and columnj of Q i can be deleted and an(n - 1)X(n - 1) assignment problem needs to be solved.The value of the solution is then simply added to theweight of the root.The counterpart of transformation (3) is subtracting a

number from the weight of the root and adding it to theweights of edges in a "row" (or "column"). In particularthe weight of the root can be divided equally among itselfand the edges incident with the root

W,<- w,*- wYjj,+ (wij/n), for all i',j' E N, i' i, j'#j,

Wu <- Wiv/ n. (4)Again, symmetrical elements are affected identically.An example for transformations (3) and (4) is provided

in Fig. 5. The initial weighted net is shown in Fig. 5(a).The assignment problem of Q22 is solved to obtain Qt22 asthe final reduced matrix and (4) as the value of thesolution. The result of (3) is given in Fig. 5(b). At thispoint there is a rooted star at (2,2) all of whose edges areof weight zero. The result of (4) appears in Fig. 5(c). Sinceq22=#0, there are now no edges of weight zero and inci-dent with (2,2). The value q22 has been made available forthe transformation (4) for other vertices of the weightednet.

183

Page 4: Graph Optimal Monomorphism Algorithms

IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. SMC-10, NO. 4, APRIL 1980

2 -

0

c3C124

(T,W) Q

(1,C) o0 0 - 2 13 ~~~5-7 3

(a)

0 ~~~~~10 3

(T ,W)< -/ Q t~~~220 0 Q

- 4\)1 0 2 1

(T,W) *.

4 0

(b)

2 1

(T,W)

0~

(c)

Fig. 5. Invariance transformations. (a) Initial weighted net. (b) Trans-formation equation (5). (c) Transformation equation (6).

Transformations of W which reduce clique weights arenow considered. If the smallest element o in W is notzero, then subtracting it from the weight of every elementconstitutes a reduction. The amount of reduction (theamount by which the weight of every clique is reduced) is(n + nI)w where nI = n(n -1)/2 is the number of edges in aclique. A simple reduction is also obtained by solving theassignment problem of matrix 11wi,,1 of vertex weights.Then the amount of reduction is the value of the solutionto this problem.A set of edges of T is said to be stable if no two of its

members belong to the same clique. A maximal stable setis one that is not properly contained in another stable set.Since there are n! cliques in the complete net of order n,and there are (n -2)! cliques with a given common edge,there can be at most n!/(n-2)!=n(n- 1) edges in astable set. A maximum stable set has one edge in commonwith every clique. Hence subtracting an amount from theweights of edges in a maximum stable set constitutes areduction.Maximum stable sets can be collections of sets of the

forms defined in (2). For instance, in Fig. 6(a) a row isselected and one such set is chosen for each vertex in therow. The maximum stable set shown in Fig. 6(b) is con-structed similarly. It is to be noted that not all maximalstable sets are also maximum. A counterexample is shownin Fig. 7 where a clique with no edge in common with themaximal stable set is shown (broken line).The example of Fig. 8 is intended to illustrate the

combined use of transformations. Suppose that the

3C 14

T

(a)

0 0

(b)Fig. 6. Maximum stable sets. (a) Row 1. (b) Column 1 or 2.

0 0

TeFig. .-Mt

0 0

Fig. 7. Maximal stable set.

(T,W)

(T,W)

(T,W)

2

,

(a)

2

(b)

0011

0( 1

(C)

00o0000(00(

00(

00C

0 000(

Fig. 8. Transformation and reduction. (a) Subtract 3 from (1,1) andadd 3 to C2. (b) Subtract 2 from C22 and add 2 to (2,2). (c) Subtract Ifrom row 2.

184

R11

1) 9

Page 5: Graph Optimal Monomorphism Algorithms

GHAHRAmAN et al.: GRAPH OPTIMAL MONOMORPHISM ALGORITHMS

weights of edges not shown are zero. Then it is verifiedthat there is no maximum stable set with a nonzerominimum. Moreover, the value of the solution to theassignment problem of matrix H1w,,11 is already zero. How-ever, it is shown that the nonzero weight of vertex (1, 1)can be "transferred" to vertex (2,2). Now the minimumweight in row 2 is nonzero and can be subtracted out. Thefinal result would be the reduction of clique weights byone unit.

IV. REDUCTION ALGORITHM

In the previous example two consecutive invariancetransformations led to a reduction. In general, the ques-tion is whether a sequence of invariance transformationsexists which would lead to a reduction. The followingalgorithm is one technique to explore this possibility. Let6 >0 be a given small number. The amount of reductionis represented by the variable /3.

Algorithm I (Reduction)

0) Mark all vertices; set /3--0.1) For all marked vertices (i,j):

1 a) transform W by solving the assignment problemof matrix Wi, transformation (3), if the solutionis greater than 6;

lb) if w. >6, then remove the mark on (i,j) andtransform W by dividing the root weight amongitself and the incident edges, transformation (4).

2) If any previously marked vertex is now not marked,then repeat step 1).

3) Let w be the smallest element in W. If w<6/n, thenstop; otherwise subtract c from the weight of everyelement, set 83*-f + (n + nI)w, mark all vertices andgo to step 1).

The steps in the algorithm have been individually de-scribed previously. The algorithm will terminate in a finitenumber of steps since the weight matrix is reduced by apositive amount (6#0) every time step 3) is executed. It isnow shown that, under certain circumstances, Algorithm 1terminates when there is a 6-cluster in the final reducednet.

Consider the final reduced matrix W' obtained at thetermination of Algorithm 1. Then '<86/n. Suppose thatevery vertex is at this point not marked. According to step1 b), when the mark of a vertex is removed, the root aswell as the edges incident with the root acquire a weightgreater than 6/n. Therefore, the smallest element inW',d'>8/n, is a contradiction.When the algorithm terminates there is at least one

marked vertex (i,j). Clearly w, <.8. Suppose that for everyrooted star at (i,j) the sum of edge weights is greater than6. Hence the value of the solution to the assignmentproblem Wu' is also greater than 6. However, this valuemust have become greater than 6 during the last executionof step 1) (and not before, since (i,j) is marked). Theweight of an edge [(i,j), (i',j')] can change in step lb)when that step is executed for either endpoint. Since the

step has not been executed for (ij), there must be verticesadjacent with (ij) which lost their marks during the lastexecution of step 1). But this means that step 1) wouldhave been executed again and the mark on (i,j) removed.

Thus at each marked vertex there is a rooted star withthe property that the sum of its edge weights is less thanor equal to 6. Consider a marked vertex (i,j), a star withthis property and rooted at (i,j) and let (i',j') be anarbitrary vertex of the star other than the root. Clearlyw'f1 <6. Suppose that (i',j') is not marked. Let wi, be theweight of vertex (i',j') at the beginning of that executionof step Ib) when the mark on (i',j') was removed. Then

(5)

The first inequality is simply the condition in step I b).The second inequality holds because the value wj,/n hasbeen added to the weight of edge [(i,j),(i'j')] and thisweight has never again been changed (since (i,j) asmarked). Suppose the following assumption were true:

Throughout the execution of Algorithm 1, wheneverstep lb) is reached, the weight of the root is not inthe half-open interval (6,n6]. (6)

Then (5) would be a contradiction and (i',j') would be amarked vertex (w, < 8). Thus there exists a 6-star rootedat the marked vertex (i,j). Furthermore, every vertex ofthe star is marked.

It has been shown that if (6) is true, then Algorithm 1terminates when there is a 6-cluster in the final reducedweighted net. The marked vertices are the vertices of thecluster. Hence if there are only n marked vertices, they arethe vertices of a 8-clique and a solution correct to withinthe accuracy 6 has been found.The assumption (6) is not important from the computa-

tional viewpoint. Whether it is satisfied or not the amountof reduction is still a valid lower bound on the value ofthe solution and can be used in the branch-and-boundmethod (Section V). Except for the limiting case 8->0, ithas not been possible to characterize the conditions underwhich (6) is true.The data of an example of optimal graph monomor-

phism are given in Fig. 9. The pattern and base graphs areshown in Fig. 9(a) while the weights of vertex and arcmappings are tabulated in Fig. 9(b). The symmetricweight matrix is shown in Fig. 10. The diagonal elementsare the weights of vertex mappings. The other elements(e.g., w J =21 =w2) are sums of weights of complemen-tary arc mapping weights (i.e., u((l, 4), (1, 2)) +u((4, I),(2,I))=8+13=21). The results of applying thereduction Algorithm 1 for 6= 0.004 are presented in Fig.11. It is seen that the amount of reduction approaches 29.The final marked vertices were found to be (1,2), (2,3),(3,4), and (4, 1). Since there are only four, they representthe vertices of a 8-clique. Hence a solution of weight 29has been found correct to within the accuracy 0.004. Thefinal reduced matrix is shown in Fig. 12 and the elementscorresponding to the vertices and arcs of the optimalclique are indicated.

185

8 < wij, < nw'.Y, < A.i,j

Page 6: Graph Optimal Monomorphism Algorithms

IEEE TRANSACIONS ON SYSTEMS, M, AND CYBERNETICS, VOL. SMC-10, NO. 4, MAI, 1980

2

1 2 3 4

1 8 7 9 8

2 2 0 1 1

I .6

4 1 [

(a)

(1,2)

(1,4)

(2,3)

(3,4)

(4,1)

(1,2) (1,3) (1,4)

7 2 5

8 1 2

4 0 1

3 10 9

(i2,1) (2,3) (2,4)

3 7 3

1 3 10

12 5 6

3 2 (

13 c 2

(b)

3, 1) (3,2) Q, 4) ^(st84 J(.

8 2 8 VT

2

13

t. t -1 ]-- --

Fig. 9. Example of reduction. (a) Pattern and base graphs. (b) Vertex and arc mapping weights.

13. 00 -.0- 7.00 2.00 5.00- 020 0.00 0.00- 21.00 5.0o 4.00

- 3.00 8.oo 4.00oI2.Q00 -

4.00 0.00 1.00

I 0.00 0.00 0.00- 70 13.00 3 007

2.00 -. .- 6.00 9.00 111.00

- 4.20 12.00 16.00- 7. 0 0.00 0.00

O3.0 1.00 1.001.03 - - -0

2

- 7.00 - -o3.00 - 7.00 3.00i 8.00 2.000.00 - 0.00 0.00 I0.00 0.00l4.00 - 19.00 20.001 12.00 6500

7.00 - 2.00 13.001 2.00 7.00O.00 - - 1.00

2.00 - 5.00 6.00113.00 7.000.00 - 0.00 0.001 0.00 0.00

0.00 - 0.00 0.001 0.00 0.004 .0 - 1.00 5.00- 0.00 5.00

- 5.00 - - - - 33.00 - 2.00 9.00 1.00 2.00

1.00 6.oo 9.00o 5.00 19.00 -0.00 0.00 o.o ooo o0.0 -

6.00 - 2.00 4.00 9.00 2.00 -

3.00 7.0o

1.

I.00 4.00 3.00 0

14.0018.00 .oe0I.00 5900 3.oo 8 0o

2.001 3.00 .00 00.001 0.00 0. 0 7.f.

0.0' 0.00 Ui2.0wI 00/) LO0 2

8 o 1.30 O.0 4.u8. oo 14 00 20. 00 114."o0 oo1 0.io 0.00 0.00i3.00<,11.o0 3.0o 8.o0

Fig. 10. Weight matrix of example

0 1 2 3 4

I te ration

Fig. 11. Results of example.

V. BRANCH-AND-BOUND ALGORITHM

he branch-and-bound method is a decision-tree searchtechnique for solving combinatorial optimization prob-lems [4], [15], [17], [20]. The root (0,0) of the decision tree

represents the set of all cliques of (T, W). Let (1, k,),1, k, eN, be a node of the decision tree and suppose that(1- 1,k1-),. * ,(l,k1) are the nodes in the path from (l,k,)to the root. Then the node (1, k) represents the set of

cliques which share the vertices (1, k,),- * , (1, kl) of (T, W)in common. Since (T, W) is a complete weighted net, theset of cliqucs represenited by every node is nonempty.

The essential feature of the branch-and-bound method

is the association of lower bounds with the nodes of the

decision tree. For each node the lower bound is a value

less than or equal to the minimum of the weights of the

cliques represented by the node. For instance, the amount

of reduction from Algorithm I can be used as the lower

bound for the root. The lower bounds for the other nodes

can be calculated in like manner since each node (1,k),1, k e N, defines a smaller optimal clique problem (a sub-

problem). The weighted net (T, W)k of the subproblemdefined by a node (I,k) at level I is obtainied froim (T W)as follows. For each vertex (i',j'), i' , 1. J/Jk. a-dd the

186

2

G

4

I.

I0 C,O

-~

i-

i- ., (3 l) ;

Mi. imum

Wei.ght

0

Ai-t uT1 t o£

10 RI duction

Page 7: Graph Optimal Monomorphism Algorithms

GHAHRAmAN et al.: GRAPH OPFIMAL MONOMORPHISM ALGORITHMS

( 41- - .00 - - - - -.2 - I 2____ .~~~~~~~~~~~~62 -I-- .20.49 41 4.72 .20 - .00 .54 3.30 1.81 - 54 .20 8.145 .22 -

I .47 2.17 .41 2.29 - .21 .00 .62 9.81 - 1.43 1.18 4.27 .20 -

- 12.79 .48 .44 .00 - 14.20 11.68 1.37 .62 - 3.66 7.97 .20 1.59 -_ _ _ ____ _4 72 54 54.20 3.30 .20 .49 - 1.81 8.45 .41 .00 - .22 4.72 .54 .54 -

.20 - - - .45 - - - .00 - - - .5',2.83 .20 .201 8.26 - .49 .50 10.22 1.23 - .00 .62 .47 .78 -

X- .20 .48 .44 1.79 - 6.50 .44 .00 .56 - 2.71 .54 4.02 .48 -

- 2.29 .62 1.18' .47 - 9.81 4.27k 2.17 .21 - .20 .41 .00 1.43 -I 8.26 10.22 .62 2.63 - 1.23 .471 .20 .49 - .78 .20 .50 QQ -1.02 - - .47 - - - .20 - -- .00

- .62 2.24 4.061 .66 - .48 .44, .20 .20 - .44 .00 3.25 3.25 -,- _ _ _ _ _ _ _ _ _ H_ __4 _ -_-_-i

.00 1.37 7.97 12.97 - .62 .201 .48 14.20 - 1.59 .44 11.68 3.66 -1.79 .00 .54 .20 - .56 4.021 48 6.50 - .48 1.44 .44 2.71 -

- .68 .20 .00 .62 - .20 3.251 2.24 .48 - 3.25 4.06 .44 .44 -- - - - .20 - - - - .48 - - - .14 4

Fig. 12. Reduced weight matrix of example.

edge weight wilk to wj,~. Delete row 1 and column k ofeach minor of W and delete minors Wlj' and Wi'k, for alli',j' E N. Also delete row 1 and column k of T. The set ofcliques of (T, W)k correspond to a subset of the set ofcliques of (7', W). The difference in weight between corre-sponding cliques is a constant wlk. If (T, W)k is con-structed after reducing (T, W) (as is done in Algorithm 2),then the lower bound associated with node (1, k) is / +,1k+ wlk where / and 8k are the amounts of reduction of(T, W) and (T, W)k, respectively.

The search begins at the root of the decision tree. If a6-clique is found at the current node (if the optimal cliquesubproblem of the current node is solved), then the lowerbound of this node is chosen to be the best estimate ( ofthe solution to the otpimal clique problem. The currentlyactive successor nodes are those whose lower bounds areless than (. A branching can be made to an active succes-sor node with the smallest lower bound. (Other branchingfunctions may be considered as well; see [15], [17].) Ifnone of the successor nodes is active, then the predecessorof the current node is revisited. The search terminatesafter all nodes have become inactive.

Algorithml 2 (Optimal Clique)

0) Reduce (T, W); let /3 be the amount of reduction;

1) If there is a (-clique in (T, W), then (,-# and return.2) For k=1,.* , n, let /k be the amount of reduction of

(T, W)k; let 3k8k +/ + Wlk.3) If any subproblem (T, W)k with 8k<< has not yet

been considered, invoke the algorithm, beginning atstep 1), for a subproblem with the smallest lowerbound; if none exists, then return.

To ensure that the 6-clique found in Algorithm 2 isoptimal, 3 must be less than the difference between theoptimal clique weight and any other clique weight. Now ifany two cliques differ in weight, the difference is at leastas large as the minimum nonzero difference A betweenelement weights in W. The upper bound A can be de-termined by ordering the distinct elements of W byweight, subtracting consecutive weights in the order andtaking the minimum of the resulting sequence of numbers.

TABLE ICOMPUTATIONAL RESULTS

Prob lem

5-

6-

7-

8-

-dept.

-dept.

dep)t.

-dept.

RIe dutc t oi(n

11()

S

t

1 9.4

Fi ri't

leaOileSo IUt ionl

8

i 2

So tit i oi)1

851115

1-}

I is

Ic (dLi t iOuaS Oof,;()I (iti oil

)6)I

Hence 8< A is a sufficient condition which guaranteesthat Algorithm 2 provides the solution to the optimalclique problem.

In order to evaluate the performance of Algorithin 2. aset of facility location problems [21] were formulated asoptimal graph monomorphism problems [10]. Each prob-lem involves the assignment of a given number of inteilre-lated facilities to available locations in a plant. l1 he cost ofan assignment depends on the flow of material betweenevery two facilities and on the distanice between theirlocations. The facilities and locatioins can be representedby the pattern and base graphs and the objective functioncan readily be expressed in the form (1). I he resUlts ofapplying Algorithms I and 2 are presented in Iable I. It isseen that the amount of reduction obtained from Algo-rithm 1 is a sharp lower bound on the value of thiesolution. Furthermore, the fiist feasible solutions ate, inall cases, the optimal solutions. Hence the first feaFiblesolution given by Algorithm 2 irma im gen)eral 1,e2iacceptable approximate solution.

VI. CONCLUSION

The optimal graph monomorphisrn problem has beenformulated as the minimum weight clique problem ofweighted nets. Invariance and reduction transformationsare used to develop a reduction algorithm which providessharp lower bounds on the value .f the sotlution. T1-heamount of reduction can be uised in the braiich- ibi::Q

18,7

Page 8: Graph Optimal Monomorphism Algorithms

IEEE TRANSACTONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. SMC-10, NO. 4, APRIL 1980

bound algorithm to obtain feasible and optimal solution.Solving the linear assignment problem is an important

step in the proposed reduction algorithm. An alternative

reduction procedure does not rely on that step but utilizes

the solution technique of the linear assignment problem.

The zero elements of the weighted net can be covered

with maximum stable sets. The smallest element which is

not covered can then be subtracted from every element of

the weighted net and added to every element in the cover.

In this way an improved reduction may be obtained. Such

improvements will enhance the applicability of the pro-

posed methods of solution to a greater variety of prob-

lems.

APPENDIXLINEAR ASSIGNMENT

Given an nX n nonnegative matrix P, the assignmentproblem with matrix P is defined by

min E

PklXkl,k,1

Xk= 1,

EXkl=1k

Xkl,> O.

Since the constraint matrix of the linear program is totallyunimodular (i.e., the determinant of every square sub-matrix is 0 or ± 1), there exists an integral optimal solu-tion (xkl = 0, 1). The values p. are usually thought of as the"cost" of assigning "man" k to"job" 1. The objective is tofind a set of assignments such that each "man" k isassigned to a distinct"job" I (i.e., Xkl =1) and such thatthe total"cost" is minimum. The Hungarian method [16],[32] is an efficient algorithm for the assignment problem[7].

REFERENCES

[11 J. G. Auguston and J. Minker, "An analysis of some graphtheoretical cluster techniques," J. Ass. Comput. Mach., vol. 17, pp.

571-588, 1970.[2] H. G. Barrow and J. M. Tenenbaum, "MYSYS: A system for

reasoning about scenes," Stanford Res. Inst., Al Center, Tech.Note TN-121, 1976.

[3] H. G. Barrow, et. al., "Some techniques for recognizing structures

in pictures," in Frontiers of Pattern Recognition, S. Watanabe, Ed.New York: Academic, 1972, pp.1-29.

[4] J. R. Bitner and E. M. Reingold, "Backtrack programming tech-niques," Commun. Ass. Comput. Mach., vol. 18, pp. 651-656, 1975.

[5] L. S. Davis, "Shape matching using relaxation techniques," IEEETrans. Pattern Anal. Mach. Intell., vol. PAMI-1, pp. 60-72, 1979.

[61 M. A. Fischler and R. A. Elschlager, "The representation andmatching of pictorial structures," IEEE Trans. Comput., vol. C-22,pp. 67-92, 1973.

[7] M. Florian and M. Klein, "An experimental evaluation of somemethods of solving the assignment problem" INFOR, vol. 8, pp.101-107, 1970.

[8] E. C. Freuder, "Synthesizing constraint expressions.'* (ommun.Ass. Comput. Mach., vol. 21, pp. 958-966, 1978.

[9] D. E. Ghahraman, A. K. C. Wong, and T. Au, "Graph monomor-phism algorithms," IEEE Transv Svst., Man, Cybern., this issue, pp.189-196.

[101 D. E. Ghahraman, "Graph morphism and its engineer-ing applica-tions," Ph.D. thesis, Carnegie-Mellon Univ.. Pittsburghb, PA, 1976.

[11] G. W. Graves and A. B. Whinston. 'An algorithm for thequadratic assignment problem,"' Man. Sc, vol. 16, pp. 453--471.1970.

[12] M. Hanan and J. M. Kurtzberg, "A review of the placement andquadratic assignment problems," SIAA Rev.. vol. 14. pp. 324-- 342,1972.

[131 R. M. Haralick and L. G. Shapiro, "iTe consistent labelingproblem: Part I," IEEE 7rans. Pattern Anal. Mach, Infell vol.PAMI-l, pp. 173 184, 1979.

[14] R. M. Haralick and J. S. Kartus. "An-angements, homomorphisms,and discrete relaxation," IEEE 7rans. Svst., Man, (Cybern., vol.SMC-8, pp. 600--612, 1978.

[15] W. H. Kohler and K. Steiglitz, "Characterization and theoreticalcomparison of branch-and-bound algorithms for permutationproblems," J. Ass. Comput. Mach., vol. 21, pp. 140- 156, 1974.

[16] H. W. Kuhn, "The Hungarian method for the assignment prob-lem," Nav. Res. Iob. Q., vol. 2, pp. 83 97, 1955.

[17] E. L. Lawler and D. E. Wood. "Branch-and-bound methods: Asurvey," Oper. Res., vol. 14, pp. 699-719, 1966.

[18] U. Montanari, "Optimization methods in image processing," in

Proc. IFIP Cong. 74. Amsterdam: North-Holland, 1974, pp.727-732.

[19] E. L. Morofsky and A. K. C. Wong. "Computer perception ofcomplex patterns," in Proc. of the Second International Joint Con-ference on AL. London: Imperial College, 1971, pp. 248- 257.

[20] T. A. J. Nicholson, "A method of optimizing permutation prob-lems and its industrial applications," Combinatorial Mathematicsand its Applications, D. J. A. Welsh, Ed. New York: Academic,1971, pp. 201-217.

[211 C. Nugent, el al., "An experimental comparison of techniques forthe assignment of facilities to locations," Oper. Res., vol. 16, pp.150-173, 1968.

[22] C. S. Parker, "An experimental investigation of some heuristicstrategies for component placement," Opl. Rev. Q., vol. 27, pp.71 81, 1976.

[231 T. Pavlidis, "Structural patteni recognition: Pnrmitives andjuxtaposition relations," Frontiers of Pattern Recognition, SWatanabe, Ed., New York: Academic 1972, pp. 4

[24] T. Pavlidis, "Representation of figures by labeled graphs," PatternRecog., vol. 4, 5-17, 1972.

[25] J. F. Pierce and W. B. Crowston, -1Tree-search algorithms forquadratic assignment problems," Nav. Res. Log. Q., vol. 18, pp.1 -36, 1971.

[26] A. Rosenfeld, et. al., "Scene labeling by reiaxation operations,IEEE Tranv. Syst., Alan, Q'bern., vol. SMC-6, pp. 420-433, 1976.

[27] G. Salton, Automatic Informatiaon Organization and RetrievalNew York: McGraw-Hill, 1968.

[28] A. J. Scott. Combinatorial Progranmming, Spatial A nalysis and Plan-ninig. London: Muthuen,1971.

[29] A. C. Shaw, "Parsing of graph-representable pictures."J..4ss.Conmut. Mach., vol. 17, pp. 453-481, 1970.

[30] W. H. Tsai and K. S. Fu, "Error-correcting isomorphisms ofattributed relational graphs for pattern analysis," IEEE Trans.Syst., Man, Cybern., vol. 9, pp. 757-768. 1979.

[31] J. R. Ullmann, Pattern Recognition Techniques New York:Crane, Russack and Co., 1973.

[32] A. Yaspan, "On finding a maximal assignment," Oper. Revs. vol.14, pp. 646--651, 1966.

[33] C. T. Zahn, Jr., "An algorithm for noisy template matching," inProc. IFIP Cong. 74. Amsterdam: North-Holland, 1974, pp.698-701.

188