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: double linked list

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Wed, 29 Jan 2003 10:45:40 -0800
Message-ID: <BoVZ9.10\$v47.143@news.oracle.com>

"Jan Hidders" <hidders_at_REMOVE.THIS.uia.ua.ac.be> wrote in message news:3e37dbc8\$1_at_news.uia.ac.be...
> Juergen wrote:
> >
> >However, I dont store a consistent tree structure. The table at hand
> >is more a kind of a collection of graphs where I want to find all
> >possible paths between a given starting point and a given end point
>
> A collection of graphs? As you presented the problem it was simply a
single
> graph.

There is no such thing as a collection of graphs. Any graph in the collection can be viewed just as a (disconnected) component of the aggregate graph.

> That's not possible in a single SQL statement without using some form of
> recursion such as the CONNECT BY in Oracle that was already mentioned or
the
> recursive queries as are possible in RDB. Another "poor man's solution"
could for
> example be to add a table Reachable(node, from_a, to_b) with 'from_a' and
> 'from_b' boolean field that indicate that the node is reachable from a and
> that b is reachable from this node. You could compute this relation by
> repeating a certain SQL update statement that:
> 1. sets from_a of node n to true if there is a node n' that is reachable
> from a and there is an edge from n' to n, and
> 2. set to_b of node n to tur if there is a node n' that leads to b and
there
> is an edge from n to n'.
> You repeat that until no more flags are changed. Then you select only
those
> edges for which the begin and node have both flags set to true.

There is not much about graph labeling in the literature! In the meantime, here is one more labeling schema for the trees:

http://www.dbazine.com/tropashko4.html Received on Wed Jan 29 2003 - 12:45:40 CST

Original text of this message

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