Simple Hashing Function for City Coordinates

  • Thread starter Thread starter pbialos
  • Start date Start date
  • Tags Tags
    Function
AI Thread Summary
A user is seeking a simple hashing function for randomly distributed city coordinates to map them to a hash table. The discussion highlights the importance of understanding the density of the coordinates, particularly whether it is greater near the city center or uniform across the area. It suggests that the distribution of points could influence the choice of hashing function. A potential solution involves converting the coordinates to polar form and applying a linearizing function to the radius before hashing. The conversation emphasizes the need for a straightforward approach given the user's beginner status and the project's low stakes.
pbialos
Hi folks! I am working on a problem where there is a hash table involved. I have randomly distributed coordinates over a city as keys and i need a hash function to convert those coordinates to the positions of my array(hash table).I thought that maybe i could use a function to convert my coordinates to natural numbers and then using a common hash function. I am just a beginner, and my project is not very important, so most of all i need a simple solution.

Any help would be much appreciated.
Paul.
 
Engineering news on Phys.org
When you say the coordinates are random, what does that mean? Is the density of the points to be hashed greatest at the city centre, and decreasing gradually further away, or (less likely) is the density constant out to some limit, and then an abrupt stop?

The distribution makes a difference to what would be the ideal hashing function, but maybe that doesn't matter - how many coordinates do you have to deal with?

If the density varies with distance from the city centre, you might wish to convert the coordinates into polar form and then apply a linearising (inverse) function to the radius coordinate before hashing the bearing/distance pair.
 
Hi all, i have some questions about the tesla turbine: is a tesla turbine more efficient than a steam engine or a stirling engine ? about the discs of the tesla turbine warping because of the high speed rotations; does running the engine on a lower speed solve that or will the discs warp anyway after time ? what is the difference in efficiency between the tesla turbine running at high speed and running it at a lower speed ( as fast as possible but low enough to not warp de discs) and: i...
Back
Top