Anyway, if the acoustic is dry and you want to play legato, for example, you can end up choosing to use a fair number of finger substitutions and to use thumbing [1] in order to avoid some gaps between notes – which goes to show that the choice is both a function of artistic interpretation as well as locale, on top of comfort or efficiency.
I believe (but I may be misremembering) that in some historical practices, as well, there are fingering practices deliberately chosen so as to naturally create phrasing (e.g. try playing a scale as evenly as possible with just fingers 2 and 3 and you will inescapably get some rhythm).
[1] A technique where you smoothly move to an adjacent note with your thumb by see-sawing between the knuckle and fingertip, which works because key velocity matters much less than on a piano (and for electric action, not at all). In fact, you can smoothly play an entire scale this way with just your thumb. "Thumbing down" can also refer to playing notes on a lower manual (keyboard) with your thumb while the rest of your fingers play on an upper manual.
Just as an example, one of the first things I learned from my Russian master teacher was to never put the thumbs on the black keys.
That's _unless_ it's absolutely neccessary to do so in some of the more advanced fingerings. It also all depends on how large your hands are.
So there's really no one-size-fits-all solution, but I could imagine a transformer architecture trained on master fingerings might actually be able to figure it out.
Ugh. I'm hard pressed to even reach an octave using only pinky and index. You probably have bigger hands.
It's a Dunning-Kruger algorithm. Instead of demonstrating algorithmic supremacy it formalises a poor understanding of the problem and the domain, but still labels it "solved."
This is a bad optimization. Because fingering should be a function of the desired musical effect. Speed can be one of them but most of the time others effects like articulation, phrasing, dynamics, timing etc. and their combination are much more important.
Piano fingering is an art. Whole books are written about this topic. Such a primitive algorithm can never produce good results. Better is to learn from the masters. The Henle App can display different fingerings from different master pianists for the same piece. There is a lot one can learn from those masters, but not from a speed optimization algorithm.