Sure

However, you would not want to include city pairs (CityX CityY) where (a) X = Y and where (b) X > Y

(A) X = Y would double count (e.g. City01 City02), and

(b) X > Y would have been counted earlier where X < Y (i.e. City02 City 04 counted, but City04 City 02 would be counted again)

Weighting factors?

Did you want to score city pairs or each city by itself?