in reply to Algorythym for searching closest neighbor

I'm not sure what you want -- closest digits, or closest location? But for closest digits, in a left right precedence, all you need is a sorted list of zip codes. Then you do a binary search for the number. If it succeeds, good. If not, then where it ends will either be the closest number or else the one above or below it will be.

If you need closest location then that can be done quickly too, but you need the locations first.

Ciao,
Gryn

  • Comment on Re: Algorythm for searching closest neighbor