示例#1
0
 def test_cubical(self):
     G = nx.cubical_graph()
     assert nx.generalized_degree(G, 0) == {0: 3}
示例#2
0
 def test_k5(self):
     G = nx.complete_graph(5)
     assert nx.generalized_degree(G, 0) == {3: 4}
     G.remove_edge(0, 1)
     assert nx.generalized_degree(G, 0) == {2: 3}
示例#3
0
 def test_generalized_degree(self):
     G = nx.Graph()
     assert nx.generalized_degree(G) == {}
示例#4
0
 def test_path(self):
     G = nx.path_graph(5)
     assert nx.generalized_degree(G, 0) == {0: 1}
     assert nx.generalized_degree(G, 1) == {0: 2}
示例#5
0
 def test_k5(self):
     G = nx.complete_graph(5)
     assert_equal(nx.generalized_degree(G,0), {3: 4})
     G.remove_edge(0,1)
     assert_equal(nx.generalized_degree(G, 0), {2: 3})
示例#6
0
 def test_cubical(self):
     G = nx.cubical_graph()
     assert_equal(nx.generalized_degree(G,0), {0: 3})
示例#7
0
 def test_path(self):
     G = nx.path_graph(5)
     assert_equal(nx.generalized_degree(G,0), {0: 1})
     assert_equal(nx.generalized_degree(G,1), {0: 2})
示例#8
0
 def test_generalized_degree(self):
     G = nx.Graph()
     assert_equal(nx.generalized_degree(G),{})
示例#9
0
    def analyze_clustering():

        print("Average clustering:", nx.average_clustering(network))
        print("Clustering:", nx.clustering(network))
        print("Generalized degree:", nx.generalized_degree(network))