I am solving a problem in which I need to find the maximum distance between two points . I know a O($n^2$) algorithm and also the convex hull way of doing this problem . But I just had an idea and it might be stupid but I could not find a counter example.
I find the sum of points ($a_i$,$b_i$) and add it a dictionary (in python) after I am done with all the points I find the points with max and min sum and compute the distance between them
for example :
I have points - [(20,20),(0 ,10),(35,35),(5,15)]
I make the dictionary -{1:40,2:10,3:70,4:20}
and now calculate the distance between $2^{nd}$ and $3^{rd}$ point . Is this approach correct ? Yes there can be points with same sum like (40,30) but lets say we have distinct sum. Can we take this approach ?
This doesn't work since you're minimizing the Manhattan distance, not the straight-line distance. Suppose you have the points [(0,0), (0,10), (6,6)]. Here, you'll wind up calculating the distance between points 1 and 3 since they have the min and max sums, but it's actually points 1 and 2 that are farthest apart.