Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Lookup closest hash key

by bart (Canon)
on Jan 25, 2011 at 13:56 UTC ( #884118=note: print w/replies, xml ) Need Help??


in reply to Re^2: Lookup closest hash key
in thread Lookup closest hash key

The OP is only interested in nearest in a one-dimensional space.
Actually, I don't think he is. This looks like an XY problem to me, and I think Corion thought the same thing...

Distances between cities is intrinsically a 2-dimensional problem.

We don't know what the rest of the OP's code does, but I assume it's something that could be better integrated with a solution to the question that was asked.

Replies are listed 'Best First'.
Re^4: Lookup closest hash key
by LanX (Cardinal) on Jan 25, 2011 at 14:41 UTC
    > Distances between cities is intrinsically a 2-dimensional problem.

    My understanding was that the distances are calculated starting from a 0km origin, hence it's one dimensional.

    And I'm not sure if Corion's suggestions can be easily applied to spherical distances...

    Cheers Rolf

Re^4: Lookup closest hash key
by JavaFan (Canon) on Jan 25, 2011 at 18:52 UTC
    Actually, I don't think he is.
    Considering the OP actually gave us an example hash, and an example search query, I'm not going to assume he has figured out how to use spherical coordinates as hash keys. (For which neither Voronoi diagrams, nor quadtrees can be used directly).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2021-01-17 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?