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?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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?
Название |
---|
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.