Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: matrix encoding IS adjacency list

Re: matrix encoding IS adjacency list

From: vc <boston103_at_hotmail.com>
Date: 19 Sep 2005 13:04:08 -0700
Message-ID: <1127160248.902438.178520@g44g2000cwa.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!

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US