Hi all,

Relative graph-tool newbie here. I have a situation which I'm not sure how to approach in an efficient manner. I was hoping maybe someone could give some insight here.

Basically, I want to generate an undirected Price network of N nodes, but I would like to be able to "look back" and access the subgraph when the network was only "k" nodes large. For simplicity's, say I'm adding one edge per vertex (i.e. m=1).

One obvious way to do this seems to be to write a generator where, after adding the k-th vertex, you append a copy of the graph at that time onto some list. Then at the end you would have a list of length N where each element is a graph object.

However... this seems kind of like overkill. I was thinking another way to do this is to generate only one graph, but give each node and edge an "age" attribute (as in the example in the tutorial). Then you could get the time-k subgraph by selecting only nodes and edges that have age less than k.

Is there an obvious way to implement this in graph-tool? Specifically, for each time-k subgraph I'd want to be able to access the degree distribution at that time, and also the usual properties of the graph such as neighbors of a given node, etc.

Many thanks,
Jimmy