0

I understand and have coded the Knuth’s dancing link algorithm for the exact cover problem. What I have a problem with is setting up the options matrix, mainly secondary items.

The problem I am trying to solve is the enumeration of 3-configurations tables.

An orderly 3-configurations table can be view as a 3 by n matrix where the first row is given (with numbers 1 to n). Every other row each n appears once and only once. The numbers in any one column must be different, and these conditions can be set up with primary items. I have done this.

There is an additional condition that I think can be handled with secondary items. The numbers in any pair of columns must be different or have at most one pair of numbers the same. For example, here is a 3 by 8 table. As you can see, columns 1 and 5 have no numbers in common but columns 1 and 2 have only the number 2 in common.

1 2 3 4 5 6 7 8
2 3 4 5 6 7 8 1
4 5 6 7 8 1 2 3

Can anyone help me in showing me how to set up the secondary items for this?

harold
  • 61,398
  • 6
  • 86
  • 164
David
  • 1
  • The sample table did not format correctly. It should be three rows first row with the numbers 1 to 8, second row numbers starts with 2 and the third row starts with 4. I don't if I can edit the question to format the table correctly. – David Feb 28 '23 at 18:28

0 Answers0