Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

varEq on a BinVar is ignored. #10

Open
ghost opened this issue Aug 1, 2018 · 7 comments
Open

varEq on a BinVar is ignored. #10

ghost opened this issue Aug 1, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Aug 1, 2018

Suppose we have an LP v c with setVarKind x BinVar at the top. Later on, I might like to set varEq x 0 or even to 1, but never a non-binary value, to rule x out or make it certain under chosen conditions. Currently this varEq is ignored and the only constraint that goes through to the linear programme is that 0 <= x <= 1 and that x is general.

@ghost
Copy link
Author

ghost commented Aug 1, 2018

Looking into this further (Data.LinearProgram.GLPK.Internal), this seems to be more of a feature of GLPK. What's your opinion on this?

@jyp
Copy link
Owner

jyp commented Aug 1, 2018 via email

@ghost
Copy link
Author

ghost commented Aug 3, 2018

Maybe I didn't explain in the best way. setVarKind x BinVar followed by varEq x 0 is equivalent to setVarKind x BinVar alone. The varEq x 0 is ignored. I first assumed that this was a problem with glpk-hs, but it turns out that it is a "feature" of glpk itself.

@jyp
Copy link
Owner

jyp commented Nov 14, 2018

Thanks for documenting the issue. Perhaps you'll want to push this upstream.

@ghost
Copy link
Author

ghost commented Dec 5, 2018

Sorry, I only just saw your message. Maybe it's better to retain the current behaviour so that it mirrors the glpk library?

@jyp
Copy link
Owner

jyp commented Dec 18, 2018

This can either be fixed upstream, or we can add a workaround (for example by adding a prefix to all variables). In the latter case I'll be happy to get a pull request.

@ghost
Copy link
Author

ghost commented Jan 9, 2019

I sadly don't have access to the computer I wrote the fix on right now. I will get back to this when I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant