Rumor Centrality#
- cosasi.source_inference.single_source.rumor_centrality.rumor_centrality(I, G=None, v=None, normalize=True, only_roots=False)#
Computes rumor centrality for all nodes in G.
- Parameters
I (NetworkX Graph) – The infection subgraph observed at a particular time step
G (NetworkX Graph (optional)) – The original graph the infection process was run on. I is a subgraph of G induced by infected vertices at observation time. This is not actually used, but exists to match the format of other algorithms
v (graph index - str, int, etc. (optional)) – if provided, returns the rumor centrality of v only.
normalize (bool) – If True, scales all rumor centrality values to between 0 and 1
only_roots (bool) – Aggregation strategy, as we compute rumor_centrality_root over all possible root nodes. If True, we only keep the rumor_centrality_root value for the root node If False, we keep the rumor_centrality_root values for all nodes
Notes
Rumor centrality was introduced in the seminal work [1]. rumor_centrality_root is a more “literal” interpretation of their algorithm. rumor_centrality (this function) averages these results over all possible BFS rooting schemes.
Examples
>>> result = cosasi.single_source.rumor_centrality(I, G)
References
- 1
S., Devavrat and T. Zaman, “Rumors in a network: Who’s the culprit?.” IEEE Transactions on Information Theory, 2011 https://devavrat.mit.edu/wp-content/uploads/2017/10/Rumors-in-a-network-whos-the-culprit.pdf
- cosasi.source_inference.single_source.rumor_centrality.rumor_centrality_root(I, v, return_all_values=True)#
Computes rumor centrality for all nodes, assuming a spanning tree rooted at v.
- Parameters
I (NetworkX Graph) – The infection subgraph observed at a particular time step
v (graph index - str, int, etc.) – The vertex rooting
return_all_values (bool) – Specifies whether you want the full rumor centrality dict. If False, returns only the value for node v
Notes
Rumor centrality was introduced in the seminal work [1]. This is a more “literal” interpretation of their algorithm. rumor_centrality averages these results over all possible BFS rooting schemes.
References
- 1
S. Devavrat and T. Zaman, “Rumors in a network: Who’s the culprit?.” IEEE Transactions on Informatidon Theory, 2011 https://devavrat.mit.edu/wp-content/uploads/2017/10/Rumors-in-a-network-whos-the-culprit.pdf