# Clustering Spatial Data while Maximizing a Constraint

I'm trying to perform a spatial clustering assignment by minimizing spatial distance while maximizing total weight within each cluster.

### My Data

My data contains 3 columns and approximately 170 rows (example shown below)

AvgWeight   lat          long
87.799      33.888102   -84.29321
165.258     31.459666   -83.51083
148.733     44.916657   -97.11346
484.038     43.020762   -88.26852
74.175      39.849156   -75.18159
83.861      42.02933    -93.60966
235.524     36.022863   -79.77895


### Goal

I'd like to be able to cluster all of my spatial locations together while also maximizing the sum of my AvgWeight column within each cluster up to some adjustable constraint (Say 10,000 lbs).

My previous clustering experience has been limited to kmeans in R so I was hoping that there would be some sort of variation I could implement to redefine my problem to fit with that methodology. However, I'm not sure how to go about minimizing geographic distance while maximizing my weight variable. I'm open to any suggestions on alternative methodologies preferably ones which can be implemented with R.