• No results found

A CLUMSY ALGORITHM

[email protected] ABSTRACT

5. A CLUMSY ALGORITHM

Let us consider Problem 1 with the data (U, F ), where

U = {1, . . . , n} is the given ground set and F = {A1, . . . , Am}

is the given family of subsets of U . Let I be the incidence matrix associated with the data (U, F ), that is, the cell at the intersection of the i-th row and j-th column contains one if j ∈ Ai. We try to construct a partition P ⊆ F of

U . Initially we set P = ∅. In a typical case we choose an Ai∈ F that is disjoint to each member of P . Setting

U = U \ Ai, F = F \ {Ai}, P = P ∪ {Ai}

we end up with a new smaller instance of the problem. In the course of this reduction we check many times if given sets Aj, Aj ∈ F are disjoint or not. The adjacency

matrix M of the graph Γ contains these pieces of information and they do not change as the computation unfolds. The dancing link algorithm we propose is not as sophisticated as Knuth’s dancing link algorithm. We call it the clumsy version.

A row operation is the following. Given a row. We go through the entries of the row moving from left to right starting at the frame entry and link out the entries vertically. One can completely reverse the result of a row operation by going through the entries of the row moving from right to left starting at the frame entry and link in the entries vertically. Let us call this operation a reverse row operation.

A column operation is the following. Given a column. We go through the entries of the column moving from up to down starting at the frame entry and link out the en- tries horizontally. One can completely reverse the result of a column operation by going through the entries of the col- umn moving from down to up starting at the frame entry an link in the entries horizontally. Let us call this operation a reverse column operation.

A row pivot operation is the following. Given a set Ai∈ F .

We go through the entries of the horizontal frame moving from left to right starting at the corner of the frame. The entries in the horizontal frame correspond to elements of the ground set U . If the entry in the horizontal row corresponds to the element u ∈ U and u ∈ Ai, then carry out a column

operation. Finally place the index i to a stack. One can completely redo the result of a row pivot operation restoring the original conditions. Pick up the index i from the stack. Go through the elements of Ai in reverse order. If u ∈

Ai, then link in horizontally the entry corresponding to the

element u and carry out a reverse column operation. Let us call this operation a reverse row pivot operation.

A column pivot operation is the following. Given a subset

Ai ∈ F . The row corresponding to the subset Ai is called

the pivot row. We go through the entries of the vertical frame moving from up to down starting at the corner of the frame. The entries in the vertical frame correspond to members of the family F . If the entry in the vertical frame

∈ F and A ∩ A = ∅, then carry out

of the adjacency matrix M of the graph Γ what we store.) One can completely reverse the results of a column pivot operation to restore the original situation. In order to do this pick up the j indices from their stack one by one and carry out a reverse row operation in connection with the j- th row. (Remember that the j indices are stored in reverse order in the stack.) But in fact we do not wish to restore the original situation completely. We want to delete the pivot row from the table. We can achieve this simply by carrying out a row operation in connection with the pivot row. Let us call this operation a reverse column pivot operation.

Suppose that we are given an instance (U, F ) of Problem 1. Based on the branching factors we locate a member Ai

of F . Using Ai we carry out a row pivot operation then a column pivot operation on the incidence matrix and we end up with a smaller instance of the problem.

The clumsy algorithm is not faster than the more sophis- ticated version and for the adjacency matrix M and for the stacks it requires more storage place. The only reason we mention it that it handles the information relegated to the secondary columns in a more flexible manner. As a matter of fact the clumsy algorithm does not need secondary columns at all. For example the information that the sets Ai, Aj∈ F

cannot be together members of a partition P ⊆ F of U can be incorporated into the problem simply changing an entry in the adjacency matrix M from one to zero. This modifi- cation can be done at any phase of the computation. The parallel computations greatly benefit from this larger flexi- bility.

In order to get some idea of the sizes of the instances one can handle we would like to mention two computational results briefly. They are published in [6] and [7], respectively. In the first one the initial data can be characterized by the next numbers |U| = 37 = 2187, |F | = 37 = 2187, k = 35 = 243. This means that the search tree had 243 levels. All exact k-covers were required for inspection. There were 158 760 solutions altogether.

In the second instance the summary statistics of the initial data is the following |U| = (10)(132) = 1690, |F | = 133 = 2197, k = 132 = 169. Therefore the search tree has 169 levels. All exact k-covers were needed for inspection. There were about 5× 107 solutions.

6. CONCLUSIONS

To each instance (U, F ) of the exact cover problem a graph Γ, the packing graph of the instance, can be associated. Cer- tain edges of Γ can be deleted without changing the number of partitions of the ground set U . This information can be conveniently incorporated into the secondary columns of the initial data of the exact cover instance. This speeds up the computations. We discuss how a dominance concept helps to detect deletable edges in Γ and then how to condense the resulted secondary columns by using greedy coloring. This idea works for each exact cover problem. For exact k-covers further speed up is available also based on greedy coloring. We may refer to these as preprocessing ideas.

The paper also deals with parallel exact cover algorithms. The first one is based on the concept of splitting partition of the instance (U, F ). This can be applied for solving each exact cover problem. The second parallel algorithm can be

graph Γ in the memory of the computer during the whole computation in order to retain a greater flexibility for this last type of parallel algorithm.

7. ACKNOWLEDGMENTS

The author would like to thank Istv´an Kov´acs for his help in presenting the paper and L´aszl´o K´or´odi for his help in the computations.

8. REFERENCES

[1] P. Kaski, P. R. J. ¨Osterg˚ard, Classification Algorithms

for Codes and Designs, Springer-Verlag Berlin

Heidelberg 2006 pp. 145–154.

[2] D. E. Knuth, Dancing links, in Millennial Perspectives

in Computer Science, J. Davies, B. Roscoe, and J.

Woodcock, Eds., Palgrave Macmillan, Basingstoke, 2000, pp. 187–214.

[3] R. Carraghan, P. M. Pardalos, An exact algorithm for the maximum clique problem, Operation Research

Letters9 (1990), 375–382.

[4] P. R. J. ¨Osterg˚ard, A fast algorithm for the maximum clique problem, Discrete Applied Mathematics120 (2002), 197–207.

[5] P. R. J. ¨Osterg˚ard, S. Szab´o, Elementary p-groups with the R´edei property, International Journal of

Algebra and Computation17 (2007), 171–178.

[6] S. Szab´o, Nonfull-rank factorizations of finite

elementary 3-groups, International Electronic Journal

of Algebra3 (2008), 96–102.

[7] S. Szab´o, Verifying R´edei’s conjecture for p = 13,

Mathematics of Computation80 (2011), 1155–1162.

[8] E. Tomita, T. Seki, An efficient branch-and-bound algorithm for finding a maximum clique, Lecture Notes