Hi @vtraag, I would like to confirm about the node label order. This question is somehow related to the OP,
Given 3 time-slice as in the figure below,
the node’s label are order in the sequence of t {1,2,3}, and can be extracted via
vertex_label = [f’{v[“name”]}-{v[“slice”]}’ for v in G.vs]
For future reader:
Assuming this is correct, then the time-dependent network flexibility (i.e.node) can be calculated as below
vertex_label = [f'{v["name"]}-{v["slice"]}' for v in G.vs]
node_label = np.array([x[0].split('-')[0] for x in vertex_label])
dic_idx = {v: np.where(node_label == v)[0].tolist() for v in np.unique(node_label)}
ntime_membership=np.array(partition_all.membership)
node_flexibility=[{dtx:flexibility_index (ntime_membership[dic_idx[dtx]])} for dtx in dic_idx]
Remark: The derivation of partition_all
can be found at this OP, the flexibility index function is embedded in this thread.