I have an Origin-Destination matrix expressing (weekly) flows of people between every couple of nodes (cities). The number of people traveling from city $i$ to city $j$ in a specific week is $OD_{ij}$. My goal is to define a distance metric, induced by these flows of people, that allows me to cluster the cities into groups and compare these groups with the groups of cities derived from clustering using geographical distances. Two cities should be close according to my distance if a lot of people are traveling between them.
First, I have to obtain a symmetrical matrix, since distances are symmetrical. I solved this problem easily by computing for each couple $$ OD_{ij}^{'} = \frac{OD_{ij}+OD_{ji}}{2} $$
My difficulty is how to define the mobility-induced distance metric. This metric should work well with a hierarchical clustering method. I thought about $$ d_{ij} = \frac{1}{1 + OD_{ij}^{'}} $$
This metric respects the property of having a low value for highly connected cities, and a low value for cities lowly connected. However, it does not respect triangular inequality and moreover, it does not work well with any kind of linkage in hierarchical clustering, because when I am computing the distances between a newly formed cluster A and every other cluster B, I would like to compute $$ d_{AB} = \frac{1}{1 + \sum_{i\in A, j \in B}{OD_{ij}^{'}}} $$ But no known linkage defined in classical hierarchical clustering (complete, single, average, Ward, etc.) will allow me to do something remotely similar.
Does someone have some thoughts about this problem and how to define the distance metric? I am also having difficulties in finding papers about studies doing something similar to this. Any help would be greatly appreciated.
hclustand in any distance-based clustering method. The reason we prefer distances is that in some rare cases dissimilarities may lead to a "strange" dendrogram. How to convert a dissimilarity matrix to a distance matrix is a one-million-dollar question. I'll be happy to see if someone comes out with a recipe for it. – utobi Nov 12 '22 at 20:33