def find_and_save_path(name, seed): edges, perfs = validate_file(name) graph = make_weighted_graph(edges, perfs) caller = supress_stdout(find_cover) random.seed(seed) res = caller(deepcopy(graph), find_sets) outname = "%s_path_%s.txt" % (name.replace(".in", ""), str(seed).zfill(4)) save_path(res, outname)
def find_and_save_path(filename, seed): fpath = "final_inputs/%s" % filename graph = make_weighted_graph(*validate_file(fpath)) random.seed(seed) caller = supress_stdout(find_cover) res = caller(deepcopy(graph), find_sets) outname = "paths/%s_%s_hail.txt" % (filename.replace(".in", ""), str(seed).zfill(4)) save_path(res, outname)