Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Lookup closest hash key

by BrowserUk (Pope)
on Jan 25, 2011 at 14:04 UTC ( #884119=note: print w/replies, xml ) Need Help??


in reply to Lookup closest hash key

How many cities? And across what range (Ie. minimum and maximum distance)?

Depending upon your answers to those questions, there is probably an O(1) solution.

Replies are listed 'Best First'.
Re^2: Lookup closest hash key
by Just in (Sexton) on Jan 25, 2011 at 16:02 UTC

    I have possibly over simplified my concern. But your replies negate the need for a hash, which confirms my suspicions. The module pointers are excellent, their reading will prove useful for similar problems.

    That said Tie::RangeHash looks very useful, and I'll do some benchmarking to see if it's worth while.

    The hash implementation I used should work for the time being, however I suspect that the actual data source will grow in magnitudes making db interaction and SQL statements more attractive. Again more benchmarking.

    My most heartiest thanks for the pointers and replies.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://884119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2021-01-17 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?