Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 598
user142040 Avatar asked Sep 17 '26 08:09

user142040


1 Answers

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.

like image 77
Tiago Peixoto Avatar answered Sep 19 '26 20:09

Tiago Peixoto