MCPcopy Index your code
hub / github.com/clips/pattern / test_eigenvector_centrality

Method test_eigenvector_centrality

test/test_graph.py:239–247  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

237 print "pattern.graph.Graph.shortest_paths()"
238
239 def test_eigenvector_centrality(self):
240 # Assert eigenvector centrality.
241 self.assertEqual(self.g["a"]._weight, None)
242 v = self.g.eigenvector_centrality()
243 self.assertTrue(isinstance(v["a"], float))
244 self.assertTrue(v["a"] == v[self.g.node("a")])
245 self.assertTrue(v["a"] < v["c"])
246 self.assertTrue(v["b"] < v["c"])
247 print "pattern.graph.Graph.eigenvector_centrality()"
248
249 def test_betweenness_centrality(self):
250 # Assert betweenness centrality.

Callers

nothing calls this directly

Calls 2

nodeMethod · 0.80

Tested by

no test coverage detected