Re:Geocode-sqlite: Geocode rows in an SQLite database table
by contingencies on Monday May 17, 2021 @11:10AM
(#27184340)
For most real world problems the distance between points can either be calculated manually or points within a large (eg. global) dataset will be already divided in to mutually irrelevant sets (eg. customers generally don't walk across two borders within one trip, grid sections are precomputed, etc.), therefore this problem (near-optimal sort by distance over a large dataset) is pretty uncommon. For the cases where it is required, caching may be viable. For the cases where it is not possible to either do the math or cache, it may be possible to parallelize the problem or push it to the client. In the final case where none of these generic approaches are available, then you should sleep on it and come back the next day because you almost certainly missed something. If you really didn't miss anything, congratulations: you can justify more hardware. If you can't afford renting or buying more hardware then your dream has come true: you are probably a mathematics academic, and not a programmer, thus you can spend your days twiddling algorithms safe in the knowledge that someone, somewhere, might make money from it and it almost certainly won't be you.
Less tongue in cheek, if you enjoy algorithms make sure to read The Art of Computer Programming.
Less tongue in cheek, if you enjoy algorithms make sure to read The Art of Computer Programming.