I have a large igraph object that has several edge and vertex attributes that i need to write to a file and load again later (probably by a different program like python).
> g
IGRAPH DN-- 85000 1000000 --
+ attr: name (v/c), numeric_var (e/n), binary_outcome1 (e/x), binary_outcome2 (e/x)
so what format should i use to be able to write all the edge attributes to the file format?
write.graph(g, file = "test1.fileextension",format = "which_format?")
Thanks very much!
The pros & cons of the various supported formats are documented pretty well in the R igraph read.igraph help file: http://igraph.sourceforge.net/doc/R/read.graph.html. The write.igraph page shows support for more types of output
Edge List is too simple for your needsPajek may be too domain-specific and has some similar limitations to GraphMLDot might be able to do what you need (ref: http://www.graphviz.org/Documentation/dotguide.pdf)GraphML wont' deal with hypergraphs, nested graphs or mixed (directed/undirected) graphs.GML says that "only node and edge attributes are used, and only if they have a simple type: integer, real or string. So if an attribute is an array or a record, then it is ignored. This is also true if only some values of the attribute are complex."DL is prbly not going to work for you. NCOL is "simply a symbolic weighted edge list" so it's prbly out, too.LGL is also prbly too simple to work.DIMACS doesn't have the extra info you need.LEDA (I believe) only supports single attributes.GraphDB also has limitations.So, I'd give either GraphML and GML a go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With