in reply to Re^4: Bidirectional lookup algorithm? (Solution.)
in thread Bidirectional lookup algorithm? (Updated: further info.)
That's interesting how much extra space it takes to build the structure, and possibly part of why such algorithms aren't already coded up in a lot of libraries, given that the CHM algorithm dates back to 1992.
The DAG is only needed whilst the algorithm is searching for the perfect hash function. Once the hash function has been discovered, the DAG is discarded and the data can be stored in a very simple hash structure; basically just an array indexed by the generated hash function.
For many applications -- spell checkers and the like -- where the dictionary is known in advance, the hash function is generated in a separate process and the simple hash table generated and stored to disk. The applications that use the hashtable just load it up at startup and use the generated hash function to look things up in the table.
It's because my application generates essentially random datasets at runtime, and a different dataset for each run, that makes CHM unsuitable for my application.
|
---|