Nearest Neighbour / Ternary Search Tree

M

maryjones11289

Hi All,

I'm trying to write/find code that creates a Ternary Search Tree in
Visual Basic (VB6 or .NET).

Here's my situation:
What I have is an array consisting of 60,000 string elements.
All elements are exactly 225 characters in length.
All elements are made up of 1's and 0's

Eg:

1001101001.....
1110111000.....
1101101011.....
Etc


What I'm trying to do:
My aim is to take an arbitrary search key (225 chars in length,
consisting of 1's and 0's) and find all elements in the array where
the hamming distance between the search key and the element is 22 or
less (ie 90% similar).

I could do a brute-force search, but this takes quite some time and is
clearly not optimum.

I have spent the last 3 or so months searching the Internet researching
on the best way to solve this nearest neighbour problem. To date I have
not found anything written in VB. I have found numerous documents that
outline several algorithms, but they have been written in such a way
that I'd need a PHD in something just to understand them.

The latest documentation I have found all indicate that Ternary Search
Trees are the way to go and that implementing a NN search function is
easy with them. The problem is that I cannot find any information on
how to construct the tree. I did find one example written in C, but
with my limited knowledge of C, I was unable to translate into VB.

So now I'm here asking for your assistance please. Can anyone show me
(VB code if possible) how to construct a Ternary Tree as well as the NN
search function or alternatively, point me in the direction of a site
that could help.

Thanks in advance,

Mary.
 
T

tomb

Hi All,

I'm trying to write/find code that creates a Ternary Search Tree in
Visual Basic (VB6 or .NET).


So now I'm here asking for your assistance please. Can anyone show me
(VB code if possible) how to construct a Ternary Tree as well as the NN
search function or alternatively, point me in the direction of a site
that could help.
Because you can incorporate C# projects in a VB solution, I offer a C#
solution that you can build as a dll function library. This is complete
downloadable source code.
http://www.thecodeproject.com/csharp/tst.asp?df=100&forumid=31232&exp=0

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top