Ejemplo n.º 1
0
def test_not_node():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {3}]))
Ejemplo n.º 2
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0}, {1}]))
Ejemplo n.º 3
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {1, 2}]))
Ejemplo n.º 4
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [{0, 1}, {2}]))
    assert_true(is_partition(G, ({0, 1}, {2})))
    assert_true(is_partition(G, ([0, 1], [2])))
    assert_true(is_partition(G, [[0, 1], [2]]))
Ejemplo n.º 5
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0, 1]), set([1, 2])]))
Ejemplo n.º 6
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0]), set([1])]))
Ejemplo n.º 7
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [set([0, 1]), set([2])]))
Ejemplo n.º 8
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [{0, 1}, {2}]))