Re: Fast search for a number within tolernaces
- From: jonasforssell@xxxxxxxx (Jonas Forssell)
- Date: 7 Jun 2005 11:35:39 -0700
Wibble <Wibble@xxxxxxxxxxxxxx> wrote in message news:<68SdnWQAmfy0HDjfRVn-hA@xxxxxxx>...
> Jonas Forssell wrote:
> > Gentlemen,
> >
> > 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:?
> >
> > Thanks for your help
> If all your nodes are equidistant, do you merge them into a single node?
>
> Partition your space into a 3D matrix with each cube of a discrete size.
> Merge nodes that are within the same cube. Thats O(n). You can use
> a HashMap to model a sparse matrix. You can position the final node at
> an average of the component positions.
>
> Read a book on graphics like Foley&VanDamm. Theres lots of ways to
> partition and filter 3D models that are more efficient and look better
> than node merging.
Thanks for your reply!
I understand now how to continue.
Appreciated
/Jonas
.
- References:
- Fast search for a number within tolernaces
- From: Jonas Forssell
- Re: Fast search for a number within tolernaces
- From: Wibble
- Fast search for a number within tolernaces
- Prev by Date: Re: please help with this singing issue
- Next by Date: KeyGenerator issue
- 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
|