LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN Digitized by the Internet Archive in 2013 http://archive.org/details/graphtransformat368schw pi COP HC^Ul \J 11W • ^)W GRAPH TRANSFORMATIONS FOR COMPOSITE FORMATION by John C . Schwebel December 12, 1969 n »\ s *» DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN • URBANA, ILLINOIS COO-1018-1195 Report No. 368 GRAPH TRANSFORMATIONS FOR COMPOSITE FORMATION by John C . Schwebel December 12, 1969 Department of Computer Science University of Illinois Urbana, Illinois 6l801 *This work was supported by the U.S. Atomic Energy Commission under Contract No. USAEC AT(ll-l)-10l8. 1 . INTRODUCTION This paper defines and investigates transformations of labelled directed graphs. The properties of composite formation under a binary relation, which were defined in a previous report [l], are shown to be sufficient conditions for some graph transformations. Implications between the defined transformations are also determined. A method of classifying relations involved in a transformation is demonstrated. A partial classification is performed on the basis of the defined transformations and on the abstract properties of the constituent relations. The motivation for the work in this area was the concept of "precedence" of graph transformations, introduced by Professor Bruce H. McCormick. These ideas were put forth at a computer graphics conference [2] and in further frequent discussions since that time with this author. Within the framework of these ideas, an abstract graph is "parsed" by a series of composite forming transformations. In forming composites some links, representing relations between objects, must be assumed to have a higher binding strength, i.e. precedence, than others. Each transformation simplifies the available information by deleting or "cutting" links of lower precedence to objects on one level and extending them in turn to a composite element introduced at a higher level in the parse. Information supplied by relations within the composite element, of course, remains available at the lower level in the parse. -1- 2. LABELLED GRAPHS AND TRANSFORMATIONS We will consider finite directed graphs with labelled edges corresponding to binary relations . A labelled grap h, L = (X, H ) consists of an arbitrary set, X, of n elements and a set , H , of m binary relations on X: H A = {H x ! H. CX x X, HA 0, 6 e A} A oo — Here A = {6} is an index set of m elements. L is represented by a diagram with n points corresponding to elements of X, and r labelled directed edges. There is a directed edge labelled by 6 from point X to point X if and only if (X. , X.) e H . Let r r = IhJ. Then r = I r_. k 1 6 6 • J 6eA 6 The values of n, m and r will be used to enumerate some simple graphs which will be considered in graph transformations. A transformation , Q, is a graph replacement rule, denoted L -|_ = :: Lg* where L j_ and L 2 axe labelled graphs involving -variables on the same set. For example we define a transformation Q2 by the rule: L = : : L where L ± = ({a,b,c}, H 1 = {(b,a)}, H 2 = {(b,c)}) L 2 = ({a U b, c}, H 2 = {(a U b, c)}) Q2 is represented by the diagram: a U b Q2 : a Q)<^>(T(A) =^.T(Q)) where A is a condition and Q is a transformation. Table 2 lists alternate sufficient conditions for the fourteen non-isomorphic transformations T(Q2), T(Q3), T(qU) and the fourteen reverse transformations T(t$2) , T(Q3) , T(Q^) for all T in G. All the conditions T(A) for T(Q) are determined from the conditions A for Q in the first row of Table 2. Each alternate condition for T(Q) .is contained completely on one line within the row and column entry for T and Q unless the condition is enclosed in parenthesis. In Table 2 the conditions involving properties, P, (type 1 above) always apply to the relation H of the transformation and the containment conditions (type 2 above) always apply to the relation H of the transformation. For example, the meaning of the entry in row "E" and column "QU" of Table 2 is expanded below: (H 2 satisfies P5) or (H is: GTE) or (H £L LTE) or ( ( Q2 is valid) and (I (Q2) is valid)) =^ Q> is valid. The purpose in establishing these conditions is to be able to determine in as many cases as possible which transformations are valid by considering only abstract properties of the relations involved in the transformations. Then by characterizing all relations under consideration in terms of an adequate set of properties s a name-independent or context-free type of parse may be facilitated. -Ik- Table 2 - Sufficient Conditions for Transformations t\^ Q2 Q2 Q3 A. 03 * QU E PI" 1 GTE P2 -l GTE Q3 I ± (03) P3 _1 GLTE Q2 i 1 (Q2) P2" 1 E (02 & I 1 (&)) P5 GTE LTE (02 & I 2 (Q2)) P2 & P2 1 E^_ ^_ (Q2 & I (Q2)& I 2 (Q2)& X 1(02)) h pi- 1 LTE P2 -l LTE 3^(03) 03 h PI GTE P2 GTE^ I 2 (Q3) 1(03) P3 GLTE 1(02) I 2 (Q2) P2 (I(Q2)& I 2 (Q2)) I PI LTE P2 LTE^ I (Q3) I 2 (&) D P2- 1 LTE PI" 1 LTE D(Q3) 1^(03) PIT 1 GLTE D(Q2) 1^(02) PI" 1 E ^ (D(Q2)& I D(Q2)) P7 LTE GTE (D(Q2) & I 2 D(Q2)) r PI & Pi" 1 E ^ (D(Q2) & 1^(02)8= I D(^2)& ID(Q2)) I i D P2- 1 GTE PI" 1 GTE ^ 1^(03) D(Q3) I 2 D P2 LTE PI LTE I 2 D(Q3) ID(Q3) GLTE ID(Q2) I 2 D(Q2) PI E ^ (ID(Q2)& I 2 D(Q2)) ID P2 GTE PI GTE H>($3) I D(Q3) -15- 6. TRANSFORMATION INDUCED CLASSIFICATION OF RELATIONS Assume we have a set of transformations and a set of relations which may occur in the transformations. That is, the set H of relations in a transformation represents m variables which may be chosen from the class of relations under consideration. If we know the behavior (e.g. the validity) of the transformations for all possible combinations of relations, we can partition the relations into classes, such that all relations in the same class behave the same in a position in a given transformation with respect to all possible relations in the other positions in the trans- formation. Then by intersecting the partitions induced from each position in each transformation we will obtain a classification which is as fine- grained as necessary for the given relations and transformations. Thus, the only property of a relation now necessary for applying the transfor- mations, as for example, in a name- independent parsing procedure, is the class to which the relation belongs. The classification described above is an exhaustive technique which assumes complete information about all relations in all transfor- mations and would be impractical for most situations. The approach taken in this section is to determine as much as possible about the trans- formation induced classification of relations on the basis of the pro- perties defined previously. Although the exhaustive technique may be the only way to verify that the finest level classification has been obtained, a consideration of a priori properties will partially, and may completely, determine the classification in some cases. Induced Partitions First, we define and show the uniqueness of the transformation induced partitions. Given a set of relations, H, we consider a trans- formation, Q, involving m relations, H r , 6 e A, where each H\ is a 6 o variable over the set H. Assume there is a function f_: n -> N which associates some element of a set, N, with the transformation Q for any m relations in H. -16- Elements of N may i idicate the validity or other properties of the transformation. The function f can be represented by an m-dimensional array, A, where the size of each dimension is the order of H. Assume A = {1,2,..., m} and g and h are fixed elements of H. Then we can define m equivalence relations, E-. , E_ , . . . , E , on H by: 12 m gE.h <*=» f(H r H 2 ...,H H , g, H. +1 ,...,H m ) = f(H l' H 2"-' H j-l' h > Vl V The m equivalence relations uniquely determine m partitions, II, II , . . . , n , on H. In terms of the array, A, the classes of II. correspond to equal hyperplanes perpendicular to the axis of the ith dimension. By combining equal hyperplanes , the array A can be reduced to an array where the size of the ith dimension is the number of classes in II . . 1 Thus, the partition n . uniquely classifies relations which are indistinguishable from each other in the ith position of the transformation for all relations in H. Partial Classification Now we consider the transformations Q2 , Q3, Ql* -and Q2 Q3* Q^T Here m = 2, A = {1, 2}. Let N = {0, 1} and define f by: f (g,h) =J 1 If Q is always valid with H = g and H = h, ^ Otherwise Then f n is represented by a matrix of binary values denoted by M . Rows of M correspond to relations H and columns of M correspond to relations H . The two partitions IL and II group equal rows and columns respectively. -17- We partially determ ne the matrix M by considering the con- ditions of Table 2. That is, we determine the number of different classes in n and II on the basis of all possible values of the conditions which imply H and H p . These results are summarized by Table 3 which shows the reduced matrix, M, for the six transformations Q2, Q2, Q3, Q3, Q^- , and Q^+. This matrix contains all the information of the individual matrices M , . . . , M-^ and the partitions, II and II of M are the intersections of the partitions of the individual matrices. The five possible values of the containment properties for H give five different classes in II (rows —1 of M) and the twenty possible values of the properties PI , P3 , P5, P2, P2 give fifteen different classes in II (columns of M). Since the matrix is only partially filled out, these are lower bounds on the total number of classes in II and n . We know also that the seven partially filled out matrices for the transformations T(Q2), T(Q2) , . . . ,T(qU) for the other seven T in G, i.e. T ^ E, will have values identical to M. In these matrices the conditions A are replaced by T(A) and the application of the dual or inverse operators to all conditions A does not change the possible values of the conditions. -18- Table 3 M Pl" 1 1 1 1 1 1 1 \ H 2 P3 -l 1 1 1 1 1 1 1 1 1 1 1 1 H l \ P5 1 1 1 1 1 1 P2 1 X 1 X 1 X 1 X 1 X P2" 1 1 1 1 1 1 1 1 1 1 1 Q2 1 1 1 1 1 1 £ 1 1 1 1 1 1 1 1 1 1 Q3 1 1 1 1 1 1 1 1 1 1 1 1 Q3 1 1 1 1 1 1 1 1 1 1 Qh 1 1 1 1 1 1 qH 1 1 1 1 1 Q2 1 1 1 1 1 1 GTE € 1 1 1 1 1 1 1 1 1 1 U Q3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 LTE 03 oh 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Q2 1 1 1 1 1 1 >*- 02 1 1 1 1 1 1 1 1 1 1 LTE 03 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ts 1 1 1 1 1 1 1 1 1 1 QU 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0^ 1 1 1 1 1 02 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 02 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 GTE 03 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ^3 1 1 1 1 1 1 1 1 1 1 oh 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 02 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 tt2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 03 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 E 03 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0^ ^> 0^ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7. EXAMPLE CLASSIFICATION As an application of the ideas of the previous section, we will consider an example in which a labelled directed graph represents a simplified "house cartoon" of the type used in the paper by Ledley and Wilson (3). The nodes of the initial graph correspond to the primitive elements, window, door, chimney, wall, roof and gable, of the cartoon. The set of relations, H, between nodes is given below. Relations H directly left of ij H directly on top of H contains *a near Figure h shows a house cartoon with labelled primitives, and the associated graph. Relations which are implied by other relations, such as "near" implied by "directly on top of" , are not shown on the graph. The goal now is to parse the graph by forming composite elements to obtain a final composite, "house", which can be represented by a linear string of relations and primitives. The graph should be parsed so that no information from the original graph is lost. In considering the application of a composite forming transformation, Q, to the graph, we know that Q will be information lossless if both Q and the reverse of Q, Q, are always valid. In order to parse the graph, we would like to determine the validity of the transformations, Q2, Q2, Q3 , 03, QU , Q 1 * , for all combinations of the relations, H. Thus, we want to obtain the validity matrix, M, and a classification of the relations as described in Section 6. We first partially determine the matrix on the basis of the abstract properties of the four relations. The properties used in M are shown in Table h for each relation H„. -20- / a <\ c\ -\ e f h g L±J < * HOUSE T *- 02 1 1 L 03 1 1 1 1 "© 1 1 0^ 1 1 & 1 1 02 1 1 02 1 1 03 1 1 1 1 N 03 1 1 0^ 1 1 tk 1 1 Table 5 Validity Matrix M For Transformations Q -23- © L ,A_J^@ PRIMITIVE GRAPH AFTER INFORMATION LOSSLESS TRANSFORMATIONS Figure 5 -2k- © T © L T GRAPH AFTER MODEL DIRECTED PARSING Figure 6 -25- References 1. Schwebel, J. C. and McCormick, B. H. , Consistent Properties of Composite Formation Under a Binary Relation, University of Illinois, Department of Computer Science, Report Wo. 348, August 12, 1969. 2. McCormick, B. H. , Syntax-Directed Recognition of Pictures: A New Theoretical Model, Talk presented at the conference: Emerging Concepts in Computer Graphics, University of Illinois, November T> 1967. 3. Ledley, R. S. and Wilson, J. B. , Concept Analysis by Syntax Processing. Proceedings ADI , pp. 1-8, 1964. -26- AEC 427 U.S. ATOMIC ENERGY COMMISSION e' 68 * UNIVERSITY-TYPE CONTRACTOR'S RECOMMENDATION FOR :M3201 DISPOSITION OF SCIENTIFIC AND TECHNICAL DOCUMENT ( See Instructions on Reverse Side ) EC REPORT NO. 00-1018-1195 2. TITLE Graph Transformations for Composite Formation VPE OF DOCUMENT (Check one): (3 a. Scientific and technical report I I b. Conference paper not to be published in a journal: Title of conference Date of conference Exact location of conference Sponsoring organization □ c. Other (Specify) IECOMMEIMDED ANNOUNCEMENT AND DISTRIBUTION (Check one): [23 a. AEC's normal announcement and distribution procedures may be followed. "2 b. Make available only within AEC and to AEC contractors and other U.S. Government agencies and their contractors. R c. Make no announcement or distrubution. EASON FOR RECOMMENDED RESTRICTIONS: UBMITTED BY: NAME AND POSITION (Please print or type) John C. Schwebel Irganization Department of Computer Science University of Illinois Urbana, Illinois 6l820 ignature ^A. o. *U~«J*4- Date FOR AEC USE ONLY ,EC CONTRACT ADMINISTRATOR'S COMMENTS, IF ANY, ON ABOVE ANNOUNCEMENT AND DISTRIBUTION ECOMMENDATION: 'ATENT CLEARANCE: , O a. AEC patent clearance has been granted by responsible AEC patent group. □ D - Report has been sent to responsible AEC patent group for clearance. I \_\ c. Patent clearance not required. Oct iq/ 3