当前位置: 首页>>代码示例>>Python>>正文


Python networkx.krackhardt_kite_graph方法代码示例

本文整理汇总了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 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:18,代码来源:test_closeness_centrality.py

示例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() 
开发者ID:holzschu,项目名称:Carnets,代码行数:18,代码来源:test_closeness_centrality.py

示例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 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:41,代码来源:test_degree_centrality.py

示例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) 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:15,代码来源:test_betweenness_centrality.py

示例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) 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:13,代码来源:test_betweenness_centrality.py

示例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)]) 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:30,代码来源:test_load_centrality.py

示例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) 
开发者ID:djordon,项目名称:queueing-tool,代码行数:5,代码来源:test_qndigraph.py

示例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 
开发者ID:holzschu,项目名称:Carnets,代码行数:41,代码来源:test_degree_centrality.py

示例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) 
开发者ID:holzschu,项目名称:Carnets,代码行数:14,代码来源:test_betweenness_centrality.py

示例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) 
开发者ID:holzschu,项目名称:Carnets,代码行数:12,代码来源:test_betweenness_centrality.py

示例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)]) 
开发者ID:holzschu,项目名称:Carnets,代码行数:31,代码来源:test_load_centrality.py

示例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 
开发者ID:aws-samples,项目名称:aws-kube-codesuite,代码行数:16,代码来源:test_closeness_centrality.py

示例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)]) 
开发者ID:aws-samples,项目名称:aws-kube-codesuite,代码行数:30,代码来源:test_load_centrality.py


注:本文中的networkx.krackhardt_kite_graph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。