Hi everyone, I come back with my problem with purge but on a different perspective. It seems that there is really a weird thing going on (or I missed something which is highly possible).
The code is the following :_graph.vertex_properties["_graphml_vertex_id"] = _name
_graph.vertex_properties["location"] = _position
_graph.edge_properties["_graphml_edge_id"] = _edgeName
_graph.edge_properties["speed"] = _speed
_graph.edge_properties["time"] = _time
_graph.edge_properties["capacity"] = _capacity
_graph.edge_properties["vehicles"] = _vehicles
_graph
Out[27]:
<Graph object, directed, with 2622 vertices and 8765 edges at 0x1443a3d0>
Starting from this graph, I extract the strongly connected component
_sccFiltered = gt.GraphView(_graph, vfilt = topo.label_largest_component(_graph))
_scc = gt.Graph(_sccFiltered)
_scc.purge_vertices()
_scc.purge_edges()
_scc
Out[28]:
<Graph object, directed, with 2554 vertices and 8689 edges, edges filtered by
(<PropertyMap object with key type 'Edge' and value type 'bool',
for Graph 0x144417d0, at 0x14457450>, False), vertices filtered by
(<PropertyMap object with key type 'Vertex' and value type 'bool', for Graph 0x144417d0, at 0x1442abd0>, False) at 0x144417d0>
Now if I save the graph with
_scc.save('network-busesAndTrains.xml.gz')
the saved graph is all screwed up. The property maps do not correspond to the right vertices. But if I do before saving_scc.vertex_properties['origin'] = _origin
_scc.vertex_properties['destination'] = _destination
_scc.vertex_properties["_graphml_vertex_id"] = _name
_scc.vertex_properties["location"] = _position
_scc.edge_properties["_graphml_edge_id"] = _edgeName
_scc.edge_properties["speed"] = _speed
_scc.edge_properties["time"] = _time
_scc.edge_properties["capacity"] = _capacity
_scc.edge_properties["vehicles"] = _vehicles