Пример #1
0
 def test_general_random_intersection_graph(self):
     G = nx.general_random_intersection_graph(10, 5, [0.1, 0.2, 0.2, 0.1, 0.1])
     assert len(G) == 10
     pytest.raises(
         ValueError,
         nx.general_random_intersection_graph,
         10,
         5,
         [0.1, 0.2, 0.2, 0.1],
     )
Пример #2
0
def intersection_graphs():
    print("Intersection graphs")
    print("Uniform random intersection graph")
    G = nx.uniform_random_intersection_graph(n=14, m=5, p=0.07)
    draw_graph(G)
    print("K-random intersection graphs")
    G = nx.k_random_intersection_graph(n=12, m=6, k=5)
    draw_graph(G)
    print("General random intersection graphs")
    G = nx.general_random_intersection_graph(n=6,
                                             m=6,
                                             p=(0.25, 0.23, 0.8, 0.1, 0.8,
                                                0.06))
    draw_graph(G)
Пример #3
0
 def test_general_random_intersection_graph(self):
     G = nx.general_random_intersection_graph(10, 5,
                                              [0.1, 0.2, 0.2, 0.1, 0.1])
     assert_equal(len(G), 10)
     assert_raises(ValueError, nx.general_random_intersection_graph, 10, 5,
                   [0.1, 0.2, 0.2, 0.1])
 def test_general_random_intersection_graph(self):
     G=nx.general_random_intersection_graph(10,5,[0.1,0.2,0.2,0.1,0.1])
     assert_equal(len(G),10)
     assert_raises(ValueError, nx.general_random_intersection_graph,10,5,
                   [0.1,0.2,0.2,0.1])