Exemplo n.º 1
0
def test_rooted_product():
    G = nx.cycle_graph(5)
    H = nx.Graph()
    H.add_edges_from([('a', 'b'), ('b', 'c'), ('b', 'd')])
    R = nx.rooted_product(G, H, 'a')
    assert_equal(len(R), len(G) * len(H))
    assert_equal(R.size(), G.size() + len(G) * H.size())
Exemplo n.º 2
0
def test_rooted_product():
    G = nx.cycle_graph(5)
    H = nx.Graph()
    H.add_edges_from([("a", "b"), ("b", "c"), ("b", "d")])
    R = nx.rooted_product(G, H, "a")
    assert len(R) == len(G) * len(H)
    assert R.size() == G.size() + len(G) * H.size()
Exemplo n.º 3
0
def test_rooted_product():
    G = nx.cycle_graph(5)
    H = nx.Graph()
    H.add_edges_from([('a', 'b'), ('b', 'c'), ('b', 'd')])
    R = nx.rooted_product(G, H, 'a')
    assert_equal(len(R), len(G) * len(H))
    assert_equal(R.size(), G.size() + len(G) * H.size())
Exemplo n.º 4
0
def test_rooted_product_raises():
    nx.rooted_product(nx.Graph(), nx.path_graph(2), 10)
Exemplo n.º 5
0
def test_rooted_product_raises():
    with pytest.raises(nx.NetworkXError):
        nx.rooted_product(nx.Graph(), nx.path_graph(2), 10)
Exemplo n.º 6
0
def test_rooted_product_raises():
    nx.rooted_product(nx.Graph(), nx.path_graph(2), 10)