How to set the solver options from a txt file. Note that, unfortunately, these options haven't seemed to improve performance above the defaults.
Save the options as a txt file in the format:
threads: 1
solver: "ipm"
run_crossover: "off"
small_matrix_value: 1e-6
large_matrix_value: 1e9
primal_feasibility_tolerance: 1e-5
dual_feasibility_tolerance: 1e-5
ipm_optimality_tolerance: 1e-4
parallel: "on"
random_seed: 123
log_to_console: False
Load it in as a dict:
with open('highs_options.txt', 'r') as file:
highs_options_dict = dict(line.strip().split(':', 1) for line in file)
Refer to the dict:
network.optimize.solve_model(solver_name="highs", solver_options=highs_options_dict)