Logic for grouping cities

matrix
r
sas
excel
clustering

#1

Hii,

I have a Distance matrix of cities, say 5.
Example:

I have also attached the data in the csv file.

I want to group (clusters) these cities based on criteria that cities are less than 5 km apart in the group.
The resultant cluster would be
Intial Cluster
A-B
A-C-D
A-D
B-A
C-A-D
D-A
D-C

Unique cluster
A-B
A-C-D
A-D
C-D

Is there a R code or SAS code or even in Excel this can be done.
I have used usual clustering procedures but it doesn’t give me overlapping clusters i.e. where one city can come in multiple clusters, which I require.

Thanks for the help.citydistance.csv (84 Bytes)