|Just another Perl shrine|
Re: Bag uniform distribution algorithmsby LanX (Canon)
|on Oct 27, 2013 at 21:38 UTC||Need Help??|
I'm not sure how "as uniformly distributed as possible" can be qualified ...
Do you have a test-code to check the "quality" of a solution?
But sorting according to a weighting function gives similar results like shown by you.
Changing the weighting function would also allow to repeat the pattern in a way that joined sequences are still equally distributed ( that is A doesn't neighbor A )
An iterator-version shouldn't be too difficult.
( addicted to the Perl Programming Language)
well after second thought it's quite easy to find input where this approach fails ... never mind! :(