Smallest Enclosing Rectangle of some points id 2D plane where the number of points is 100000. The points will not be collinear. I need some idea to solve the problem.
Thanks.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Smallest Enclosing Rectangle of some points id 2D plane where the number of points is 100000. The points will not be collinear. I need some idea to solve the problem.
Thanks.
Название |
---|
I suppose that smallest rectangle would necessary have at least one of sides which contains at least two of points on it (and other sides would have at least one point each).
So you may start with searching for convex hull for this set. One of its bordering line would be the same as one of the required rectangle's side. You are just to check each of the hull borders, build minimal rectangle upon it and select minimum of all these rectangles. Though I suppose that you may need to optimize series rectangle building so that if convex hull have M points, you build M rectangles in O(M), not O(N*M).
Thanks a lot RodionGork. I am trying.
- proposed algorithm is wrong;
- your implementation is not correct.
Does it work correctly for proposed testcase?
Thanks again for trying to help me. I saw the same problem before and tried. There may be a way called Rotating calipers . But I have no idea abut that.
Can any one give me some new idea to solve this problem?
You can do the following: