As far as I know, the function in networkx for graph's transitivity is unweighted (shown as follow).
networkx.transitivity(G)
I have tried it on a weighted graph, but in the results, only edges are considered. Is there any other way in networkx to calculate weighted transitivity? Besides, I only find the way in R, but I know nothing about R.
As you stated, the
networkx.transitivityfunction computes an unweighted transitivity measure for the whole graph. If you're referencing the weighted transitivity option from the Rigraphpackage it doesn't look like networkx directly implements this calculation. However there is a functionnetworkx.clustering(G, nodes=None, weight=None)(docs) that calculates a similar metric, but the formula aren't the same.If you're looking for a python implementation of the formula from the igraph R package, you can also look into the python implementation of igraph which has a graph class with functions that compute local and global weighted transitivity (docs)