Persistent storage for NetworkX graphs

94 views
Skip to first unread message

Vincent Gauthier

unread,
Mar 16, 2012, 7:12:06 PM3/16/12
to networkx...@googlegroups.com
Hi !

After a quick search through the group topics I don't see anymore update on a persistent storage solution for networkx, any idea on how this issue are going to be handle, is it still active ?

For now any idea how to implement a quick and dirty solution to address this issue ?

Regards, 
Vincent
  

 

Federico Vaggi

unread,
Mar 17, 2012, 6:36:37 AM3/17/12
to networkx-discuss
Maybe I am confused, but if you are discussing serialization, pickle
and cPickle both work fine.

Pengkui Luo

unread,
Mar 17, 2012, 4:26:02 AM3/17/12
to networkx-discuss
Hi Vincent,

My "dirty solution" is using pickle. E.g.

In [1]: import gzip

In [2]: import cPickle as pickle

In [3]: import networkx as nx

In [4]: G1 = nx.Graph()

In [5]: G1.add_path([1, 2, 3])

In [6]: with gzip.open('test.gz', 'wb') as fout:
   ...:     pickle.dump(G1, fout, protocol=2)
   ...:

In [7]: with gzip.open('test.gz', 'rb') as fin:
   ...:     G2 = pickle.load(fin)
   ...:

In [8]: G2.adj
Out[8]: {1: {2: {}}, 2: {1: {}, 3: {}}, 3: {2: {}}}

Best,
Pengkui

Aric Hagberg

unread,
Mar 18, 2012, 8:33:43 PM3/18/12
to networkx...@googlegroups.com
On Fri, Mar 16, 2012 at 5:12 PM, Vincent Gauthier <p...@luxbulb.org> wrote:
> Hi !
>
> After a quick search through the group topics I don't see anymore update on
> a persistent storage solution for networkx, any idea on how this issue are
> going to be handle, is it still active ?

There was a short discussion last year
https://groups.google.com/forum/#!topic/networkx-discuss/lOhordMuUmE ,
but nobody has mentioned any update since then. I'd like to have a
graph database storage option. I'm not up-to-date on the latest
developments so if someone can suggest which one might be appropriate
I'd look into it. It should have a compatible license with NetworkX's
BSD license.

Aric

Timmy Wilson

unread,
Mar 18, 2012, 8:48:32 PM3/18/12
to networkx...@googlegroups.com
I'm curious what the most used/standard graph format is?

Cytoscape lists a bunch here:

http://wiki.cytoscape.org/Cytoscape_User_Manual/Network_Formats

Does anyone know offhand what's the most widely supported?

> --
> You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
> To post to this group, send email to networkx...@googlegroups.com.
> To unsubscribe from this group, send email to networkx-discu...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/networkx-discuss?hl=en.
>

Reply all
Reply to author
Forward
0 new messages