scipopt / PySCIPOpt

Python interface for the SCIP Optimization Suite
https://scipopt.github.io/PySCIPOpt
MIT License
786 stars 252 forks source link

Benders Decomposition #256

Closed kkamu closed 3 years ago

kkamu commented 5 years ago

Hi,

I want to implement Benders Decomposition Algorithm to my problem. First, I just wanted to code the algorithm by myself using dual values, but there are "bound constraints" in my problem. Dual value calculation of SCIP for bound constraints is somehow untrustable, as far as I know.

So, I used the default benders plugin. I dont know how this plugin calculates dual values correctly, but i tried. I used below settings as in the example on github.

    master.initBendersDefault(subprob)
    master.optimize()
    master.computeBestSolSubproblems()

The problem is, in master problem, I defined binary x[j,i,k] variables and in the solution, they take values greater than 1. How could it be possible?

stephenjmaher commented 5 years ago

It is great that you are using the BD framework of SCIP.

It is difficult to know what the problem is here, since we don't know how you have implemented your model. If the binary variables are not actually returning binary values, then this would typically be due to the variables not being defined correctly. The BD algorithm should not change the variable types of the master variables.

Would you be able to share some code of your model so we can see what is happening?