A
A
akass2015-12-08 16:31:26
Programming
akass, 2015-12-08 16:31:26

Do you need a heuristic algorithm for filling the table or is there a regular one?

Tell me which way to think.
You need to come up with an algorithm for filling the table.
It is necessary to fill in the required cells so that N cells are filled in each row, M cells are filled in each column, and each random pair of cells is repeated in two rows.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mrrl, 2015-12-08
@Mrl

We can immediately say that the number of columns in the table is L=M*(N-1)/2+1, the number of rows is K=M*L/N. Both of these numbers must be integers.
In the particular case when N=q+1, M=2*(q+1), where q is a prime number or a prime power, a matrix can be constructed, in which each row will occur twice, and the upper (and lower) half of the matrix will be the incidence matrix of a finite projective plane. In other cases - I'm afraid that heuristics are needed, or even a complete enumeration. After all, this turns out to be a covering problem - you need to cover twice the set of edges of a complete graph with L vertices with disjoint graphs with N vertices. The property "in each column M cells" will be executed automatically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question