Example #1
0
def test_is_k_edge_connected():
    G = nx.barbell_graph(10, 0)
    assert is_k_edge_connected(G, k=1)
    assert not is_k_edge_connected(G, k=2)

    G = nx.Graph()
    G.add_nodes_from([5, 15])
    assert not is_k_edge_connected(G, k=1)
    assert not is_k_edge_connected(G, k=2)

    G = nx.complete_graph(5)
    assert is_k_edge_connected(G, k=1)
    assert is_k_edge_connected(G, k=2)
    assert is_k_edge_connected(G, k=3)
    assert is_k_edge_connected(G, k=4)
Example #2
0
def test_is_k_edge_connected():
    G = nx.barbell_graph(10, 0)
    assert_true(is_k_edge_connected(G, k=1))
    assert_false(is_k_edge_connected(G, k=2))

    G = nx.Graph()
    G.add_nodes_from([5, 15])
    assert_false(is_k_edge_connected(G, k=1))
    assert_false(is_k_edge_connected(G, k=2))

    G = nx.complete_graph(5)
    assert_true(is_k_edge_connected(G, k=1))
    assert_true(is_k_edge_connected(G, k=2))
    assert_true(is_k_edge_connected(G, k=3))
    assert_true(is_k_edge_connected(G, k=4))
def test_is_k_edge_connected():
    G = nx.barbell_graph(10, 0)
    assert_true(is_k_edge_connected(G, k=1))
    assert_false(is_k_edge_connected(G, k=2))

    G = nx.Graph()
    G.add_nodes_from([5, 15])
    assert_false(is_k_edge_connected(G, k=1))
    assert_false(is_k_edge_connected(G, k=2))

    G = nx.complete_graph(5)
    assert_true(is_k_edge_connected(G, k=1))
    assert_true(is_k_edge_connected(G, k=2))
    assert_true(is_k_edge_connected(G, k=3))
    assert_true(is_k_edge_connected(G, k=4))