@@ -27,14 +27,15 @@ def test_min_flow_decomp(filename: str):
2727 weight_type = int ,
2828 subset_constraints = graph .graph ["constraints" ], # try with and without
2929 optimization_options = {
30- "optimize_with_safe_sequences" : True , # set to false to deactivate the safe sequences optimization
30+ "optimize_with_safe_sequences" : False , # set to false to deactivate the safe sequences optimization
3131 "optimize_with_safe_sequences_allow_geq_constraints" : True ,
32- "optimize_with_safe_sequences_fix_via_bounds" : True ,
32+ # "optimize_with_safe_sequences_fix_via_bounds": True,
3333 "optimize_with_safe_sequences_fix_zero_edges" : True ,
3434 },
3535 solver_options = {
3636 "external_solver" : "gurobi" , # we can try also "highs" at some point
3737 "time_limit" : 300 , # 300s = 5min, is it ok?
38+ "threads" : 1
3839 },
3940 )
4041 mfd_model .solve ()
@@ -56,7 +57,7 @@ def test_least_abs_errors(filename):
5657 "optimize_with_safe_sequences_allow_geq_constraints" : False ,
5758 },
5859 solver_options = {
59- "external_solver" : "gurobi " , # we can try also "highs" at some point
60+ "external_solver" : "highs " , # we can try also "highs" at some point
6061 "time_limit" : 300 , # 300s = 5min, is it ok?
6162 },
6263 trusted_edges_for_safety_percentile = 0 , # we trust for safety edges whose weight in >= 0 percentile, that is, all edges
@@ -75,7 +76,7 @@ def test_least_abs_errors(filename):
7576 "optimize_with_safe_sequences_allow_geq_constraints" : False ,
7677 },
7778 solver_options = {
78- "external_solver" : "gurobi " , # we can try also "highs" at some point
79+ "external_solver" : "highs " , # we can try also "highs" at some point
7980 "time_limit" : 300 , # 300s = 5min, is it ok?
8081 },
8182 trusted_edges_for_safety_percentile = 25 , # we trust for safety edges whose weight in >= 25 percentile, remove this if not using the safety optimization
@@ -99,7 +100,7 @@ def test_min_path_error(filename):
99100 "optimize_with_safe_sequences_allow_geq_constraints" : True ,
100101 },
101102 solver_options = {
102- "external_solver" : "gurobi " , # we can try also "highs" at some point
103+ "external_solver" : "highs " , # we can try also "highs" at some point
103104 "time_limit" : 300 , # 300s = 5min, is it ok?
104105 },
105106 )
@@ -115,10 +116,9 @@ def test_min_path_error(filename):
115116 optimization_options = {
116117 "optimize_with_safe_sequences" : True , # set to false to deactivate the safe sequences optimization
117118 "optimize_with_safe_sequences_allow_geq_constraints" : False ,
118- "optimize_with_safe_sequences_fix_via_bounds" : True ,
119119 },
120120 solver_options = {
121- "external_solver" : "gurobi " , # we can try also "highs" at some point
121+ "external_solver" : "highs " , # we can try also "highs" at some point
122122 "time_limit" : 300 , # 300s = 5min, is it ok?
123123 },
124124 trusted_edges_for_safety_percentile = 25 , # we trust for safety edges whose weight in >= 25 percentile, remove this if not using the safety optimization
@@ -136,10 +136,9 @@ def test_min_path_error(filename):
136136 optimization_options = {
137137 "optimize_with_safe_sequences" : True , # set to false to deactivate the safe sequences optimization
138138 "optimize_with_safe_sequences_allow_geq_constraints" : False ,
139- "optimize_with_safe_sequences_fix_via_bounds" : True ,
140139 },
141140 solver_options = {
142- "external_solver" : "gurobi " , # we can try also "highs" at some point
141+ "external_solver" : "highs " , # we can try also "highs" at some point
143142 "time_limit" : 300 , # 300s = 5min, is it ok?
144143 },
145144 )
@@ -155,20 +154,20 @@ def process_solution(model):
155154 else :
156155 print ("Model could not be solved." )
157156
158- fp .utils .draw (
159- G = model .G ,
160- filename = "solution.pdf" ,
161- flow_attr = "flow" ,
162- paths = model .get_solution ().get ('walks' , None ),
163- weights = model .get_solution ().get ('weights' , None ),
164- draw_options = {
165- "show_graph_edges" : False ,
166- "show_edge_weights" : False ,
167- "show_path_weights" : False ,
168- "show_path_weight_on_first_edge" : True ,
169- "pathwidth" : 2 ,
170- # "style": "points",
171- })
157+ # fp.utils.draw(
158+ # G=model.G,
159+ # filename= "solution.pdf",
160+ # flow_attr="flow",
161+ # paths=model.get_solution().get('walks', None),
162+ # weights=model.get_solution().get('weights', None),
163+ # draw_options={
164+ # "show_graph_edges": False,
165+ # "show_edge_weights": False,
166+ # "show_path_weights": False,
167+ # "show_path_weight_on_first_edge": True,
168+ # "pathwidth": 2,
169+ # # "style": "points",
170+ # })
172171
173172 solve_statistics = model .solve_statistics
174173 print (solve_statistics )
@@ -189,7 +188,8 @@ def process_solution(model):
189188
190189def main ():
191190 test_min_flow_decomp (filename = "tests/cyclic_graphs/gt3.kmer15.(130000.132000).V23.E32.cyc100.graph" )
192- test_min_flow_decomp (filename = "tests/cyclic_graphs/gt5.kmer27.(1300000.1400000).V809.E1091.mincyc1000.graph" )
191+ # test_min_flow_decomp(filename = "tests/cyclic_graphs/gt5.kmer27.(1300000.1400000).V809.E1091.mincyc1000.graph")
192+ test_min_flow_decomp (filename = "tests/cyclic_graphs/gt32.kmer63.(0.10000).V231.E336.mincyc1.e1.0.graph" )
193193 # test_min_flow_decomp(filename = "tests/cyclic_graphs/gt4.kmer15.(0.10000).V1096.E1622.mincyc100.e1.0.graph")
194194 test_least_abs_errors (filename = "tests/cyclic_graphs/gt5.kmer27.(655000.660000).V18.E27.mincyc4.e0.75.graph" )
195195 test_min_path_error (filename = "tests/cyclic_graphs/gt5.kmer27.(655000.660000).V18.E27.mincyc4.e0.75.graph" )
0 commit comments