The Hexagonal Code: How Uber Finds You Fast!

the-hexagonal-code:-how-uber-finds-you-fast!

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

Image description

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

Image description

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,

Image description

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?

Image description

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?

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
prioritization-is-the-symptom,-not-the-illness

Prioritization is the symptom, not the illness

Next Post
how-to-conduct-product-feedback-surveys-(questions-+-templates)

How to Conduct Product Feedback Surveys (Questions + Templates)

Related Posts
arkui-x平台差异化

ArkUI-X平台差异化

跨平台使用场景是一套ArkTS代码运行在多个终端设备上,如Android、iOS、OpenHarmony(含基于OpenHarmony发行的商业版,如HarmonyOS Next)。当不同平台业务逻辑不同,或使用了不支持跨平台的API,就需要根据平台不同进行一定代码差异化适配。当前仅支持在代码运行态进行差异化,接下来详细介绍场景及如何差异化适配。 使用场景 平台差异化适用于以下两种典型场景: 1.自身业务逻辑不同平台本来就有差异; 2.在OpenHarmony上调用了不支持跨平台的API,这就需要在OpenHarmony上仍然调用对应API,其他平台通过Bridge桥接机制进行差异化处理; 判断平台类型 可以通过let osName: string = deviceInfo.osFullName;获取对应OS名字,该接口已支持跨平台,不同平台上其返回值如下: OpenHarmony上,osName等于OpenHarmony-XXX Android上,osName等于Android XXX iOS上,osName等于iOS XXX 示例如下:…
Read More