Re: Efficiently storing a directed graph

From: Joe Conway <mail(at)joeconway(dot)com>
To: Kelly Jones <kelly(dot)terry(dot)jones(at)gmail(dot)com>
Cc: mysql(at)lists(dot)mysql(dot)com, pgsql-general(at)postgresql(dot)org, graphviz-interest(at)research(dot)att(dot)com, nmlug(at)nmlug(dot)org
Subject: Re: Efficiently storing a directed graph
Date: 2008-03-02 02:28:19
Message-ID: 47CA10C3.9010906@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kelly Jones wrote:
> I have a directed graph (nodes and edges) that I want to store
> "efficiently": given two nodes, I want to quickly find the shortest
> path between them. The graph is NOT acyclic (it's not a tree), is
> fairly "sparse" (about 10000 edges for 2500 nodes), and changes
> occasionally.
>
> I know PostgreSQL/MySQL can store graphs (as one table of nodes and
> one table of edges that reference the nodes), but I think finding the
> shortest path between two nodes is quite inefficient that way.
>
> I know PostgreSQL/MySQL have special "plugins" (like PostGIS for
> PostgreSQL) for specific problems. Is there a directed graph plugin?

Perhaps use PL/R plus one of the R packages available here:
http://cran.stat.ucla.edu/web/packages/
(e.g. http://cran.stat.ucla.edu/web/packages/igraph/index.html)
to enable data storage in Postgres and data processing in R.

R:
http://www.r-project.org/

PL/R:
http://www.joeconway.com/plr/

HTH,

Joe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Meskes 2008-03-02 10:59:56 Re: [GENERAL] ecpg problem
Previous Message Adam Rich 2008-03-01 23:02:24 Re: Efficiently storing a directed graph