Is it feasible to sub-class, at the same time, the Graph, Vertex and Edge classes in graph-tool
in order to implement the behaviour of a certain type of graphs, such as social networks?
More specifically, I would like to have a class CollaborationNetwork(Graph)
that comprises instances of class Person(Vertex)
, class Publication(Vertex)
, class Authored(Edge)
, etc.
I imagine that the Person and Publication vertices are identified by a property_map
, while the Graph methods are wrapped into likes of add_authorship(Person, Publication)
that creates an instance of Authored
.
What I am not sure is if implementing such abstraction based on graph-tool
with makes sense and, if yes, how to connect CollaborationNetwork
to the sub-classes of Vertex and Edge.
(I know how only Subclassing Graph from the graph_tool package can work).
About the motivation:
I will be simulating the growth of a social network and will be comparing it with actual data, which is stored as a Neo4j graph.
I like the py2neo OGM approach, which represents these Person and Publication data as python objects.