Re: graphs in PostgreSQL

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: "Ivan Yu(dot) Zolotukhin" <iz(at)itpeople(dot)ru>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: graphs in PostgreSQL
Date: 2005-10-13 15:44:00
Message-ID: BF73F900.10A96%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/13/05 8:27 AM, "Ivan Yu. Zolotukhin" <iz(at)itpeople(dot)ru> wrote:

> Hello,
>
> I'm trying to organize storage and processing of a graph (pretty spare,
> 100,000 vertices and 5,000,000 edges) with PostgreSQL.
>
> I have two main problems:
> - standart problem of finding all shortest paths between two given vertices;
> - search thru vertices' properties with ordering by path lengths from
> given vertix.
>
> So, basically, I need to decide what additional data (some preprocessed
> data about a graph or indexes) I need to store, how to store it, and how
> maintain it when graph changes.
>
> It seems that the second problem (ordering by path length) requires to
> store all path lengths between all vertices pairs (roadmap), that is
> very expensive to maintain.
>
> I would appreciate any suggestions...

Try googling for "transitive closure SQL" for some hits on the subject.

The following website describes how some folks have stored a DAG for a
biological system:
http://www.godatabase.org/dev/sql/doc/godb-sql-doc.html

I don't know if any folks from the CHADO
(http://www.gmod.org/schema/index.shtml) project can comment on computing
the transitive closure using stored procedures, but I think they do that for
their project.

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2005-10-13 15:45:38 Re: Considering an upgrade...
Previous Message Cristian Prieto 2005-10-13 15:35:18 Re: PostgreSQL's bug tracker