Exemplo n.º 1
0
def test_min_maximal_matching_of_P2_through_P4_is_1():
    for i in range(2, 5):
        P = gp.path_graph(i)
        assert(gp.min_maximal_matching_number(P) == 1)
Exemplo n.º 2
0
 def test_total_zero_forcing_number_of_path_is_2(self):
     G = gp.path_graph(5)
     assert(gp.total_zero_forcing_number(G) == 2)
Exemplo n.º 3
0
def test_matching_number_of_path_is_ceil_of_half_of_edges():
    for i in range(2, 12):
        P = gp.path_graph(i)
        m = math.ceil(gp.number_of_edges(P) / 2)
        assert(gp.matching_number(P, method='bf') == m)
        assert(gp.matching_number(P, method='ilp') == m)
Exemplo n.º 4
0
 def test_pair_of_adjacent_nodes_is_total_forcing_set_of_path(self):
     G = gp.path_graph(6)
     assert(gp.is_total_zero_forcing_set(G, [2, 3]) == True)
Exemplo n.º 5
0
 def test_leaf_is_not_total_forcing_set_of_path(self):
     G = gp.path_graph(3)
     assert(gp.is_total_zero_forcing_set(G, [0]) == False)
Exemplo n.º 6
0
 def test_leaf_is_zero_forcing_set_of_path(self):
     G = gp.path_graph(3)
     assert(gp.is_zero_forcing_set(G, [0]) == True)
Exemplo n.º 7
0
 def test_endpoint_is_connected_forcing_set_of_path(self):
     G = gp.path_graph(2)
     assert(gp.is_connected_zero_forcing_set(G, [0]))
Exemplo n.º 8
0
def test_connected_domination_number_of_P5_is_3():
    G = gp.path_graph(5)
    assert (gp.connected_domination_number(G) == 3)