I have a collection of points with coordinates, for example like locations on earth (maybe when latitude and longitude are known), and I want to make groups of 4 people that will stay within a certain distance from each other (some distance from their Fermat point, or just minimum distances between each other). I would like to know whether there exists some algorithm which given the coordinates of the points will find an optimal solution (or a pretty optimal one) to this problem. For example, in the following situations the optimal groups are selected with blue. A solution of selecting the middle dots and outer ones would not be optimal, because the outer dots would be outside their maximum distance (even if middle ones were closer).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…