You have a list of candidates, ranked by score. You want to try them out in order, with the better candidates being tried first. However you don't want the process to be deterministic - each run should yield a separate order. And you want even low-ranked candidates to have some chance of being tried early.
Is there a partial sort / partial shuffle which can achieve this?
(The application is a crossword grid filler. I score the words, then try to fit them into the grid. But I want a different grid each time, and I don't want it to be too obvious that words with uncommon letters are never chosen.)
You have a list of candidates, ranked by score. You want to try them
out in order, with the better candidates being tried first. However
you don't want the process to be deterministic - each run should yield
a separate order. And you want even low-ranked candidates to have some
chance of being tried early.
Is there a partial sort / partial shuffle which can achieve this?
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
You have a list of candidates, ranked by score. You want to try them
out in order, with the better candidates being tried first. However
you don't want the process to be deterministic - each run should yield
a separate order. And you want even low-ranked candidates to have some
chance of being tried early.
Is there a partial sort / partial shuffle which can achieve this?
Let me check is I know what you mean. You have a list of words with
scores
12 apple
10 cat
9 dog
8 egg
5 fox
and you want a quasi-sort that might just (but very very rarely)
produce
5 fox
8 egg
9 dog
10 cat
12 apple
but will produce these orderings much more frequently:
12 apple 10 cat 10 cat
9 dog 9 dog 12 apple
10 cat 12 apple 8 egg
8 egg 8 egg 5 fox
5 fox 5 fox 9 dog
? First thought. Have a random field, r, that is chosen from a normal distribution prior to each sort. Then sort by score+r. By adjusting
the distribution's parameters, you will get different probabilities of re-arrangement from almost none (with, say, mean=0, sdev=0.1) to chaotic
when mean=1000 sdev=10000.
Ben Bacarisse <ben.u...@bsb.me.uk> writes:
Malcolm McLean <malcolm.ar...@gmail.com> writes:
You have a list of candidates, ranked by score. You want to try them
out in order, with the better candidates being tried first. However
you don't want the process to be deterministic - each run should yield
a separate order. And you want even low-ranked candidates to have some
chance of being tried early.
Is there a partial sort / partial shuffle which can achieve this?
Let me check is I know what you mean. You have a list of words with
scores
12 apple
10 cat
9 dog
8 egg
5 fox
and you want a quasi-sort that might just (but very very rarely)
produce
5 fox
8 egg
9 dog
10 cat
12 apple
but will produce these orderings much more frequently:
12 apple 10 cat 10 cat
9 dog 9 dog 12 apple
10 cat 12 apple 8 egg
8 egg 8 egg 5 fox
5 fox 5 fox 9 dog
? First thought. Have a random field, r, that is chosen from a normal distribution prior to each sort. Then sort by score+r. By adjustingFirst thought was too fast! You don't really need to change the mean.
the distribution's parameters, you will get different probabilities of re-arrangement from almost none (with, say, mean=0, sdev=0.1) to chaotic when mean=1000 sdev=10000.
0 will do just fine. Changing the standard deviation will change the
degree of mixing.
You have a list of candidates, ranked by score. You want to try them out in order, with the better candidates being tried first. However you don't want the process to be deterministic - each run should yield a separate order. And you want even low-ranked candidates to have some chance of being tried early.
Is there a partial sort / partial shuffle which can achieve this?
(The application is a crossword grid filler. I score the words, then try to fit them into the grid. But I want a different grid each time, and I don't want it to be too obvious that words with uncommon letters are never chosen.)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (2 / 14) |
Uptime: | 38:35:12 |
Calls: | 6,682 |
Files: | 12,223 |
Messages: | 5,343,288 |