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

Issue Branching Priorities #1299

Closed
ruaridhw opened this issue Feb 19, 2020 · 3 comments · Fixed by #1300 or flexciton/pyomo#1
Closed

Issue Branching Priorities #1299

ruaridhw opened this issue Feb 19, 2020 · 3 comments · Fixed by #1300 or flexciton/pyomo#1

Comments

@ruaridhw
Copy link
Contributor

ruaridhw commented Feb 19, 2020

Several commercial solvers allow for issuing branching directions and priorities for variables of MIP problems however Pyomo doesn't support this.

See Gurobi, CPLEX, GAMS

One should be able to apply a "direction" and "priority" for variables which are read and applied by the solver upon solve time.

Note, this is highly solver-specific and will require separate implementations for the Shell vs Persistent solvers. For example, the CPLEXSHELL solver can write a .ord file to disk in exactly the same manner as the warm start file which is then read by the CPLEX script. Meanwhile, the CPLEXDirect solver would utilise self._solver_model.order.set()

I would be happy to raise a PR given some design direction:

  1. Should this be implemented using the Suffix interface? If not, would a simple List[Tuple[PyomoVar, PriorityType, BranchDirectionType]] passed in as a solver.solve() kwarg be sufficient?
  2. Is it acceptable to only implement this for CPLEXSHELL and CPLEXDirect for now?
@ruaridhw
Copy link
Contributor Author

Or perhaps this could just be a mutable attribute of the variables themselves (via _GeneralVarData or _VarData, I'm not sure which...) that is then read off within _presolve()?

@ghackebeil
Copy link
Member

ghackebeil commented Feb 20, 2020

Hi @ruaridhw! Thanks for putting this together! And sorry for the delay in getting you some feedback on this.

This is certainly functionality we want to support for this solver interface. I think a solution using the Suffix component is more likely to make it through the approval process. Most of the team is weary of adding additional slots to the base variable object as it is already quite bloated.

Also, @michaelbynum is doing a lot of work to improve the solver interfaces right now. So just starting with the CPLEXSHELL is certainly okay. One of us can probably migrate this into the CplexDirect quite easily after that.

I'll try to post some example code to do this with the Suffix component in the next day or so if that will help.

@ruaridhw
Copy link
Contributor Author

Thanks @ghackebeil. I've raised #1300 as an implementation of this using the Suffix component.

Might need some help getting the 2.7 pipeline to pass though as I've not really any clue what this error message is suggesting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants