pulp
pulp copied to clipboard
Allow longer variable names when Solving an LP?
Describe the new feature
It took a while to suss out the problem I was having last night, but it looks like when I'm solving a model (Specifically with Gurobi 8.1.1 (GUROBI_CMD)). I thought that the LP variable name could be up to 255 characters. It looks like there is no link between allowing the full 255 character variable names and problem.solve()
Additional info
Please answer these questions before submitting your feature request.
Is your feature request related to an issue? Please include the issue number.
Not as far as I can tell
Does this feature exist in another product or project? Please provide a link.
No, but the LP file spec from Gurobi is here : https://www.gurobi.com/documentation/9.1/refman/lp_format.html#format:LP
Good day,
Indeed the writeLP function has a default argument of max_length set to 100. We could add some way of specifying this max_length when solving and passing it to writeLP when generating the file.
As a workaround, try using the GUROBI interface, you shouldn't have a limit there.
Is there a reason why it took you long to detect the problem? I think we have a pretty explicit error for variables with more than the required characters.