haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

hmatrix-glpk: feasible solution / objective function with zero variables #239

Closed jwaldmann closed 6 years ago

jwaldmann commented 7 years ago

I just want a some feasible solution for an LP.

I thought I'd just get this with goal = Maximize [] but it's rejected by hmatrix-glpk. Why? Could the underlying GLPK solver do this? Or would it have a different method for that? Which could then be expose to Haskell land?

Actually my expectation was data Optimization = Maximize [Double] | Minimize [Double] | Feasible.

albertoruiz commented 7 years ago

Sorry for the late reply.

You can use a dummy cost (e.g. [1,1...]) to avoid the error.

I agree that looking only for a feasible solution would be a good and faster option. I don't remember at the moment if you can do this easily with glpk.

idontgetoutmuch commented 6 years ago

@jwaldmann does that work for you? I am going to close the issue but feel free to re-open.

jwaldmann commented 4 years ago

I agree that looking only for a feasible solution would be a good and faster option. I don't remember at the moment if you can do this easily with glpk.

https://en.wikibooks.org/wiki/GLPK/Modeling_tips#All_feasible_solutions suggests

I will look into this.