Re: matrix encoding IS adjacency list

From: Vadim Tropashko <vadimtro_invalid_at_yahoo.com>
Date: 15 Sep 2005 17:33:05 -0700
Message-ID: <1126830785.796208.272680_at_g49g2000cwa.googlegroups.com>


Vadim Tropashko wrote:
> As it has been written elsewhere, Nested Intervals gradually evolved
> into matrix encoding. To summarize, each node of a tree is encoded with
> 4 integers, which translates into the following schema design:
>
> table MatrixTreeNodes (
> a11 integer,
> a12 integer,
> a21 integer,
> a22 integer
> );
>
> As the title of the message says, there is adjacency list relation
> hidden there! Let see, the n-th child
> [[a11_child,a12_child][a21_child,a22_child]] of the node
> [[a11_parent,a12_parent][a21_parent,a22_parent]] is calculated by the
> formulas
>
> a11_child = a11_parent * n + a12_parent
> a12_child = a11_parent
> a21_child = a21_parent * n + a22_parent
> a22_child = a21_parent

Never mind. The child is referred to parent as

a11_parent = mod(a11_child,a12_child)
a11_parent = a12_child
a21_parent = mod(a21_child,a22_child)
a21_parent = a22_child

which is not exactly referential integrity constraint:-( Received on Fri Sep 16 2005 - 02:33:05 CEST

Original text of this message