h 14P6/175 f i ' PRACE co PAN • cc PAS REPORTS Oooo2 1 5 5 b ^ “ " o o o « o OOOM oo#oo 00* 0« 00990 00999 omooo 09009 Variaits of file organization for a family 09099 of threo sets oteoo 09909 09990 ______t75 1974 OOOO WARSZAWA

O O O w CENTRUM OBLICZENIOWE POLSKIEJ AKADEMII NAUK COMPUTATION CENTRE POLISH ACADEMY OF SCIENCES 00*0 PKIN, P. O. Box 2 2,

Witold Lipski

VARIANTS OP PILE ORGANIZATION POR A PA1CELY OP THREE SETS

175

Warsaw 1575 Komitat Redakcyjny

A. Blikle (przewodniczący), J. Lipski (sekretarz), L. Łukaszewicz, R. Marczyński, Ł. Mardoń, A. Mazurkiewicz, Z. Pawlak, Z. Szoda (zastępca przewodniczącego), M. Warmia

Pracę zgłosił Zdzisław Pawlak

Mailing adirees« Witold Lipski, Jr ul. Afrykańska 14P 14, 03-946 Warszawa

Ob)ic

o PA.

b Ina.

Printed as a nanuscript Ba prawach rękopisu

Bakład 700 egz. Ark. wyd. 0,75 ark. druk. 1,00. Papier offset. kl. XH, 70 g, 70 x 100. Oddano do druku w październiku 1974 r. W. D. B. Zam. nr 733/O 1 Abstract . CojepxaHHe • Streszczenie

In the paper the following combinatorial problem related to file organization is considered: given three sets find an arranging of X such that each is a segment (cf.t3l). Certain theorems concerning a file organization introduced by Ghosh [21, which are connected with the above problem, are also proved.

BapHaHTH opraHH3anHH MHOsceciBa Aawmtx

b ciyqae ceMeRciBa Tpex u b o z s c t b

B paCoie paccuaipHBaeTca npoójtewa KOMÓHHaiopHKH, cbs- 3aHHaa c opraHH3anne$ MHOxeciBa flammx, a mieHHo: no AaHiaai ipeii MBoxecTBau M ^ Mg, Mg » 1 BaflTH TaKoe ynopaflO^ieHHe MHoatecTBa X, ^to6bi Ka^woe mbokoctbo M npe,ncTaBJiajio codofi 0ipe3OK /cpaBBH c [3J /. ,D,0Ka3HBaeTCB TaKJKe aeKOTopaa ieo- peiia, cBS3aHKaa c BmneyKa3aHHoM npoCjreMOfi, a HMeBHO leopeua o opraHH33JJHBj npeAJioseHBoft romeu [2] •

Warianty organizacji zbioru danych dla rodziny trzech zbiorów

W artykule rozważany jest następujący problem kombinato- ryczny związany z organizacją zbioru danych: mając dane trzy zbiory M^Mg.MjSX znaleźć takie uporządkowanie zbioru X, by każdy zbiór był odcinkiem (por. [3]) . Udowodnione są również pewne twierdzenia związane z powyższym problemem doty­ czące organizacji zaproponowanej przez Ghosha [23.

§0. Introduction

Let X be the set of objects (records) of an information storage and retrieval system (see [7]) and let rifl£lP(X) be a family of subsets of X. We want to define a partial function Ss X —*X in such a way that each M e'TTl is a segment, i.e.

M = [x,S(x),...,S|M|-1(x)J for an x£ X. By imposing certain restriction on S we define different classes of admissibility, in particular the classes of admissible, linear, cyclic, acyclic families of subsets of X, denoted by Adm(X), JL(X), ^( X ) , Ji(X) respectively (cf. ( 3,4,5]). Pile organizations based on this theory were considered , in the linear case, by Ghosh [1] and, in the general case, by Lipski and Karek C5.6] and Lipski [3,4]. These file organiza­ tions will be referred to as one-dimen3ional (1D), as opposed % " to two-dimensional (2D) organization proposed recently by Ghosh [2], as an extension of [1].

In the present paper only the case '7Y1 = is dealt with. We give, in §1, necessary and.sufficient conditions for to belong to different-classes of admissibility. Then, in §2, 2D organizations are considered. For each class of admissibility, its 2D analogon is defined, and certain theorems are proved, which extend a result of Ghosh [2, Theorem 4].

For definitions and notation the reader is referred to C3l, 0 3 » or [5]. - 6 -

§1. One-Dinensional Organizations

In this section we give necessary and sufficient conditions for a family £ TP(X) to be in certain classes of admissibility. We shall always assume that Mgu Mj = X and denote = Xs-For the reasons which are explained in details in [j] it is sufficient to consider (in proofs) on­ ly the families *^2» satisfying the following two conditions:

(i) Each component of 'lift either consists of one element or is empty. (ii) The set of non-empty components of 9?7 is maximal possible for a class of admissibility under considera­ tion (for other families we obtain appropriate f-graphs by contraction).

7/e shall call such families basic. Let us recall (cf. Q6]) 9 that for a given Iffl^TP (X), two f-graphs ^X,S^> and are essentially different iff there is no bisection :X — *■ X satisfying the following two conditions:

(i) (\^/ x,y£ X ) ( e S1 <---- < £ S 2 ), i.e. cp is an isomorphism between and .

(ii) M 6 7TZ) cf(M) 6 TT t , i.e. ^ is an automorphism of .

Theorem 1.1. ( Lip ski and Uarek 16]) Each family { , Mj} is admissible. The unique four essentially different f-graphs realizing the admissibility of a basic family are depicted in Fig. 1. I - 7 -

Fig. 1. The f-graphs realizing the admissibility of {U^.Ug.M

Theorem 1.2. A family {M^MgjM^} is acyclic iff

IjnMjrtllj = ? » = 0 (1)

The uni e three essentially different f-graphs realizing the acyclicity of a basic family are depicted in Fig. 2.

Proof: If (1) does not hold then there exist 6 Hj n Mg o , Xg £ EjoMjaMj, Xje M1 a Mgn toy The contrac­

tion {•*i»M2>M3} ^ XltX2fX^ = £{x2'x3 M x1»x3l‘£x1>x2?} is evidently non-acyclic, hence {M^.Mg.Mj} is also non-acyclic ( contraction preserves the acyclicity, cf. C 3l) • The proof of the uniqueness is left to the reader. I Let us notice that (1) is equivalent to

Mg a M ^ C v M/| a Kj 9 Mg v M^ n M2 ^ M^ ( 1 )

hence a family of three sets is acyclic iff one of them contains the intersection of the two others. - 8 -

Pig. 2. The f-graphs realizing the acyclicity of {1L,,Mg, .

Theorem 1.3. A family {M^Mg.Mj} is cyclic iff at least one of the following two conditions is satisfied:

llj A MgO = 0 (2) M^AMgAMj = 0vM^rtMgAMj = 0vM^AMgAMj = 0 (3)

There are two non-isomorphic types of basic families, and two essentially different f-graphs (one for each type) realizing the cyclicity of a basic family, see Fig. 3*

Proof: If neither (2) nor (3) holds then there exist

X q C KL, ^ Mg a , x>| f a Mg a ^ ^1 ^ ^ a M ^ , £ IL| ^ Mg a M ^ .

The contraction {1L, ,Mg,M?}| £XqjXi ,Xg,Xj} = ’fx0 ,x2 ^ ' ^ O » ^ is evidently non-cyclic, hence {u^,Mg,MjJ is also non-cyclic (contraction preserves the cyclicity, cf. [3])> And so at least one of the conditions (2), (3~) must be satisfied if fit],Mg,Mj} is cyclic. The easy proof of the uniqueness is omitted. 8 - 9 -

II

Fig. 3. The f-graphs realizing the cyclicity of {iL^Mg.Mj}.

Let us notice that (3) is equivalent to

M1cM2 uM? v M2SM1uM3 v M ^ s W ^ u M g , hence a family of three sets is cyclic iff either its intersec­ tion is empty or a certain set is contained in the union of the two others.

Theorem 2.4. A family [M^.Mg.Mj} is linear iff at least one of the three conditions is satisfied:

M1C M 2 v Mg<= Mj v il^Mj v MgCiC, v MjCMg v MJ C M 1 (*) M1 n Mg = 0 V Mg/-» Mj = 0 v M? n M1 = 0 (5) Mg S M1 £ Mg u v n M? £ Mg S M_1 u M ^ v M1r>M2cMJcM1uM2 (6)

There are three non-isomorphic basic families and four essen­ tially different f-graphs (two for the case (4)) realizing the linearity of a basic family, see Fig. 4.

Proof: If our family is linear, then it is acyclic and cyclic. We obtain the conditions (4), (5), (6) by combining (1) with (2), (3) • The uniqueness is easy. I

In other words a family of three sets is linear iff one of them is contained in another one, or two of them are disjoint, Fig. 4. The f-graphs realizing the linearity of or one of them contains the intersection of the two others and. is contained in their union.

By Theorem 2.4. a family of three sets is linear iff it is cyclic and acyclic, though for arbitrary families it is not true (see [>]).

§2. Two-Dimensional Organizations

The idea of 2D organization is due to Ghosh [2]. In this section we give a definition of 2D organization which is more general than that in [2]. To each class of admissibility ^ (X) p its 2D analogon X (X) will be defined. The organization of Ghosh [2"] corresponds to the class <£2(x).

Let rKTl

(f.L/Wl corresponds to the disjoint incidence domains condi­ tion in [2]s if x,y are in the same secondary array, i.e. f(x) = f(y), then there is no lliTT^ with x,yf ll), We define a family f (7n)£

Definition 2.1. Let rïf l Ç. V(X) and let X ( x ) be a class of admissibility. TTC 6 $ 2(x) iff there is a positive integer n and a function f: X — > {l,2,...,n} such that f -L and f (7Tt)€ ÎJC({i ,2,... ,n}).

Each class *X2 (X) contains ^K-(X), in general properly. Indeed, if then we can take as f an arbitrary one-to-one function f: X > £1 ,2,..., |X|} . The structure of 2D classes of admissibility ^K2(x) seems to be much more complicated than that of (x ) . In the 1D case the fact that QflTL £ yC(x) depends only on which components of rf f i are empty (cf. [32) . We saw it in Section 1: the conditions (1) - (6) state (or can be rewritten to state') that cer­ tain components of {iLj.UgjMj} are empty. As oppose to this, we shall see that in the 2D case also the cardinalities of components are involved. The fact that if 'XXX ^ ÎK2 (X) and CÇX, then the trace of rï f l on C (cf. [3,4]) need not be in ^ 2(C) is also a bit troublesome.

Now we shall give conditions for to be in certain classes ^¿2 (X). The first of them extends a theorem of Ghosh [2, Theorem 4^ . - 12 -

Theorem 2.2. A 2D linear organization for exists (i.e. (id, ,1^,1*,}€ JC-(X)) if and only if

ll^n l^n¥,| £ lUj'iV IM2o v | M, n M1 n y2 1 i I M7 n M1 A »¡21 (7)

Proof: First we shall prove the "if" part. If (7) holds then there exist sets = A, = B, = C ( i^.ig.ij is a permutation of 1,2,3) such that I An Bn Cl 4 I An Bn Cl ( con­ sequently there is a set D £ AnBnC with |D| = |AnBnCI. The required 2D linear organization isthen as follows:

Fig. 5. A 2D linear organization for {M^,

Clearly some of the components indicated in Fig. 5* can be empty. Now we shall prove the "only if" part of the theorem. Let us suppose that (7) does not hold and a 2D linear organiza­ tion for our family exists. Then | IL] n Ug n 1! j I > IM^nMgnMjI. 3y disjoint incidence domains condition ( cf. [ 2l) each ele­ ment of JLj n Kg n can occur in only two ways in our orga­ nization - forning a secondary arrey alone or with an element of Uy Since I r \ Mg '» M^ I > IKLj n n M^l , there must be at least one secondary array consisting of a single x^ £ LU, o Ky 3y the same reasons there exist secondary arrays consisting of a single x2 6 n r\ M, and of a single Xj ç M^| a JJg o Mj. Since the deletion of any number of secondary arrays does not destroy a 2D linear organization, we can dele­ te from our organization all the secondary arrays except of the three ones mentioned above. The resulting organization is in fact a 1D linear organization for the family^[x^.ig],fxg,xj}, {x^,xj3J. This contradiction (the above family is not linear) completes the proof. 1

Theorem 2.3. Every family ,Mg,Mj} admits a 2D cyclic organization (i.e. every [M^Mg.Mj} is in c€ 2(x)) .

Proof: First of all notice that £ 2 (x) C ^ 2(X) - every 2D linear organization can be easily converted into a 2D cyc­ lic organization. Hence, in virtue of Theorem 2.2., we can res­ trict ourselves to the case when (7) does not hold, i.e. we may assume that | M^ n Mg n M ^ I > | M^ O Mg n M^ | and |MgOMjnM1l > iMg/"« M^nM^ and |M? r> M1 ^Mgl > |M? n n Mgl Then the required 2D cyclic organization is as follows:

Fig. 6. A 2D cyclic organization for {tLpMg.Mj}. - 14 -

The 2D cyclic organization can be used for rotating memories as drums or disks.

IIow we shall consider the class

Theorem 2.4. /l(i) Q oC2(X), i.e. each (1D) acyclic family is 2D linear.

Proof: Let an f-graph realize the acyclicity of a family “Wt £ TP(X). We define a function f as follows:

f(x) = min{k>0: Sk(x)£ 2)s}.

It is easy to see that t J.'T fl and that for each M6 'Y T l f (M) is a set of consecutive integers. Hence f i s linear and m f X 2 (x). ■

Theorem 2.5. A 2M = oC2(x).

Proof: It is obvious that Now let us assume that . Then there is a function f: X — >{l,2,...,n} such that f -L W and f (TTl) € v/l(£l ,2,... ,n}). In virtue of The­ orem 2.4. f(7J7)f £ 2 ({l,2,...,n}). Let us take an arbitrary 2D linear organization for f (7fl) and replace each its secon­ dary array A by f-1 (a) = J x f X: f(x)e a}. It is easy to see that we obtain a 2D linear organization for /Y T l.

Ac know 1 e dprme nt

The autor would like to thank Dr. W. Karek for his valuable suggestions. References

[11 Ghosh, S.P. Pile organization: the consecutive retrie­ val property. Comm. ACM 15(1972), pp. 802 - 808.

[2] Ghosh, S.P. Pile organization: consecutive storage of relevant records on drum-type storage. Information and Control 25(1974), pp. 145 - 165.

[?3 Lipski, *. Information storage and retrieval systems - mathematical foundations II. CC PAS Reports, No. 153, Warsaw 1974.

[43 Lipski, W. Combinatorial aspects of information storage and retrieval. The Third Symposium on Mathematical Foun­ dations of Computer Science, Jadwisin 1974, Springer-Ver­ lag, to appear.

[5l Lipski, W., Marek, W. An application of graph theory to information storage and retrieval. Bull. Acad. Polon. Sei., Ser. Sei. Math. Astronom. Phys. 22(1974), to appear in No. 7.

[63 Lipski, W., Marek, W. File organization, an application of graph theory. Automata, Languages and Programming (Proc. Collq., Saarbrücken, 1974), pp. 270 - 279- Sprin­ ger-Verlag, Berlin - Heidelberg - New York 1974.

[73 Marek, W., Pawlak, Z. Information storage and retrieval systems - mathematical foundations I. CC PAS Reports, No. 149, Warsaw 1974. Ir 152 - X. K. Nowicki, J. M. Sochackii Programowania w «y«ta­ ni* SPEC-ODRA, 1974 Ir 153 - «. Lipskit Information storage and retrieval eyetan. Mathematical foundations. Part II, 1974 Ir 154 - K. Bulaszkiewiczt Maszyny abstrakcyjne se strukturą, 1974 Ir 155 - J. Martinek, M. Stroińskii Kompilator Języka LISP 1.5» 1974 Ir 156 - A. Matuezewskli Probability space as rslational structure, 1974 Ir 157 - J. Chodorowski, J. Karczewski, M. Mlchalewloai Automatic correction, 1974 Ir 158 - A. Krepski, B. Rykaczewskat normalizacja P-programów, 1974 Ir 159 • A. Dębska, Z. Szodat 0 pewnej metodzie rozwiązywania zagadnień brzegowo-początkowych, 1974 Ir 160 - R. Marczyński, V . Pulczyn, J. Sochacki« Język OSM. Aspekty wyboru Języka do symulacji sprzętu, 1974 Ir 161 - A. Michalski! Drzewiaste struktury informacyjne w algorytmach syntezy logicznej, 1974 Ir 162 - P. Jarosińska, L. Łukaszewicz, B. Rykaczewskat Język MOL. Część I. Definicja Języka, 1974 Ir 163 - P. Jarosińska, Ł. Łukaszewicz, B. Rykaczewskat Język MOL. Część II. Przykłady programów, 1974 Ir 164 - P. Jarosińska, L. Łukaszewicz, B. Rykaczewskat Język MOL. Część III, 1974 Ir 165 - Z. Bień: The star measure of regular events. Part I, 1974 Ir 166 - Z. Bieńt The star measure of regular events. Part II, 1974 Ir 167 - V. Żakowskit n-Dimentional simple continuous Z-machines, Zvcomputable functions and Z-computable eats, 1974 Ir 168 - I. Babiałek, V. Żakowskit On the properties of some one-to-one mapping (0j1 x(0;1 — (0j1 , 1974 Ir 169 - A. Blikle: An extended approach to mathematical analysis of programs, 1974 Ir 170 - V. Żakowskit On some generalization of the notions of a discrete and continuous machine, 1974 Ir 171 - M. Iglewski, M. Kuta, S. Matwint Mobilny system programowania, 1974 o#oo# ooooc$ O ' .* í r ' • • • • o O0 000 00000 •#o#oOOMO O 0 O 0 O @ 00*0 0 0 0 * 0 •••00 ^..} 0 # •otoo oo#oo ••000 o#ooo •0000 00000