Have you ever wondered how Uber magically finds a driver near you within seconds of booking a ride?๐ค
where my night 2AM brain cells are decoding this after some of research i got this:
So suppose this is you๐งand these are the drivers around you
Uber uses a thing called hexagonal index So what it does is it divides the entire map into hexagons So you are in a hexagon So it will search in all the hexagons that are near you to see if it finds a driver or not
Now it is possible that you are covering a lot of area and we have to find more drivers nearby So what it does is it breaks these hexagons into smaller hexagons so that it will be able to find very close drivers,
So simply you can imagine how it will be suppose we first looked at the big hexagons to see how many are there around you this is how it works.
but still in confuse why hexagons why not did we use triangles and squares?
if you look at one hexagon, the adjacent hexagon the distance will be equidistant if you look at it from the center but this doesn't happen in a square or triangle now how are these hexagons stored?
Top comments (0)