Re: Fast search for a number within tolernaces
- From: Thomas Weidenfeller <nobody@xxxxxxxxxxxxxxxx>
- Date: Tue, 07 Jun 2005 09:56:26 +0200
Jonas Forssell wrote:
I have a set of three dimensional nodes - each with a position in space (x,y,z). I need to write a fast algorithm in Java to merge nodes that are close - i.e. within a specific tolerance.
Easy way: Run through the array of nodes, check each node against every other node and merge if needed. This will take an awful amount of time when the array is 500.000 nodes or larger.
Smart way:?
A better data structure for the nodes right from the beginning. For example an octree structure - there are for sure others. Also, if it makes sense for the application, a simpler metric (Manhattan metric instead of euclidean metric) to calculate node distances.
/Thomas
-- The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq .
- References:
- Fast search for a number within tolernaces
- From: Jonas Forssell
- Fast search for a number within tolernaces
- Prev by Date: Re: java e fax
- Next by Date: Re: java e fax
- Previous by thread: Re: Fast search for a number within tolernaces
- Next by thread: Re: Fast search for a number within tolernaces
- Index(es):
Relevant Pages
|