You are given an $$$N$$$x$$$N$$$ grid and $$$K$$$ people. Put all people in the grid such that the minimum manhattan distance between any two is maximized. What's the best solution for this problem? Is it NP?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
You are given an $$$N$$$x$$$N$$$ grid and $$$K$$$ people. Put all people in the grid such that the minimum manhattan distance between any two is maximized. What's the best solution for this problem? Is it NP?
Name |
---|
use binary search
Can you elaborate?
Is it manhattan or euclid distance?
Manhattan.
Disregard this answer, it was horribly wrong
any proofes?
Deleted
man if only someone could solve this
my first impression would be to fill in all 4 corners, then the middle, then the middle of each 4 resulting squares, then the 4 midpoints of each square, and keep on subdividing it until minimum
What if N = 4, and K = 16? Seems like greedy / binSearch solution would not be optimal here.
NP contains decision problems. So you should also be given a value V and check if you can put the people in the grid so as their distances to satisfy the value V.
Now this problem is in NP because given a certificate (a placement of people) you can decide if this is a legal certificate or no in polynomial time. But this is easy.
Your actual question is if it is NP-complete, meaning if it has a polynomial time algorithm.