0
$\begingroup$

Let's define distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ as $$|x_2-x_1| + |y_2-y_1|$$.

There are given some points.
I think how to find maximum distance between two arbitrary points (among given points). My inituition is following:
Let's find point $(x, y)$ such that $x+y$ is maximal and $(a, b)$ such that $a+b$ is minimal. I don't know idea about corectness. It is only intuition. Could you help me, please ?

$\endgroup$

1 Answer 1

0
$\begingroup$

Your idea as stated is incorrect. For example consider the points $$ \{(-100,100),(100,-100),(1,1),(-1,1)\} $$

$\endgroup$
4
  • $\begingroup$ You are right, so can you help me solve this problem ? I think also about third dimension. $\endgroup$ Commented Dec 28, 2015 at 18:38
  • $\begingroup$ I think that the only solution that will always work is to try every pair of points. $\endgroup$ Commented Dec 28, 2015 at 18:40
  • $\begingroup$ Ok, maybe I say more. I would like to find algorithm for this problem. $\endgroup$ Commented Dec 28, 2015 at 19:03
  • $\begingroup$ Post a new question. Perhaps you should post the question to a programming site like stackoverflow. $\endgroup$ Commented Dec 28, 2015 at 19:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.