What country is the roundest?

Clever idea! Is this equivalent to seeking to minimize, for given area, the mean squared-difference of the country’s points to its center of mass? Or, you could use mean absolute distance.

One way to gather the data, which might not be too hard, at least for largish countries, is to start with a map of a continent in which countries are shown in different colors, and then simply count pixels colored with a given country’s colors. (Obviously a trivial segmentation preprocess would be used since multiple countries will share colors.)

Unless you’re Huey Lewis and the News…

I believe this is so, yes.

I think the advantage to minimizing distance-squared is that there exist semi-nice formulas to calculate the moment of inertia of a plane polygon in terms of its vertex positions, but I’m not sure that any such formulas exist for the mean absolute distance. (The formula in the link is derived from Green’s theorem somehow, but to do that you need to have a function with continuous partial derivatives in the region of integration, and the absolute distance function isn’t smooth at the origin.)

Anyhow, I managed to convince Mathematica to do this for me. (Code is below for anybody who’s interested. “fom” stands for “figure of merit.”) Outlying islands & exclaves were treated as being attached to the main part of the country by massless “struts”; as you can see, this penalized archipelago countries pretty heavily. Recall that the theoretical minimum figure of merit is 1/2π = 0.159155…; smaller numbers mean “rounder”.

Top twenty roundest countries (and figure of merit):[ol][li]Sierra Leone (0.163)[]Zimbabwe (0.168)[]Suriname (0.169)[]Poland (0.169)[]Ivory Coast (0.169)[]Swaziland (0.169)[]Nauru (0.171)[]Uruguay (0.171)[]Sudan (0.172; This one surprised me for a moment, but it’s actually pretty round now that South Sudan has separated)[]Egypt (0.172)[]Romania (0.173)[]Botswana (0.174)[]Macedonia (0.174)[]Vatican City (0.174)[]Belarus (0.175)[]Algeria (0.175)[]Gabon (0.176)[]Lesotho (0.176)[]Andorra (0.176)[]Ethiopia (0.177)[/ol][/li]
Top ten least round countries:[ol][li]Tuvalu (976.6)[
]Maldives (924.8)[]Seychelles (872.3)[]Tonga (57.70)[]Bahamas (6.35)[]Cape Verde (4.18)[]São Tomé and Principe (3.97)[]Vanuatu (2.98)[]Comoros (2.28)[]Solomon Islands (2.26)[/ol][/li]
Top ten least round countries that are don’t consist of widely separated regions/islands (this is a judgement call on my part on what constitutes “widely”, of course):[ol][li]Chile (2.03; twelfth overall)[]Norway (0.899)[]Vietnam (0.894)[]Gambia (0.793)[]Japan (0.791)[]Cuba (0.783)[]Philippines (0.774)[]New Zealand (0.688)[]Israel (0.580)[*]Panama (0.498)[/ol][/li]
These results seem reasonable enough to me, so hopefully my brain will now stop bugging me to think about this problem.



fom[country_] := 
 Module[{cname = country, pointlist, singlelist, basept, area, 
   centeredlist, centroid, moment},
  pointlist = CountryData[cname, "Shape"][[1, 3, 1]];
  basept = First[pointlist][[1]];
  singlelist = pointlist[[1]];
  For[i = 2, i <= Length[pointlist], i++, 
    singlelist = 
     Join[singlelist, {basept}, pointlist[li], {pointlist[[i, 1]]}]][/li]   AppendTo[singlelist, basept];
  area = 0;
  For[i = 1, i < Length[singlelist], i++, 
   area = area + 
     1/2 (singlelist[[i, 1]] singlelist[[i + 1, 2]] - 
        singlelist[[i + 1, 1]] singlelist[[i, 2]])];
  If[area < 0, singlelist = Reverse[singlelist]; area = Abs[area]];
  centroid = {0, 0};
  For[i = 1, i < Length[singlelist], i++, 
   centroid = 
    centroid + 
     1/6 {(singlelist[[i, 1]] + 
          singlelist[[i + 1, 
            1]]) (singlelist[[i, 1]] singlelist[[i + 1, 2]] - 
          singlelist[[i + 1, 1]] singlelist[[i, 2]]), (singlelist[[i, 
            2]] + singlelist[[i + 1, 
            2]]) (singlelist[[i, 1]] singlelist[[i + 1, 2]] - 
          singlelist[[i + 1, 1]] singlelist[[i, 2]])}];
  centroid = centroid/area;
  centeredlist = Map[(# - centroid) &, singlelist];
  moment = 0;
  For[i = 1, i < Length[centeredlist], i++,
   moment = 
    moment + 
     1/12 (centeredlist[[i, 1]]^2 + centeredlist[[i, 2]]^2 + 
        centeredlist[[i, 1]] centeredlist[[i + 1, 1]] + 
        centeredlist[[i, 2]] centeredlist[[i + 1, 2]] + 
        centeredlist[[i + 1, 1]]^2 + 
        centeredlist[[i + 1, 
          2]]^2) (centeredlist[[i, 1]] centeredlist[[i + 1, 2]] - 
        centeredlist[[i + 1, 1]] centeredlist[[i, 2]])];
  moment/area^2]

names = CountryData["Countries", "Name"];
roundnesses = Map[fom, names];

SortBy[Transpose[{names, roundnesses}], Last]


You have a contact at Mathematica? How did you convince them? The need to prevent ignorance? I have Wolfram Alpha and can’t wait to ask it for the answer you calculated.

A problem with this approach is that a sharp point could be arbitrarily thin, and have little effect. Think of Antarctica, but with a much thinner Antarctic peninsula poking out. Is that considered “round”?

The opposite problem can occur also. A pie with a very thin slice removed would look almost as round as a full pie.

I’d propose finding the minimum radius circle that completely encloses a country, and the maximum radius circle that completely fits within a country, and using their ratio as the criteria. (This would make a shape like a gear rank as pretty round, even though its area to perimeter ratio could be very small. I’d call a many-toothed gear “round”, but I can see how someone could argue that it isn’t round at all.)

Either I was being unclear or you’re being amusingly pedantic, and I can’t tell which. But to clarify: I have the full version of Mathematica installed on my work computer, and I wrote the program in my previous post in my spare time to answer the question.

That’s pretty neat! Thanks for doing the legwork on that.

There might have been a good answer 3,500 years ago. We studied the Minoans in school, and learnt about the massive volcanic explosion at Thera - San Torini as it’s called today.

Supposedly Thera in Ancient Greek meant ‘round’ - as in the shape of the island - I have my doubts about that. nevertheless, the fragment of the island left is certainly tantalising regarding this topic…

http://www.amazingcrete.com/maps/map-santorini.htm

one that Slartibartfast isn’t responsible for.

Looks like Kauai’i would if it went kablooey.

Antarctica is pretty round, except for the pointed peninsula. But then, it probably would not rate as a country.

It’s no doubt high on the scale, but surpassed for least-roundness by Norway, which has such an unusual shape that its center, figured from its extremes, is in Sweden!

Vietnam has to be well up there on the list as well, as does Croatia.

[quote=“MikeS, post:43, topic:650836”]

I believe this is so, yes.I think the advantage to minimizing distance-squared is that there exist semi-nice formulas to calculate the moment of inertia of a plane polygon in terms of its vertex positions, but I’m not sure that any such formulas exist for the mean absolute distance. (The formula in the link is derived from Green’s theorem somehow, but to do that you need to have a function with continuous partial derivatives in the region of integration, and the absolute distance function isn’t smooth at the origin.)

Anyhow, I managed to convince Mathematica to do this for me. (Code is below for anybody who’s interested. “fom” stands for “figure of merit.”) Outlying islands & exclaves were treated as being attached to the main part of the country by massless “struts”; as you can see, this penalized archipelago countries pretty heavily. Recall that the theoretical minimum figure of merit is 1/2π = 0.159155…; smaller numbers mean “rounder”.

Top twenty roundest countries (and figure of merit):[ol][li]Sierra Leone (0.163)[]Zimbabwe (0.168)[]Suriname (0.169)[]Poland (0.169)[]Ivory Coast (0.169)[]Swaziland (0.169)[]Nauru (0.171)[]Uruguay (0.171)[]Sudan (0.172; This one surprised me for a moment, but it’s actually pretty round now that South Sudan has separated)[]Egypt (0.172)[]Romania (0.173)[]Botswana (0.174)[]Macedonia (0.174)[]Vatican City (0.174)[]Belarus (0.175)[]Algeria (0.175)[]Gabon (0.176)[]Lesotho (0.176)[]Andorra (0.176)[*]Ethiopia (0.177)[/ol][/li][/QUOTE]

Sorry, I am not buying it. Eyeballing these, some are vaguely roundish, but some, such as Sudan, Algeria, Zimbabwe, do not look round at all, maybe closer to square. I think what you have proved is that that the formula you used does not capture what we intuitively mean by roundness very well. Part of “roundness” is having smooth contours, without sharp angles.

I don’t entirely disagree; there are many different criteria we could use for “roundness”. Mine probably tests for “compactness” more than “roundness”; it avoids the “straight-line” problem I mentioned upthread, but it’s not a perfect criterion either. If there are other mathematical criteria that people would like me to apply to the polygon data I extracted from Mathematica, I’d be happy to give it a shot.

I didn’t realize Mathematica contained so much data. Wow!

Another criterion (though I don’t have a particular need to see the results, and suppose that it would also fail to be a “perfect” roundness ranker) would be the portion of the country within an optimally-placed circle whose area is that of the country. (It might be more robust to sum this ratio over circles of 0.9, 1.0, 1.1 times the country’s area.)

Tests on the basis of area vs. border length or versus a “fitting circle” are a natural thing to do, but we have the straight lines / sharp corners problem. Off the top of my head, if you’ve got polygonal data, what would happen if we approached this another way - if the country were perfectly circular, the polygonal data should be a perfect n-gon. Suppose we did a score based on walking around the polygon comparing the deviation of the individual polygon segments from those for the n-gon. I haven’t thought through how I want to define the deviation at this point. It might be interesting to ignore the lengths, and simply base the deviation on the direction of the segment versus the direction of the corresponding segment in the n-gon.

That wouldn’t be a good method, since it would give the same score to a square as to an arbitrarily-elongated rectangle. Or, for that matter, an arbitrarily-elongated polygon of any shape. You could get something that rated as being highly circular, while not actually being very close to circular at all.

Another problem with polygonal border data is that they’re likely set for some resolution (i.e., minimum length for the sides), which could penalize smaller countries which only have room for a few sides.

Yeah, the score for a rectangle being the same as a square is a point, but note that if you have only four segments for your country border, a square is the approximation you should get for a circle. One presumes that the defining polygon has a large number of short segments, and the regular n-gon segments meet at very obtuse angles. A better measure would use the segment lengths, but I’m wondering if with the data at a fine enough resolution, I could ignore them, and instead, just total up deviations in segment directions. What I really want to pick up is where polygon defines substantially different angles than the regular n-gon.

It would be better to use a regular n-gon of the same border length as the country, come up with an expression for the sum of deviations in the coordinates given an arbitrary translation and rotation of the regular polygon in the plane, minimize that, and take that sum of deviations as your score. I’m not going to think about computing that right now.

Oh, sure, I don’t have any problem giving a good score for a square. I just have a problem with giving the same good score to a rectangle that’s an inch on one side and ten miles on the other. Though I suppose you could divide up long sides into shorter “sides” with 180 degree angles between them.

I’m sort of implicitly assuming that that’s what the polygonal data for the country will do, at least in all practicality - in other words you’re just going around the border of the country, digitizing at regular intervals. If that isn’t the case, you would have to massage the data a bit by breaking up overly long segments, which would be fairly easy.