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

correct function to get dual variables #385

Closed
glliu opened this issue Jun 3, 2020 · 2 comments
Closed

correct function to get dual variables #385

glliu opened this issue Jun 3, 2020 · 2 comments

Comments

@glliu
Copy link

glliu commented Jun 3, 2020

Hi,

I was implementing a column generation algorithm with PySCIPOpt, now I'm a little confused about getting the dual variables.

In test_pricer.py, the pricer get the dual variables with Model.getDualMultiplier(c). However, in Issue #136 Model.getDualsolLinear(c) is used to access the dual variables. In addition, getDualMultiplier() and getDualsolLinear() often give different values. So what's the difference between these two functions? And which one is the proper function to get the dual variables?

Thank you very much.

@fserra
Copy link
Collaborator

fserra commented Jun 3, 2020

Hi, yeah this is bad. You should use getDualMultiplier.

@mattmilten we should remove getDualsolLinear and rename getDualMultiplier to getDualsolLinear :)

The problem is that SCIP does not support solving an LP problem and then accessing the dual variables. Only in some special cases, this works, and we tried to improve this with getDualsolLinear.

However, during the solving process of SCIP, SCIP solves, internally, LPs. For those, you can definitely access the dual information. This is what should happen in the pricer and for this, the function getDualMultiplier should be used.

@glliu
Copy link
Author

glliu commented Jun 4, 2020

Thanks for your reply 👍

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

2 participants