Ranking for the best military city. The score is calculated as:
Score = SQRT (maximum troop strength^2 * sum of all recruitment speeds, Shipyard speed counting double) /1000
A city with a castle at level 10 and 50 barracks at level 10 would have a maximum troops strength of 200,000 TS. Additionally the city is boosted to 6500% recruitment speed in the training ground but does not have other recruitment buildings. Thus the sum of all recruitment speeds is: 7200 = 100 + 6500 + 100 + 100 + 100 + 100 + 100 * 2 (the shipyard recruitment speed is counting double) The score for this city is SQRT (200,000^2*7200) / 1000 = 16970,563
In the column that shows the sum of all recruitment speeds, the speed of the shipyard is not counting double. Thus two cities with the same values in this column and the Max TS column will have a different score if they have different speeds for the shipyard.
Ranking for the best resource city. Only one of your cities with the best score can participate.