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 a question. So from the derivation of the Isentropic process relationship PV^gamma = constant, there is a step dW = PdV, which can only be said for quasi-equilibrium (or reversible) processes. As such I believe PV^gamma = constant (and the family of equations) should not be applicable to just adiabatic processes? Ie, it should be applicable only for adiabatic + reversible = isentropic processes? However, I've seen couple of online notes/books, and...
I have an engine that uses a dry sump oiling system. The oil collection pan has three AN fittings to use for scavenging. Two of the fittings are approximately on the same level, the third is about 1/2 to 3/4 inch higher than the other two. The system ran for years with no problem using a three stage pump (one pressure and two scavenge stages). The two scavenge stages were connected at times to any two of the three AN fittings on the tank. Recently I tried an upgrade to a four stage pump...
Back
Top