How to use the pyscipopt.SCIP_RESULT.CONSADDED function in PySCIPOpt

To help you get started, we’ve selected a few PySCIPOpt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SCIP-Interfaces / PySCIPOpt / tests / test_customizedbenders.py View on Github external
memberdualmult = membersubprob.getDualMultiplier(subprobcons)
         if dualmult != memberdualmult:
            print("The dual multipliers between the two subproblems are not "\
                  "the same.")
            assert False

      coeffs = [subprob.getDualMultiplier(self.benders.capacity[j])*\
            self.M[j] for j in self.J]

      self.model.addCons(self.model.getBendersAuxiliaryVar(probnumber,
         self.benders) -
         quicksum(self.model.getBendersVar(self.benders.subprob.data[1][j],
         self.benders)*coeffs[j] for j in self.J) >= lhs)

      return {"result" : SCIP_RESULT.CONSADDED}
github SCIP-Interfaces / PySCIPOpt / tests / test_customizedbenders.py View on Github external
if dualmult != memberdualmult:
            print("The dual multipliers between the two subproblems are not "\
                  "the same.")
            assert False

      print("storing coefficients")
      coeffs = [subprob.getDualMultiplier(self.benders.capacity[j])*\
            self.M[j] for j in self.J]

      print("adding the Benders' cut to the problem")
      self.model.addCons(self.model.getBendersAuxiliaryVar(probnumber,
         self.benders) -
         quicksum(self.model.getBendersVar(self.benders.subprob.data[1][j],
         self.benders)*coeffs[j] for j in self.J) >= lhs)

      return {"result" : SCIP_RESULT.CONSADDED}
github SCIP-Interfaces / PySCIPOpt / tests / test_tsp.py View on Github external
def consenfolp(self, constraints, n_useful_conss, sol_infeasible):
        subtours = self.find_subtours()
        if subtours:
            x = self.variables
            for subset in subtours:
                self.model.addCons(quicksum(x[i, j] for(i, j) in pairs(subset))
                                   <= len(subset) - 1)
                print("cut: len(%s) <= %s" % (subset, len(subset) - 1))
            return {"result": SCIP_RESULT.CONSADDED}
        else:
            return {"result": SCIP_RESULT.FEASIBLE}
github SCIP-Interfaces / PySCIPOpt / examples / unfinished / vrp_lazy.py View on Github external
def consenfolp(self, constraints, nusefulconss, solinfeasible):
        if self.addCuts(checkonly = False):
            return {"result": SCIP_RESULT.CONSADDED}
        else:
            return {"result": SCIP_RESULT.FEASIBLE}
github SCIP-Interfaces / PySCIPOpt / examples / finished / lotsizing_lazy.py View on Github external
def consenfolp(self, constraints, nusefulconss, solinfeasible):
        if self.addcut(checkonly = False):
            return {"result": SCIP_RESULT.CONSADDED}
        else:
            return {"result": SCIP_RESULT.FEASIBLE}
github SCIP-Interfaces / PySCIPOpt / examples / unfinished / tsp_lazy.py View on Github external
def consenfolp(self, constraints, nusefulconss, solinfeasible):
        if self.findSubtours(checkonly = False, sol = None):
            return {"result": SCIP_RESULT.CONSADDED}
        else:
            return {"result": SCIP_RESULT.FEASIBLE}