reorder_max_min

reorder_max_min(df)

Reorders a DataFrame of coordinates using a greedy max-min distance algorithm. This ensures that any prefix of size k (where k < len(df)) is as space-filling as possible, maximizing the spread and minimizing clustering.

Parameters

Name Type Description Default
df pd.DataFrame Coordinates to reorder. required

Returns

Name Type Description
pd.DataFrame pd.DataFrame: The reordered DataFrame.