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

HiGHS API: Add duals, slacks, reduced costs (#780) #781

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

WPettersson
Copy link
Contributor

This adds duals, slacks, and reduced costs to the highspy HiGHS interface.

Closes: #780

@WPettersson WPettersson marked this pull request as draft October 16, 2024 08:23
@WPettersson
Copy link
Contributor Author

I've reverted this to a draft as I've realised it's not correct, there's at least a -1.0 multiplier missing for reduced costs for maximisation problems. I'll add some more testing of these parameters, and sort out any remaining issues.

@WPettersson WPettersson marked this pull request as ready for review October 17, 2024 11:03
@WPettersson
Copy link
Contributor Author

Okay, now ready for review. I've also added another test for duals, slacks, reduced costs that involves a maximisation problem.

@pchtsp
Copy link
Collaborator

pchtsp commented Oct 22, 2024

can you please apply the black linter as explained here: https://coin-or.github.io/pulp/develop/contribute.html#applying-the-black-linter-formatter
thanks!

This adds duals, slacks, and reduced costs to the highspy HiGHS interface.

Closes: coin-or#780
@WPettersson
Copy link
Contributor Author

Sorry, black has now been run, one line changed

@WPettersson
Copy link
Contributor Author

I want to throw up a warning actually. I've been doing more testing, and I've found instances where HiGHs and CBC do not return the same shadow prices (constraint.pi values). I'm trying to narrow this down to a problem that can reasonably be solved by hand so I can work out which solver is right, but I wanted to let you know about a potential issue while I investigate further.

@WPettersson
Copy link
Contributor Author

Okay, after a day of doing linear programming by hand, I'm confident that the solutions returned are all valid, the solvers are simply finding different shadow prices.

@pchtsp pchtsp merged commit 1527a4f into coin-or:master Nov 1, 2024
11 of 18 checks passed
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

Successfully merging this pull request may close these issues.

HiGHS API and duals / reduced costs / slacks
2 participants