Linear Programming in Python (2023)
slama.dev
Linear Programming in Python (2023)
1–10 of 56 posts
Re: Linear Programming in Python (2023)
#2I wish python and it’s libraries wasn’t so inefficient.
Re: Linear Programming in Python (2023)
#3I have often started modeling problems with pulp. As the problem size gets bigger, pulp will fail to work —- that is, pulp handles writing out large problems to disk (nlogn complexity) worse than gurobi handles reading and solving them (expn complexity). Then I end up writing out the problems into text files on python „by hand“, which is very cumbersome. I wish python and it’s libraries wasn’t so inefficient.
Re: Linear Programming in Python (2023)
#4I have often started modeling problems with pulp. As the problem size gets bigger, pulp will fail to work —- that is, pulp handles writing out large problems to disk (nlogn complexity) worse than gurobi handles reading and solving them (expn complexity). Then I end up writing out the problems into text files on python „by hand“, which is very cumbersome. I wish python and it’s libraries wasn’t so inefficient.
Maybe I'm misunderstanding something here and it's the abstraction API causing the problems, but it seems like it's up to the solver implementation to be efficient here?
Re: Linear Programming in Python (2023)
#5Re: Linear Programming in Python (2023)
#6I have often started modeling problems with pulp. As the problem size gets bigger, pulp will fail to work —- that is, pulp handles writing out large problems to disk (nlogn complexity) worse than gurobi handles reading and solving them (expn complexity). Then I end up writing out the problems into text files on python „by hand“, which is very cumbersome. I wish python and it’s libraries wasn’t so inefficient.
Re: Linear Programming in Python (2023)
#7Fwiw, reinforcement learning offers objectively better optimization and more efficient inference than LP in many cases.
Re: Linear Programming in Python (2023)
#8Fwiw, reinforcement learning offers objectively better optimization and more efficient inference than LP in many cases.
Also, LP often offers perfectly acceptable optimization and latency. The only case where this isn't true for offline problems is where LP times out or where relaxations of the problem are required to prevent timeout.
If I had to choose one method to learn, I guess I would learn RL. But it's a false choice. Given that I know both well, I'd reach for LP unless there was a good reason to use RL instead. And from a user perspective LP is much easier to learn than RL (see cons), so I think this is good general advice. Definitely worth having both tools on your belt if you plan on working on problems where either is a good fit.
Re: Linear Programming in Python (2023)
#9Fwiw, reinforcement learning offers objectively better optimization and more efficient inference than LP in many cases.
Any good examples or notebooks using RL to solve typical optimization problems?
Re: Linear Programming in Python (2023)
#10Fwiw, reinforcement learning offers objectively better optimization and more efficient inference than LP in many cases.
I don't follow. Linear programming (with the simplex method) finds the optimal solution set for any linear program eventually. How can reinforcement learning be "better" apart from efficiency?