Efficient way to store an isomorphism?
- From: "Edsko de Vries" <devriese@xxxxxxxxx>
- Date: 10 Aug 2005 07:34:45 -0700
Hi,
I was wondering if anyone would be able to help me with the following
problem: I need to find an efficient implementation of a function "m",
where "m" is some isomorphism between two sets A and B, both of which
are subsets of N.
The obvious way to do this is to store "m" as a 2D array, every row of
which contains an element from A and the corresponding element from B.
To find m(a) from some element in A, we need to search the table. Thus,
if "n" is the size of both sets, it takes O(n) space to store the array
and O(n) time to perform a lookup.
An alternative is to define a hash function h: A -> {0 .. n-1}. Then we
store the hash function along with a 1D array B' that contains the
elements of B. To find m(a), we calculate i = h(a), and then find
B'[i]. Now we can do lookups in O(1) time, but we still need O(n) space
to store the array (assuming that storing the hash function takes less
than O(n) space).
This is better, but perhaps it is possible to go one step further:
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.
Does such a function exist? If so, is there an algorithm to calculate
it? Is it possible to give bounds on the size of this function?
Thanks very much,
Edsko
.
- Follow-Ups:
- Re: Efficient way to store an isomorphism?
- From: anvera
- Re: Efficient way to store an isomorphism?
- From: Matt Timmermans
- Re: Efficient way to store an isomorphism?
- Prev by Date: Re: *Real* Distributed Computing
- Next by Date: Re: asymptotic behaviour of multivariate recurrence equations?
- Previous by thread: asymptotic behaviour of multivariate recurrence equations?
- Next by thread: Re: Efficient way to store an isomorphism?
- Index(es):
Relevant Pages
|