Re: Fortran to find nearest point from set in 3-D



To search a 1-D list, the best you can do is use a sorted list and a
binary search. This is efficiently implemented (especially when you
need to add/remove points) using a binary tree.

Similarly, you need an extension of a binary tree to 3-D. So, you may
want to use an octree 2^3=8, or another generalization of a tree. Such
as a k-d tree, an R tree, R+ tree, k-b-d tree, etc.

I don't have any Fortran source laying around, but that should give you
some keywords to google from (n-dimensional binary tree or
multidimensional binary tree, as well as the algorithms above). At a
minimum, you'll find a pile of technical papers describing various
algorithms, this is a classic problem of computer science.

Rob

.



Relevant Pages

  • Re: Search a list/array of objects for specified criteria?
    ... even where the distribution is uneven. ... we are not talking about a binary tree. ... We are talking about using a binary search algorithm over a sorted list. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ArrayList BinarySearch vs Contains
    ... thought O notation always represented worst-case, so thanks for correcting me. ... it is NOT true that "the worst-case in a binary search would be ... binary tree, a search on that tree could be as bad as O. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: No trees in the stdlib?
    ... sorted list using binary search. ... With Oinsertions and removals, ... A decent self-balancing ... binary tree will generally do those in O. ...
    (comp.lang.python)
  • Re: ArrayList BinarySearch vs Contains
    ... This means that the worst case scenario would be ... it is NOT true that "the worst-case in a binary search would be ... binary tree, a search on that tree could be as bad as O. ... Pete ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Binary tree
    ... > I'd like to display a binary tree. ... > (one child above and one child below). ... The FAQ has a very vague description about how to draw trees (because it ... algorithms and data structures. ...
    (comp.lang.java.gui)