Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect comment on Advent of Code 2018 Day 6 Part 1 #64

Open
SabriAl-Safi opened this issue Jun 3, 2019 · 0 comments
Open

incorrect comment on Advent of Code 2018 Day 6 Part 1 #64

SabriAl-Safi opened this issue Jun 3, 2019 · 0 comments

Comments

@SabriAl-Safi
Copy link

The notebook states:

Originally, I thought that if a point on the perimeter of the [bounding] box was closest to point p, then p has an infinite area. That's true for p that are in the corners, but need not be true for all p (consider a set of 5 points, 4 in the corners of a box, and one near the center; the center point will have a diamond-shaped area, and unless it is at the exact center, it will "leak" outside one of the edges). So I expand the bounding box by a margin.

I tried to replicate this with a drawing of the described situation, but found that the area of the point near the center was still infinite:

2019-06-03

I believe that you don't need a buffer on the perimeter. In the Manhatten distance metric, traveling "across then up" is the equal-best way to get between two points. Thus if the closest point to A on the perimeter is B, and B is itself closest to (e), then A is closest to (e).

This fails in the normal Euclidean plane because if you move far enough to the right you will eventually be closer to (b) then to (e) (imagine a circle through (e) with center very far to the right - the circumference through (e) locally appears to be a straight vertical line).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant