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

Discrepancy in HPIPM evaluation: complementarity slackness vs duality gap #122

Closed
stephane-caron opened this issue Oct 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@stephane-caron
Copy link
Member

stephane-caron commented Oct 8, 2024

Issue reported by @giaf in qpsolvers/mpc_qpbenchmark#7 (comment):

Strangely HPIPM success rate is lower at low accuracy, and it increases at mid and even more at high accuracy.
This behavior doesn't appear for the other solvers.
The reason seems to be the low percentage of problems where "solved" return codes are correct.
Looking into the issue more carefully, it seems that the issue is related to the duality gap: the interfaces sets the solver 'max_res_comp' (i.e. the complementarity slackness) to a specified value, but then it accepts the solution as correct if the duality gap (instead of the complementarity slackness) is within that specified value.
Complementarity slackness and duality gap are equivalent only for a feasible primal and dual point, but numerically this is true only approximately, and the approximation can be especially crude for the low accuracy case, where also primal and dual feasibility tolerances are set to low values.

@stephane-caron
Copy link
Member Author

Thank you @giaf for raising this fine point on the difference between complementarity-slackness and duality-gap termination at low precision. The reason why qpbenchmark went with the duality gap as a termination condition is its availability in most solvers (it appeared a de facto standard).

I don't have other ideas to suggest at present, so I'm following up to your offer of adding an option for duality-gap termination in HPIPM: giaf/hpipm#171 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant