Re: Encoding materialized path in an atomic value.

From: David Cressey <david.cressey_at_earthlink.net>
Date: Sat, 24 Sep 2005 12:55:39 GMT
Message-ID: <f1cZe.3285$vw6.1622_at_newsread1.news.atl.earthlink.net>


"Hugo Kornelis" <hugo_at_pe_NO_rFact.in_SPAM_fo> wrote in message news:4eq8j1pvan8qnmo7sh8235eamtraqmae41_at_4ax.com...
> On Fri, 23 Sep 2005 20:24:42 GMT, David Cressey wrote:

> Maybe I'm missing something here? What would the code be for your
> father's father's father's mother's father's mother? If I understand the
> method correctly, the binary LSB-first notation would be 111010. And
> that would also be 23 in decimal.
>
> >23 is, I think we will all agree "atomic" or "simple" enough so that it
> >can be stored in a single value.
>
> Yeah. But in this case, it lacks unambiguity.
>
> Best, Hugo
> --

Hugo,

You are right. I erred in the encoding scheme somehow. I don't think this ambiguity would have gotten by me.

I think they do something like adding a MSB that is always a one above the last bit that represents an ancestor.
If you do that, the ambiguity you mention disappears.

Your parents become 2 and 3
Your grandparents become 4 through 7,
Your great grandparents become 8 through 15 and so on.

Now the MSB (always a one) identifies the generation, and the remaining bits uniquely identify the individual within that generation.

And the ancestor that I incorrectly identified as 23 would have been identified as 55 (23+32).
And that person's mother would be identified as 87. (23+64)

This should devolve down into a simple case of the more general case involving primes that Mr. Tropashko is writing about. Received on Sat Sep 24 2005 - 14:55:39 CEST

Original text of this message