Пример #1
0
def bounded_degree_heuristic_experiment(lst, bound):
    for g_seed in lst:
        G = gn.binomial_random_graph_gen(g_seed[0], g_seed[1], g_seed[2])
        G_toughness = t.degree_heuristic_toughness(G, bound)
        if (G_toughness[0] < bound):
            print("Not tough enough with atmost:")
        print(G_toughness)
Пример #2
0
def ntnh_random_binomial_graphs(N, p, start_seed, end_seed):
    ntnh_graphs = []
    for i in range(start_seed, end_seed + 1):
        G = gn.binomial_random_graph_gen(N, p, i)
        if not (bh_test.is_trivial_non_hamiltonian(G)
                or bh_test.is_trivial_hamiltonian(G)):
            if not (s_test.is_hamiltonian_SAT(G)):
                ntnh_graphs.append([N, p, i])
    return ntnh_graphs
Пример #3
0
def improved_random_approximate_experiment(lst, n_tries, bound):
    for g_seed in lst:
        G = gn.binomial_random_graph_gen(g_seed[0], g_seed[1], g_seed[2])
        G_toughness = t.improved_random_approx_toughness(G, n_tries, bound)
        print(G_toughness)
Пример #4
0
def random_approximate_heuristic_experiment(lst, n_tries):
    for g_seed in lst:
        G = gn.binomial_random_graph_gen(g_seed[0], g_seed[1], g_seed[2])
        G_toughness = t.random_approx_heuristic_toughness(G, n_tries)
        print(G_toughness)
Пример #5
0
def linear_approximate_heuristic_experiment(lst):
    for g_seed in lst:
        G = gn.binomial_random_graph_gen(g_seed[0], g_seed[1], g_seed[2])
        G_toughness = t.linear_approx_heuristic_toughness(G)
        print(G_toughness)
Пример #6
0
def naive_experiment(lst):
    for g_seed in lst:
        G = gn.binomial_random_graph_gen(g_seed[0], g_seed[1], g_seed[2])
        G_toughness = t.bounded_toughness(G, 1.5)
        print(G_toughness)