Member-only story
An improved (fairer) playlist shuffling algorithm
Lots of people find playlist shuffling insufficiently random for a variety of reasons, some of which have been addressed by the industry, and many of which haven’t.
There’s one aspect that my wife and I haven’t seen, though, and that’s making sure that no songs get “left behind” whenever a playlist is reshuffled, whether intentionally or by switching back-and-forth between playlists.
In an attempt to sow seeds, I’ve just put together an example of an improvement that can easily be applied to any of the existing shuffle algorithms.
Motivation:
A shuffler that ensures that no items in a list (a music playlist in particular) are left behind.
Mechanism:
When an item in the current shuffle group is used, it is moved to the next shuffle group and the next shuffle group is reshuffled.
Shuffling the current group doesn’t affect the number of items remaining in the current shuffle group.
Drawback:
Shuffling the current group when there’s only one item remaining will have no effect, the item must be consumed (to preserve fairness) and only then will be shuffled in to the next group