Exemplo n.º 1
0
 def test_cubical(self):
     G = nx.cubical_graph()
     assert nx.generalized_degree(G, 0) == {0: 3}
Exemplo n.º 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}
Exemplo n.º 3
0
 def test_generalized_degree(self):
     G = nx.Graph()
     assert nx.generalized_degree(G) == {}
Exemplo n.º 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}
Exemplo n.º 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})
Exemplo n.º 6
0
 def test_cubical(self):
     G = nx.cubical_graph()
     assert_equal(nx.generalized_degree(G,0), {0: 3})
Exemplo n.º 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})
Exemplo n.º 8
0
 def test_generalized_degree(self):
     G = nx.Graph()
     assert_equal(nx.generalized_degree(G),{})
Exemplo n.º 9
0
    def analyze_clustering():

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