Simple Suggestion / Recommendation Algorithm for readable shortner

79 views Asked by At

I am trying to solve the problem of giving a unique code to each each address. I am currently aiming this towards India where each home is identified by apartment number(like 101), apartment name, street name, locality, city. Typical address looks like

Flat No 101, john hopkins Apartment,5th cross, 
1st main, Banneghatta 
3rd layout, bangalore, Pincode - 500781

Flat No 101, john reddy Apartment,
Sunset Road, Banneghatta 3rd layout, 
bangalore, pincode - 500765

Even though pincodes are widely used, it represents an area with few thousands of houses rather than a home. I want to give a unique code to each home which would be easy to remember, uniqueto address and used by everybody. These address can be anything ranging from sectors, street numbers, street names, locality names, landmark etc

Some of the formats I am currently thinking are 101johnhopbanblr,101johnredbanblr etc which I point to the gps coordinates of the home and with internet and correct code, we can navigate to correct location.

What is the best way to design those codes? 

If the gps coordinates point to a building and apartment inside that building is navigated by its number, that number should be easily understandable from code.

1

There are 1 answers

0
Nachiket Kate On

I think you should check for how electricity board in India identifies uniquely the homes where they provide electricity. They work on basis E Meter which has unique no. You can use that no. directly or you can use Gas connection no. (Nowadays it is provided to whole society so that may not work in some cases but electricity connection no. is better option.)

other way you can do it like,

<Country code>-<State code>-<city code>-<district code>-<town code(optional)>-<area code>-<apartment regi. no.>-<home no.>

example

India-Maharashtra-Pune-Pune-Pune-Kothrud-Mantripark-101 can be represented like this,
91-01-100-100-100-38-100-101

Ofcourse no. are created by you (predefined by you)

country-state-<pincode>-<apartment regi no>-<home no>

will be better.

Pincodes are available easily and apartment regi.no is also unique so I think this will be easier to build and use.

As all are no. searches will be better that string comparison if proper data structures are used and codes are stored seperately for each i.e. counrty,state,pincode,apartment etc.