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

fixing xhatters #481

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fixing xhatters #481

wants to merge 2 commits into from

Conversation

bknueven
Copy link
Collaborator

Follow up from #461.

The changes in #461 were needed to ensure the solution written was nonanticipative. However, as a side effect, it made the xhatters less effective. Because XhatBase._try_one did not restore the nonants, when the "next" scenario was called it would have the previous solution loaded, and not the PH iteration loaded. Therefore the incumbent finders were only producing at most one solution per PH iteration.

This PR fixes the same bug as #461, but does so my moving the best solution found tracking code into SPBase. Then the Xhatters can update and cache the solution immediately after it is found, and then finally restoring the nonants for the next try. This also makes it much less likely that solutions found will be accidentally dropped because of a user configuration error.

@bknueven bknueven force-pushed the restore_nonants_xhat branch from bc88698 to a9c5221 Compare January 23, 2025 16:18
@@ -83,7 +83,8 @@ def _vb(msg):
return False
_vb(f" Feasible {snamedict}, obj: {obj}")

update = self.update_if_improving(obj)
# the xhatter updates the cache in the opt object for us
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment

Copy link
Collaborator Author

@bknueven bknueven Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happens here and here.

One critical thing is that SPBase now tracks the best solution found so far, as opposed to the incumbent spoke.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, you want to cache the solution before the xhatter restores the nonants.

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.

2 participants