Always choose the most populated neighbor. When left with no neighbors go back to the previous country and follow with second most populated neighbor. Start with the world's most populated country.
Not counting the Gibraltar border, Bahrain bridge border, or dubious India/Sri Lanka border