As someone who works in the industry, let me tell you how it works....
Firstly, it is VERY rare IME to get an upgrade for any other reason than the airline has overbooked - and the cabin you booked in is not only full, but the no-shows they were hoping for have started to appear at check in.
So how do they choose the lucky folks? It's not quite random, but it does vary. FFP status is a part of it, as is group size - if you are traveling with a dozen mates, that is going to disqualify you, unless the airline has REALLY overbooked! It then boils down to ease of upgrade - special meals, traveling with small children, they can throw you off the list. But since most passengers are in small groups, with standard meals and no kids - it is down to the whim of the check in staff, or their back office mates. I've never worked out a pattern beyond that - I do get more than my fair share of EK upgrades to F, but I am Gold, I normally travel solo for work, and I have a bog standard meal. I have never had a VS upgrade, but then I virtually always pay for UC anyway. BA have upgraded me, and I'm Blue with them - but I did notice that my upgrades have been when I am sat at the front of the cabin, so maybe they look down the list and take the easy option. So forget looking for an algorithm, you may be better off reading the entrails from black and white chickens....

Faites vos jeux, as they say....
As a general rule, the best chance of getting a seat at the front involves a credit card....