Annals of Discrete Mathematics 26 (1985) 137-142 Elsevier Science Publishers B.V. (North-Holland)
137
Algorithms to Find Directed Packings Jeremy E. Dawson
Australian National University Canberra, ACT AUSTRALIA
Abatrsct We discuss computational methods t o find ( t , u , u ) directed packings, i.e. sets of permutations of u symbols such that no t symbols appear in the same order in more than one of the permutations. In so doing, we give algorithms for finding all n-cliques in a given n-partite graF5, and in an arbitrary graph. We ako discuss an algebraic method for finding directed psckings. 1. Introduction
Directed packings are combinatorial structures which are used in the design of statistical experiments and large computer networks (41. A ( t , k , u ) directed packing is a collection of ordered k-subsets, called blocks, of a set of cardinality u having the property that no ordered t-tuple occurs in morc than one block. An ordered t-tuple is contained in a block if its symbols appear, Icft to right, in the block. The maximum number of blocks in a ( t , k , u ) directed packing is denoted DD(t,k,u). If every ordered t-tuple appears once, then we have a 'directed t-design', which is analogous to an ordinary t-design (for t = 2, see, f i x example, [5],(61). However, w e look at the case k = u , where the analogous t design is a single complete block. Skillicorn has conjectured that DD(u-l,u,u) = (u-l)! for all u. This has been shown for u=6 by computer. A programme, described in Scction 2, was written t o find all ways of extending a ( t , u - 1,u- 1) dirccted packing to a ( t , u , u ) directed packing, by inserting the new symbol somewhere in each block. This programme w3s applied to the 190 permutations of (1,2,3,4,5}. In Section 3 we dcscribe an algebraic method of constructing directed packings, which was used in [l] to give results such as DD(5,7,7)563,DD(5,8,8)=18 and DD(5,0,9)S 27.
138
J.E. Dawson
2. The Main Algorithm
Let a (tp-1,u-1) directed packing be given, using the symbols {I,!&...,u - l h we look for a way to insert u somewhere in each block to give a ( t , u , u ) directed packing. Write u =u- 1, calling the original blocks u-block8 and the ricw (extended) blocks u-blocks. Let the given (t,u,u) directed packing have n blocks. We define an n-partite graph G = (V,E)with vertex set V = { ( B , p ) :E a u-block, 1 S p S v ) . Each vertex ( E , p ) represents a potential u-block, got by inserting u into B in position p ; we may refer to this u-block simply as ( E , p ) . We let [(B,p),(C,q)] € E if the u-blocks (B,p) and (C,q) do not have a t-tuple in common (and so may appear together in a directed packing). We now need to find a complete n-subgraph of the above n-partite graph. The algorithm therefore falls into two parts. Part 1: find the adjacency matrix of the graph. For each pair B,C of u-blocks, we determine the positions p and q for which ( B , p )and (C,q)have a t-tuple in common. Such a t-tuple must contain I), so we look for common (t-l)-tuples in B and C. Write 8=1-1. For an 8 tuple (el,c2, . . . ,e,), found in positions (pl,p2, . . . ,p,) in and ( 9 1 , .~. ~. ,q,) ~ in C , ( B , p ) and (C,q)have a common t-tuple for o < P s p l and O i ) are consequently no longer possible (“barred”). Further, if setting pi cause%all values for some pi to be barred then pi must be changed. Of course, when we reset pi, we must remove all bars on pj(j > i ) resulting from the former value of pi. Thus the following algorithm was used. Actions described other than by elements of PASCAL code or by using
Algorithms to find direrted packings
subscripts are quoted; programme is available.
{...I
denotes a comment.
139
The complete PASCAL
procedure cvv {change vertex vector at place i} ; procedure reset(p) {reset bars according t o new setting pi = p} ; begin for i := i + l to n do begin possible = false ; for q := 1 to u do if bar[j,q]=O or bar[j,q]W then begin if adj[Bi,p,Bi,q] then begin bar[j,q] := 0 ; possible := true end else bar[j,q] :=i ; end ; if not possible {no value for p i , so must change pi} then goto 3 end end {reset} ; begin “let S = {p: pi < p S u , bar[i,p]=O)” if “ S = 0 ” then i := i-1 ; else begin pi := “min(S)” ; if i = n then “output vertex vector” else begin reset(p;) ; i := i 1 ; pi := 0 end end ; 3 : end {cvv} ; begin for i := 1 to n do for p := 1 to u do bar[i,p] :=0 ; i := l ; p j := 0 ; repeat cvv until i = 0 end.
+
A further refinement, useful if the graph has many edges, is t o have all[Bi,Bj]=true if the induced subgraph with vertex set BiUBj is complete bipartite, and replace the second line of procedure reset by
+
begin for j := i 1 to n do if not all[Bi ,Bj] then begin The idea of this refinement was incorporated into a method we used to save storage space. In the probIem of packings, if we regard u-blocks B and C as permutations of (1,2, ...,u}, then adj[B,i,C,j] = adj[l,i,CB-’, j] (I being the identity permutation), and so we need store only a &dimensional array, plus a table of quotients of permutations. We put a zero in this table, quot[B,C]=O, where B and C have no common e-tuple and so no (B,p) and (C,q) could have a common t-tuple; otherwise quot[B,C]=CB-’.
140
J.E. Dawson
The programme was run, with the 120 permutations of {1,2,3,4,5}, to examine the conjecture that 0 0 ( 5 , 6 , 6 ) = 5! It was stopped after about 10000 solutions had been found, when about 1/20th of all possible vertex vectors had been scanned. Probably, therefore, there is a large number of non-isomorphic solutions. By arguments simiiar to those in 111, the number of occurrences of a given symbol in positions ( 1,2,...,6) may be (18,30,0,40,10,22), (19,25,10,30,15,21), (20,20,20,20,20,20), (21,15,30,10,25,19) or (22,10,40,0,30,18). Solutions were found with the numbers of occurrences of the various symbols in position 1 being {20,20,20,20,20,20}, {18,20,20,20,20,22}, {18,19,20,20,21,22}, {18,19,19,21,21,22}, {18,19,20,21,21,21} and {19,19,19,20,21,22}.
3. An Algebraic Method Some other packings were found using an algebraic method. Let the u symbols be the elements of a group C , here written additively (though not necessarily abelian). We look for packings which, whenever they contain a block B = {61,62,...,6u}1 also contain B+g = {b,+g,62+g, ...,6,+g}. To ensure that a system with this property is a (t,u,u) directed packing, it is enough to check that no t-tuple starting with a given symbol is repeated. (In practice, we considered the “initial” block B, and derived any such t-tuples in B+g directly from B.)A similar method is used by Mills in finding BIBDs [3]. We look for a packing which is a disjoint union of as many {B+g:g€G} as possible. The following procedure was used. 1. For each permutation B = {6~,b21...,bu}1 construct {(e2-e1,e3-el, ...,e,-el) : (e1,e2, e,) is a t-tuple of (0,e2-e1,e3-el, ...,e,-el) is a t-tuple in B - e l ) .
...,
lit B} (since the
2. For each pair B,C of permutations of G compare their lists, setting adj[S,C] := true if they do not intersect. We now have a graph with vertex set the permutations of C , and edge set {[B,C] : {B+g:g€C} U {C+g:g€C} is a directed packing} of wbich.we want the largest complete subgraph. A recursive procedure was used for this, starting with a list of (vertices of) complete subgraphs of order 2. 3. For n = 2,3,... , do the following, which gives a lit of n + l - cliques (complete subgraphs of order n + 1) from the list of the r?.-cliques. Take the list of n-cliques, in which the vertices of each n-clique are listed in ascending order, and the n-cliques are listed in increasing lexicographic order. Consider this list in segments, each segment bcing the set of graphs differing only in the last
141
vertex. for the segment {{u1,u2,...,u,,-i,wi} ; :=1,2 ,...,m } do for i := 1 to m - 1 do for j := i + l to m do if adj[wi,wj] then write (ul,u2,...,u,,-1,wi,wj) {onto the list of n -I- 1-cliques}. We now have a list of n + 1-cliques in lexicographic order. This approach was taken further by considering a group A of automorphisms of G . An initial block B = ( b l , b 2 , ...,bu} gives rise to blocks B(B+g) = {B(b1+g),B(b2+g),...,B(b,+g)} for each g b C and #€A. If the stabilizer in A of 0 has p orbits on G\{O}, then we need only ensure that no t tuple whose first symbol is 0 and whose next different symbol is one of a given set of representatives of these orbits is repeated. For example, where G and A are the additive and multiplicative groups of a field, then we need only check t tuples whose first symbol is 0 and whose first non-zero symbol is 1; furthermore, in this case each t-tuple of B gives rise to exactly one such t-tuple in some block B(B+g). This method has been used to find lower bounds for some values of DD(4,u,u) and DD(5,u,u); the actual G and A and the results are reported in 111. More generally, we could consider any group of permutations acting on the set of symbols, and use the transitivity structure of G to simplify the task of ensuring that no t-tuple is repeated. St!ch a technique is used by Mills t o find block designs [2].
REFERENCES J.E. Dawson, J.R. Seberry and D.B. Skillicorn, “The directed packing numbers DD(t ,u,u)”, Com6inatorica, to appear. W.H. Mills, “A new 5-design”, At8 Combinatoria 6 (1978) 193-195. W.H. Mills, “The construction of balanced incomplete block designs”, Proceedings of the 10th Southeastern Conference on Combinatorics, Graph Theory and Computing, Congressus Numerantium 23 (1978) 73-86. D.B. Skillicorn, “Directed packings and coverings with computer applications”, Ph.D. thesis, University of Manitoba, 1981. D.B. Skillicorn, “Directed coverings and packings of pairs and qJadruples“, Combinatorisl Mathematics JX, Lecture Notes in Mathematics 952 (Springer-Verlag 1982) 387-391. D.J.Street and J.R. Sebetry, “All DBIBDs with block size four exist”, Utilitas Mathemotica 18 (1980) 27-34.