Obtaining the triadic closure of a Graph with graph-tool
From http://stackoverflow.com/questions/37029516/obtaining-the-triadic-closure-of-a-graph-with-graph-tool
graph_tool.topology
contains transitive_closure
, which is basically the "infinite-th" power of the adjacency matrix: what it would be nice to obtain is the second, or in general the k
-th, power.
I think it would be nice to implement this as
graph_tool.topology.transitive_closure(g, k=np.inf)
where not passing k
would result in the current behaviour while passing a (positive integer) value of k
would yield what I ask (e.g. k=1
would yield g
itself).
However I don't think that boost provides a ready solution. Maybe it could be added? It may make sense also for finitek
to go through the condensation graph, though I have no idea how much more efficient it is than just taking the k
-th power of the (boolean version of) the adjacency matrix.