Search code examples
python-2.7networkxgraph-tool

Graph-Tool -> Networkx


I am trying to save a graph generated by Graph-Tool and read it in with Networkx. I tried the GraphML format. Unfortunately I encounter

KeyError: 'vector_float'

as in the GraphML file a property is saved as the following:

<key id="key1" for="node" attr.name="plot_color" attr.type="vector_float" />

I have read that the problem regarding the conversion Graph-Tool <---> Networkx exists for a while now. Is there any solution to this?


Solution

  • Graphml does not have support for vector types, and the above is a graph-tool extension, which has not been adopted by NetworkX. The solution, for the time being, is not to use vector types for property maps, or to convert them to strings before saving.