The algorithm is presented in [1,2,3].
Now we detail the memory consumption to generate and to store minimal perfect hash functions using the CHM algorithm. The structures responsible for memory consumption are in the following:
, we can discover the edges that
contain
following its list of edges, which starts on
first[
] and the next
edges are given by next[...first[
]...]. Therefore,
the vectors first and next represent
the linked lists of edges of each vertex. As there are two vertices for each edge,
when an edge is iserted in the graph, it must be inserted in the two linked lists
of the vertices in its composition. Therefore, there are 2n entries of integer
numbers in the vector next, so it is stored in 4*2n = 8n bytes.
Thus, the total memory consumption of CHM algorithm for generating a minimal perfect hash function (MPHF) is: (8.125c + 16)n + O(1) bytes. As the value of constant c must be at least 2.09 we have:
| c | Memory consumption to generate a MPHF |
|---|---|
| 2.09 | 33.00n + O(1) |
| Table 1: Memory consumption to generate a MPHF using the CHM algorithm. |
Now we present the memory consumption to store the resulting function. We only need to store the g function. Thus, we need 4cn bytes. Again we have:
| c | Memory consumption to store a MPHF |
|---|---|
| 2.09 | 8.36n |
| Table 2: Memory consumption to store a MPHF generated by the CHM algorithm. |
| Home | CHD | BDZ | BMZ | CHM | BRZ | FCH |
Enjoy!