You might find this interesting: https://gitlab.com/ondrejfoltyn/nunti
Here's how its algo works https://gitlab.com/ondrejfoltyn/nunti/-/issues/28