Knuth Algorithm

  • #1
woundedtiger4
189
0
Hi all, at http://en.wikipedia.org/wiki/Knuth's_Algorithm_X in the example I don't understand that why not "A" is in the final solution & only B, D & F are in the final solution whereas "A" was selected at Level 1
 

Answers and Replies

  • #2
woundedtiger4
189
0
[STRIKE]bump[/STRIKE]

plus why at the level 1 the branch containing "D" (i.e. containing 0, 1, 1, 1 in columns 2, 3, 5 & 6) was terminated unsuccessfully?
 
Last edited:
  • #3
NemoReally
188
1
Hi all, at http://en.wikipedia.org/wiki/Knuth's_Algorithm_X in the example I don't understand that why not "A" is in the final solution & only B, D & F are in the final solution whereas "A" was selected at Level 1

[STRIKE]bump[/STRIKE]

plus why at the level 1 the branch containing "D" (i.e. containing 0, 1, 1, 1 in columns 2, 3, 5 & 6) was terminated unsuccessfully?

The intent, as far as I understand it, is to find a combination of rows that include every number from 1 to 7 but where each number only occurs in at most one row.

The algorithm seems to work by picking the row (A) that has the most numbers in it and then trying to find a combination of the other rows that have the numbers that aren't in A.

Having selected A (in this case), it proceeds by removing any sets that have a number in common with A (in this case, B,C,E and F). This is because any combination of B,C,E or F with A will have at least one multiple of '1', '4' or '7'. This only leaves row D as a possible match for A.

However, row D doesn't contain a '2' and neither does A, so the combination of A and D is not an exact cover, hence the algorithm terminates and goes to test for another combination.

NR
 
  • #4
woundedtiger4
189
0
The intent, as far as I understand it, is to find a combination of rows that include every number from 1 to 7 but where each number only occurs in at most one row.

The algorithm seems to work by picking the row (A) that has the most numbers in it and then trying to find a combination of the other rows that have the numbers that aren't in A.

Having selected A (in this case), it proceeds by removing any sets that have a number in common with A (in this case, B,C,E and F). This is because any combination of B,C,E or F with A will have at least one multiple of '1', '4' or '7'. This only leaves row D as a possible match for A.

However, row D doesn't contain a '2' and neither does A, so the combination of A and D is not an exact cover, hence the algorithm terminates and goes to test for another combination.

NR

thank you sooooooooooo much, you really helped me in understanding it.
 

Suggested for: Knuth Algorithm

Replies
10
Views
1K
  • Last Post
Replies
0
Views
328
  • Last Post
Replies
0
Views
335
Replies
6
Views
546
Replies
0
Views
396
  • Last Post
Replies
1
Views
452
Replies
30
Views
2K
  • Last Post
Replies
4
Views
651
Replies
0
Views
493
  • Last Post
Replies
7
Views
666
Top