domfilename = 'fl1577.dom'
    surplus_bound = 0.5
    node_num_upper_bound = 10000

    #for find_stable_set
    total_stable_set_surplus_bound = 1.75  # less than 2

    #for find_handle
    pattern_upper_bound = 530

    #comb_upper_bound =1.5   # less than 1

    ####################################################################

    F = build_support_graph(supp_graph_name)
    G = create_dom_graph(domfilename, surplus_bound, node_num_upper_bound)

    ## test_repetitions:
    '''
    for k in range(1,6):
        test_repetition_ktimes(k)
    '''

    ## comb_surplus_interval:
    for k in range(1, 3):  # k=1,2
        counter = 0  # number of candidate_dom (i.e. number of stable sets) considered

        # for the intervals:
        zero_to_one = 0

        one_to_two = 0
Esempio n. 2
0
                    if Fshrink.has_edge(p1_node,p2_node):
                        edge_cut_list.append((p1_node,p2_node))
            '''
            '''
            print('cut weight = %.5f' % cutweight)
            print('total surplus = %.5f' % total_surplus)
            print('cut weight + total surplus = %.5f' % cutweight+total_surplus)
            
            print('running time = %.5f seconds \n'% (end-start))
            '''
    print('Fails :(')
    return None  #[cutweight, cutweight+total_surplus, edge_cut_list]


if __name__ == '__main__':
    from domgraph import create_dom_graph

    F = build_support_graph('bowtie.x')
    G = create_dom_graph('bowtie.dom', 0.5, 5000)
    for i in range(1):
        candidate_dom, total_surplus = find_stable_set(G, 0.75)
        find_handle(F, G, candidate_dom, total_surplus, 0.9)


def find_many_combs(F, G, vio_upper_bd, surplus_bound, ncombs):
    for i in range(ncombs):
        stable = find_stable_set(G, surplus_bound)
        candidate_dom = stable[0]
        total_surplus = stable[1]
        find_handle(F, G, candidate_dom, total_surplus, vio_upper_bd)