Implement Spotify's shuffle algorithm?

Feature description:

Taking heavy inspiration from:

The author has implemented a functionality called as Smart Shuffle which closely follows Spotify’s algorithm of shuffling.
https://engineering.atspotify.com/2014/02/how-to-shuffle-songs/

What this feature will achieve is to complement dynamic/smart playlists where instead of using the default shuffling algorithm implemented the user could instead influence the shuffling based on tags so that let’s say two album artists/circles (if the user bases their shuffle on the album artist/circle tag) do not end up next to each other and instead spaced out. Based on what the user decides it can shuffle based on artists, album artists or etc.

Problem solved:

It allows users to space out tracks in a way that, if two consecutive tracks share matching tags, they are played with an even gap between them, preventing the user from feeling any repetitiveness.

Brought benefits:

Since many users are familiar with Spotify’s shuffle algorithm, I believe offering it as an option in Symfonium, rather than replacing the existing shuffle algorithm, would provide users with more control. This way, they could shuffle based on specific tags and even space out the tracks, ensuring a more balanced playback without consecutive tracks playing in a row.

Other application solutions:

 

 

Additional description and context:

 
In the current Git repo, users can control which tag the smart shuffle should operate on, but the spacing between tracks is managed by the script. It might be worth considering exposing the spacing functionality so that users can adjust how far apart tracks with the same tags appear. However, I’m unsure how exposing the spacing logic would benefit the user experience.
 

Screenshots / Mockup:

    

Sorry for the broken link

Have you read Mixes, Radio, Shuffle, Shuffled, ... What the random ?

Hello, this seems to closely resemble this feature request

But it only applies for albums or track artists, what if I want to space out circles/album artists evenly? Perhaps a choice for the user to decide which tag they want to base their shuffling around on?

I’m sorry but current solutions already covers 99% of the needs and can’t justify the complexity of dealing with another setting.

I guess with the support structure implemented it might be difficult to implement an option to instead shuffle artists/albums it could shuffle based on year, circles, play count and etc.?