Hi all,
I use Python, but I am new to graph_tool and I have three simple questions I couldn’t find in the documentation.
1. Is there a MULTI LAYER feature?
I have 7 layers of different transport network, nodes and edges and some nodes connect among the layers.
Would the layer of the multiplex only be an attribute of the edges? Or is there an explicit configuration I should follow?
1. From the first checking of the documentation, I am assuming I have to build my Graph from the ground up.
* Create vertices
* Create properties (coordinates, weight of edges, names of nodes, layers)
* Generate edges
Given this format of lists of nodes and edges is there an automatic way of loading the Graph?
I have 7 layers of different transport network, nodes and edges and some
nodes connect among the layers.
Would the layer of the multiplex only be an attribute of the edges? Or is
there an explicit configuration I should follow?
Multilayer graphs are nothing but normal graphs with attributes on the
edges. In graph-tool, these attributes are supported via property maps, as
described in the documentation.
2. From the first checking of the documentation, I am assuming I have to
build my Graph from the ground up.
1. Create vertices
2. Create properties (coordinates, weight of edges, names of nodes, layers)
3. Generate edges
Given this format of lists of nodes and edges is there an
automatic way of loading the Graph?
edges.head(2)
orig orig\_layer dest dest\_layer weight
0 node_1 Roads node_27306 Roads 0.840336
1 node_1 Roads node_81562 Roads 0.869565
nodes.head(2)
nodeID nodeLabel nodeLong nodeLat
0 1 node_1 -43.436771 -22.869942
1 2 node_2 -43.360008 -22.892489
No, this format is not supported (why would it be?), but several general
formats are: graphml, gml, dot and gt.
3. Setting the LONG LAT as attributes is enough to later draw the network
with the nodes in the correct coordinate position?
If you mean to ask if graph_draw() automatically projects latitude and
longitude to cartesian coordinates, the answer is no.