本文整理汇总了Python中networkx.krackhardt_kite_graph方法的典型用法代码示例。如果您正苦于以下问题:Python networkx.krackhardt_kite_graph方法的具体用法?Python networkx.krackhardt_kite_graph怎么用?Python networkx.krackhardt_kite_graph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networkx
的用法示例。
在下文中一共展示了networkx.krackhardt_kite_graph方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4=nx.cycle_graph(4)
self.T=nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0,1), (0,2), (1,3), (2,3),
(2,4), (4,5), (3,5)])
F = nx.florentine_families_graph()
self.F = F
示例2: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4 = nx.cycle_graph(4)
self.T = nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0, 1), (0, 2), (1, 3), (2, 3),
(2, 4), (4, 5), (3, 5)])
F = nx.florentine_families_graph()
self.F = F
self.LM = nx.les_miserables_graph()
示例3: __init__
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def __init__(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.K5 = nx.complete_graph(5)
F = nx.Graph() # Florentine families
F.add_edge('Acciaiuoli','Medici')
F.add_edge('Castellani','Peruzzi')
F.add_edge('Castellani','Strozzi')
F.add_edge('Castellani','Barbadori')
F.add_edge('Medici','Barbadori')
F.add_edge('Medici','Ridolfi')
F.add_edge('Medici','Tornabuoni')
F.add_edge('Medici','Albizzi')
F.add_edge('Medici','Salviati')
F.add_edge('Salviati','Pazzi')
F.add_edge('Peruzzi','Strozzi')
F.add_edge('Peruzzi','Bischeri')
F.add_edge('Strozzi','Ridolfi')
F.add_edge('Strozzi','Bischeri')
F.add_edge('Ridolfi','Tornabuoni')
F.add_edge('Tornabuoni','Guadagni')
F.add_edge('Albizzi','Ginori')
F.add_edge('Albizzi','Guadagni')
F.add_edge('Bischeri','Guadagni')
F.add_edge('Guadagni','Lamberteschi')
self.F = F
G = nx.DiGraph()
G.add_edge(0,5)
G.add_edge(1,5)
G.add_edge(2,5)
G.add_edge(3,5)
G.add_edge(4,5)
G.add_edge(5,6)
G.add_edge(5,7)
G.add_edge(5,8)
self.G = G
示例4: test_krackhardt_kite_graph
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def test_krackhardt_kite_graph(self):
"""Betweenness centrality: Krackhardt kite graph"""
G=nx.krackhardt_kite_graph()
b_answer={0: 1.667,1: 1.667,2: 0.000,3: 7.333,4: 0.000,
5: 16.667,6: 16.667,7: 28.000,8: 16.000,9: 0.000}
for b in b_answer:
b_answer[b]/=2.0
b=nx.betweenness_centrality(G,
weight=None,
normalized=False)
for n in sorted(G):
assert_almost_equal(b[n],b_answer[n],places=3)
示例5: test_krackhardt_kite_graph_normalized
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def test_krackhardt_kite_graph_normalized(self):
"""Betweenness centrality: Krackhardt kite graph normalized"""
G=nx.krackhardt_kite_graph()
b_answer={0:0.023,1:0.023,2:0.000,3:0.102,4:0.000,
5:0.231,6:0.231,7:0.389,8:0.222,9:0.000}
b=nx.betweenness_centrality(G,
weight=None,
normalized=True)
for n in sorted(G):
assert_almost_equal(b[n],b_answer[n],places=3)
示例6: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
G=nx.Graph();
G.add_edge(0,1,weight=3)
G.add_edge(0,2,weight=2)
G.add_edge(0,3,weight=6)
G.add_edge(0,4,weight=4)
G.add_edge(1,3,weight=5)
G.add_edge(1,5,weight=5)
G.add_edge(2,4,weight=1)
G.add_edge(3,4,weight=2)
G.add_edge(3,5,weight=1)
G.add_edge(4,5,weight=4)
self.G=G
self.exact_weighted={0: 4.0, 1: 0.0, 2: 8.0, 3: 6.0, 4: 8.0, 5: 0.0}
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4=nx.cycle_graph(4)
self.T=nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0, 1), (0, 2), (1, 3), (2, 3),
(2, 4), (4, 5), (3, 5)])
self.F = nx.florentine_families_graph()
self.D = nx.cycle_graph(3, create_using=nx.DiGraph())
self.D.add_edges_from([(3, 0), (4, 3)])
示例7: setUpClass
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUpClass(cls):
cls.g = qt.QueueNetworkDiGraph(nx.krackhardt_kite_graph())
np.random.seed(10)
示例8: __init__
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def __init__(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.K5 = nx.complete_graph(5)
F = nx.Graph() # Florentine families
F.add_edge('Acciaiuoli', 'Medici')
F.add_edge('Castellani', 'Peruzzi')
F.add_edge('Castellani', 'Strozzi')
F.add_edge('Castellani', 'Barbadori')
F.add_edge('Medici', 'Barbadori')
F.add_edge('Medici', 'Ridolfi')
F.add_edge('Medici', 'Tornabuoni')
F.add_edge('Medici', 'Albizzi')
F.add_edge('Medici', 'Salviati')
F.add_edge('Salviati', 'Pazzi')
F.add_edge('Peruzzi', 'Strozzi')
F.add_edge('Peruzzi', 'Bischeri')
F.add_edge('Strozzi', 'Ridolfi')
F.add_edge('Strozzi', 'Bischeri')
F.add_edge('Ridolfi', 'Tornabuoni')
F.add_edge('Tornabuoni', 'Guadagni')
F.add_edge('Albizzi', 'Ginori')
F.add_edge('Albizzi', 'Guadagni')
F.add_edge('Bischeri', 'Guadagni')
F.add_edge('Guadagni', 'Lamberteschi')
self.F = F
G = nx.DiGraph()
G.add_edge(0, 5)
G.add_edge(1, 5)
G.add_edge(2, 5)
G.add_edge(3, 5)
G.add_edge(4, 5)
G.add_edge(5, 6)
G.add_edge(5, 7)
G.add_edge(5, 8)
self.G = G
示例9: test_krackhardt_kite_graph
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def test_krackhardt_kite_graph(self):
"""Betweenness centrality: Krackhardt kite graph"""
G = nx.krackhardt_kite_graph()
b_answer = {0: 1.667, 1: 1.667, 2: 0.000, 3: 7.333, 4: 0.000,
5: 16.667, 6: 16.667, 7: 28.000, 8: 16.000, 9: 0.000}
for b in b_answer:
b_answer[b] /= 2
b = nx.betweenness_centrality(G,
weight=None,
normalized=False)
for n in sorted(G):
assert_almost_equal(b[n], b_answer[n], places=3)
示例10: test_krackhardt_kite_graph_normalized
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def test_krackhardt_kite_graph_normalized(self):
"""Betweenness centrality: Krackhardt kite graph normalized"""
G = nx.krackhardt_kite_graph()
b_answer = {0: 0.023, 1: 0.023, 2: 0.000, 3: 0.102, 4: 0.000,
5: 0.231, 6: 0.231, 7: 0.389, 8: 0.222, 9: 0.000}
b = nx.betweenness_centrality(G,
weight=None,
normalized=True)
for n in sorted(G):
assert_almost_equal(b[n], b_answer[n], places=3)
示例11: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
G = nx.Graph()
G.add_edge(0, 1, weight=3)
G.add_edge(0, 2, weight=2)
G.add_edge(0, 3, weight=6)
G.add_edge(0, 4, weight=4)
G.add_edge(1, 3, weight=5)
G.add_edge(1, 5, weight=5)
G.add_edge(2, 4, weight=1)
G.add_edge(3, 4, weight=2)
G.add_edge(3, 5, weight=1)
G.add_edge(4, 5, weight=4)
self.G = G
self.exact_weighted = {0: 4.0, 1: 0.0, 2: 8.0, 3: 6.0, 4: 8.0, 5: 0.0}
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4 = nx.cycle_graph(4)
self.T = nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0, 1), (0, 2), (1, 3), (2, 3),
(2, 4), (4, 5), (3, 5)])
self.F = nx.florentine_families_graph()
self.LM = nx.les_miserables_graph()
self.D = nx.cycle_graph(3, create_using=nx.DiGraph())
self.D.add_edges_from([(3, 0), (4, 3)])
示例12: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4 = nx.cycle_graph(4)
self.T = nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0, 1), (0, 2), (1, 3), (2, 3),
(2, 4), (4, 5), (3, 5)])
F = nx.florentine_families_graph()
self.F = F
示例13: setUp
# 需要导入模块: import networkx [as 别名]
# 或者: from networkx import krackhardt_kite_graph [as 别名]
def setUp(self):
G = nx.Graph()
G.add_edge(0, 1, weight=3)
G.add_edge(0, 2, weight=2)
G.add_edge(0, 3, weight=6)
G.add_edge(0, 4, weight=4)
G.add_edge(1, 3, weight=5)
G.add_edge(1, 5, weight=5)
G.add_edge(2, 4, weight=1)
G.add_edge(3, 4, weight=2)
G.add_edge(3, 5, weight=1)
G.add_edge(4, 5, weight=4)
self.G = G
self.exact_weighted = {0: 4.0, 1: 0.0, 2: 8.0, 3: 6.0, 4: 8.0, 5: 0.0}
self.K = nx.krackhardt_kite_graph()
self.P3 = nx.path_graph(3)
self.P4 = nx.path_graph(4)
self.K5 = nx.complete_graph(5)
self.C4 = nx.cycle_graph(4)
self.T = nx.balanced_tree(r=2, h=2)
self.Gb = nx.Graph()
self.Gb.add_edges_from([(0, 1), (0, 2), (1, 3), (2, 3),
(2, 4), (4, 5), (3, 5)])
self.F = nx.florentine_families_graph()
self.D = nx.cycle_graph(3, create_using=nx.DiGraph())
self.D.add_edges_from([(3, 0), (4, 3)])