You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@henryrobbins Thanks for your response in #16. Here is what had put together, though I don't have a quick example to test (beyond the included tests).
I'm still not sure about what is happening in visualize.py, but I may take a look at it later. Meanwhile, I'd appreciate your comments on this.
One question about the slack variables: In the original code is it correct to do if np.sum(frac_comp) > 0: once slack variables are added? Could this not lead to a case where you are branching on a slack variable, which is not necessarily correct?
Todo:
Adjust LP to support specifying integrality
Change simplex and branch_and_bound to support integrality
I still don't know if/what implications these may have for the visualization code because I couldn't get around to looking at it yet.
The branch_and_bound implementation and bnb_visual both call branch_and_bound_iteration. bnb_visual requires a lot of information from each iteration (current node, which constraints were added, remaining feasible regions, etc...). Because branch_and_bound only returned the final solution, it wasn't used in bnb_visual. That is resulting in a lot of duplicate code between branch_and_bound and bnb_visual. This should be refactored. One possibility is to include a "path" of the algorithm in the object returned by branch_and_bound that exposes all the necessary information for plotting (as is done with the simplex implementation. I'm open to other suggestions though.
I renamed int_mask to integrality. At the moment visualization is probably broken because it is calling simplex on the MILP rather than the relaxation. I'll leave fixing that to bnb_visual refactoring.
It's not a rewrite but I did add .get_relaxation() to all the simplex calls in bnb_visual.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@henryrobbins Thanks for your response in #16. Here is what had put together, though I don't have a quick example to test (beyond the included tests).
I'm still not sure about what is happening in
visualize.py, but I may take a look at it later. Meanwhile, I'd appreciate your comments on this.One question about the slack variables: In the original code is it correct to do
if np.sum(frac_comp) > 0:once slack variables are added? Could this not lead to a case where you are branching on a slack variable, which is not necessarily correct?Todo:
LPto support specifyingintegralitysimplexandbranch_and_boundto supportintegralitybnb_visual