This tool groups sub-national regions into "communities" using the strength of Facebook friendship ties between them. Two regions are treated as close when a randomly chosen Facebook user in one is highly likely to be friends with a randomly chosen user in the other.
It uses hierarchical agglomerative average-linkage clustering: every region starts on its own, the two closest groups are repeatedly merged, and the process stops once the chosen number of communities remain. The distance between two regions is the inverse of their Social Connectedness Index; no geographic constraint is applied, yet communities usually come out spatially contiguous because connectedness falls off with distance.
More details and the full data are at the Humanitarian Data Exchange.
Basemap © Mapbox · © OpenStreetMap · Improve this map