Hi again)
"... if there is a level where one solution works out, but the other one does not" - looks like a challenging task) i have no idea how to solve it systematically though i'm not a mathematician :)
I get that you have a lot of other duties; still maybe someday we'll talk, and if you find any of my ideas interesting, you can make it as your own cuz i'm not a developer