Re: matrix encoding IS adjacency list

From: vc <>
Date: 19 Sep 2005 13:04:08 -0700
Message-ID: <>

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!

It's not surprising since you maintain a sort of materialized path in every node containing pairs (parent, child), So given a path, in order to access the fifth sibling just use, that's all. Much simpler than the matrix encoding. Received on Mon Sep 19 2005 - 22:04:08 CEST

Original text of this message