Re: Efficient way to store an isomorphism?
- From: "Matt Timmermans" <mt0000@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Aug 2005 00:10:27 -0400
"Edsko de Vries" <devriese@xxxxxxxxx> wrote in message
news:1123684485.848173.251790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> [...] would it be possible to define a hash function h': A -> B, that
> would
> "hash" an element of A directly onto the corresponding element of B?
> Then we only need to store this hash function, and finding m(a)
> corresponds to calculating h'(a). Then we can do lookups in O(1) time;
> additionally, we should be able to store the hash function in less than
> O(n) space.
Yes, but it takes O(n) space to store the hash function. It's still
advantageous if you have time to compute the hash function beforehand,
because lookups are actually O(1) worst case.
Google for "minimal perfect hashing". Many minimal perfect hashing
algorithms let you choose the mapping precisely. This one is my favourite:
http://citeseer.ist.psu.edu/czech92optimal.html
--
Matt
.
- Follow-Ups:
- Re: Efficient way to store an isomorphism?
- From: Edsko de Vries
- Re: Efficient way to store an isomorphism?
- References:
- Efficient way to store an isomorphism?
- From: Edsko de Vries
- Efficient way to store an isomorphism?
- Prev by Date: Re: Computing cut nodes and bridges in directed graphs
- Next by Date: Re: Computing cut nodes and bridges in directed graphs
- Previous by thread: Efficient way to store an isomorphism?
- Next by thread: Re: Efficient way to store an isomorphism?
- Index(es):
Relevant Pages
|