Calculates eigenvector centrality and returns a node => weight dictionary. Node.weight is updated in the process. Node.weight is higher for nodes with a lot of (indirect) incoming traffic.
(self, normalized=True, reversed=True, rating={}, iterations=100, tolerance=0.0001)
| 452 | return p |
| 453 | |
| 454 | def eigenvector_centrality(self, normalized=True, reversed=True, rating={}, iterations=100, tolerance=0.0001): |
| 455 | """ Calculates eigenvector centrality and returns a node => weight dictionary. |
| 456 | Node.weight is updated in the process. |
| 457 | Node.weight is higher for nodes with a lot of (indirect) incoming traffic. |
| 458 | """ |
| 459 | ec = eigenvector_centrality(self, normalized, reversed, rating, iterations, tolerance) |
| 460 | ec = nodedict(self, ((self[id], w) for id, w in ec.iteritems())) |
| 461 | for n, w in ec.iteritems(): |
| 462 | n._weight = w |
| 463 | return ec |
| 464 | |
| 465 | def betweenness_centrality(self, normalized=True, directed=False): |
| 466 | """ Calculates betweenness centrality and returns a node => weight dictionary. |