There's more than one way to do things | |
PerlMonks |
Re: Generic De Bruijn Sequenceby LanX (Saint) |
on Apr 19, 2017 at 22:49 UTC ( [id://1188334]=note: print w/replies, xml ) | Need Help?? |
Did you consult wikipedia or search for other algorithms? Many sources recommend an algorithm from Frank Ruskey , easily found implemented in various languages, here one in Python De_Bruijn_sequence#Algorithm which is not too hard to be ported. Besides: The minimal length k^n is proven to be always achievable. Which consequently means at least your first result and hence your algorithm is wrong.
updateDe Bruijn is supposed to be cyclic!
AAACCCBCCACBBCBACABCAABBBAB
Cheers Rolf
In Section
Cool Uses for Perl
|
|