pileswasp has asked for the wisdom of the Perl Monks concerning the following question:
Brute force would just be:
but that's going to take ages! I've been doing a bit of research and there's an algorithm in the Oreilly Mastering Algorthms in Perl book, but a) it's broken for equal distances; b) it doesn't help me if there are two points in the big list which are closer together than the point I am checking is to anything else (if you see what I mean) and; c) my brain hurts from reading too many papers on algorithms for one wednesday afternoon.for (@shortlist) { for (@longlist) { # what's the distance # and is it shorter than the shortest so far } }
I've also come across some mention of 'Voronoi and Delauney diagrams' which seem (if I'm still reading straight after the last couple of hours) like it would give me a 'compute-once-read-lots' set of data about the large set which would work fine for what I'm after if I stored it. Problem is I can't find a website that'll speak to me in anything other than mathematical symbols and notations.
My basic questions boil down to:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: To Voronoi (and if so how)?
by Albannach (Monsignor) on Aug 22, 2001 at 19:51 UTC | |
|
Why bother with Voronoi? A walkabout could work...
by dragonchild (Archbishop) on Aug 22, 2001 at 19:52 UTC | |
|
Re: To Voronoi (and if so how)?
by runrig (Abbot) on Aug 22, 2001 at 22:05 UTC |