Load a boost::graph from file
Description
Models working with networks usually store the created graph in the data.h5
file as a list of vertices and edges.
So far, the graphs are always created anew on model initialization, a routine to load from file could be useful e.g. for reproducibility.
Also, there is a growing list of evergreen graph examples in network science (karate club, science collaboration, ...) that could be loaded from an appropriate format.
Proposal
Implement a load_from_file
graph creation algorithm in utopia/core/graph/creation.hh
that calls a loader in utopia/data_io/graph_utils.hh
.
Probably most useful is an algorithm that finds the default graph keys _vertices
and _edges
in a specified .h5
file that previous model runs have written out.
How to test the implementation?
Test at least for all creation algorithms (reg, ER, WS, BA, BR) and for an externally created graph.
Related issues
In what format are graphs usually found (e.g. networkx graphs)
and how can they be transformed to .h5
--- write python script with h5py