write_sol.py
PuLP SOL File Generator
Generates .sol files when using PuLP as an optimization interface. Using Gurobi is not required.
Note: .sol files are specific to the Gurobi solver. The specification can be found at: https://www.gurobi.com/documentation/9.1/refman/sol_format.html
- write_sol(pulp_problem, file_name=None)[source]
Generates a .sol file from a PuLP LpProblem object.
- Parameters
pulp_problem – PuLP LpProblem object to create .sol file from. The LpProblem object must be solved before passing it into this function.
file_name (str) – (Optional). Name (and path) of the output file. By default the output file is saved to ./pulp.sol.