Skip to content

Converting a PySCIPOpt model to Ecole doesn't seem to work #357

Discussion options

You must be logged in to vote

If I remember right, the way it expects the objective was a little different. Here is some code I used that might work (sorry I've moved away from working on this so don't exactly remember if this is how I worked around it) :

def scip_solve(universe, subsets, costs):

     s = time.time()
     # Create Model
     model = pyscipopt.Model("Set Cover")

     # create a binary variable for each subset
     vars = []
     for i in range(len(subsets)):
              var = model.addVar("x_{}".format(i), vtype="B")
              vars.append(var)

     # set the objective function to minimize the total cost of the selected subsets
     model.setObjective(sum(costs[i] * vars[i] for i in range(len(s…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zohairshafi
Comment options

Answer selected by zohairshafi
@kevin031060
Comment options

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