S
Steve555
Hi
I have a set of 171 entities (in this case they're integers
representing musical phrases)
Theses exist in sequences of length 4, and I have a library (lookup-
table) of such sequences.
e.g.
2 58 93 170
38 39 100 150
38 40 41 87
etc.
The table is sorted and is quite sparse; there are 333,932 out of a
possible 855,036,081 (171^4) .
I'm looking for fast ways to find matches for a query containing 1 or
2 wildcards.
e.g. find matches for:
2 58 ? 170
? 39 ? 150
At the moment I'm using brute force to just iterated through the
lookup table, but this is proving very slow as the algorithm needs to
do hundreds of searches in close to real time.
I know very little about searching, so any ideas for me to study would
be welcomed.
I do know how to do a binary search, but only from the first entry, so
if that is a wildcard I'm stumped.
I happy to re-format/re-package the data if it could improve the
search speed. I'm not concerned about size or memory usage.
Thanks for any suggestions
Steve
I have a set of 171 entities (in this case they're integers
representing musical phrases)
Theses exist in sequences of length 4, and I have a library (lookup-
table) of such sequences.
e.g.
2 58 93 170
38 39 100 150
38 40 41 87
etc.
The table is sorted and is quite sparse; there are 333,932 out of a
possible 855,036,081 (171^4) .
I'm looking for fast ways to find matches for a query containing 1 or
2 wildcards.
e.g. find matches for:
2 58 ? 170
? 39 ? 150
At the moment I'm using brute force to just iterated through the
lookup table, but this is proving very slow as the algorithm needs to
do hundreds of searches in close to real time.
I know very little about searching, so any ideas for me to study would
be welcomed.
I do know how to do a binary search, but only from the first entry, so
if that is a wildcard I'm stumped.
I happy to re-format/re-package the data if it could improve the
search speed. I'm not concerned about size or memory usage.
Thanks for any suggestions
Steve