[Haskell-beginners] slightly scramble list randomly

Dennis Raddle dennis.raddle at gmail.com
Sat Oct 22 19:50:29 CEST 2011


I want to take a list of size N that starts in ascending order and
"slightly randomly scramble it"--- each element is moved within M
steps of its original position (there can be some tolerance for
slightly over M).

The application is a backtracking algorithm that produces random
solutions but tends to favor certain choices--at each node of the
search tree I can evaluate the goodness of each possible next step,
but I don't want the algorithm to always take the best choice. Just
roughly, much of the time.

Dennis



More information about the Beginners mailing list