Hacker News new | past | comments | ask | show | jobs | submit login

Squares have a contiguity problem: does a square in a grid have 4 neighbors (rook contiguity) or 8 (queen contiguity)? Hexagons do not have this problem. All neighbors of a hexagon share a full edge, not just a vertex. All neighbors of a hex also have their centers equidistant from that hex. A massive number of spatial problems turn on neighborhood definitions, and hexes are almost always a better representation of reality than squares.





But if you assume rook contiguity then it seems equivalent to hexagons. All neighbors share a full edge, all neighboring centers are equidistant.

I get that you're saying hexes are almost always a better representation. I still don't see a concrete example of why, for geographical indexing specifically.

[Edit: sibling reply explained that at the end of the day, it's not about indexing but rather route planning.]


Let's say you are looking for the closest gas station. One that is in the close corner of a "diagonal neighbour" would be closer than most points in the "edge neighbours". So if you want to find something nearby, you'd usually want to look at all 8 neighbours. The hexagonal neighbours look more like a circle centered in the original hexagon, thus more convenient for that purpose.

and if you assume cows are spherical and frictionless it's quite convenient

sometimes roads go diagonal




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: