0

Please explain how logical constraints work in PySCIPOpt. I tried reading about model.addConsOr and model.addConsAnd but could not understand. An example would be highly appreciated.

1 Answers1

0

This example shows how to add logical constraints to a model using PySCIPOpt: https://scipopt.github.io/PySCIPOpt/docs/html/tutorial_2logical_8py_source.html

example code:

x = model.addVar("x", "B")
y = model.addVar("y", "B")
z = model.addVar("z", "B")
r = model.addVar("r", "B")
model.addConsAnd([x,y,z], r)
mattmilten
  • 6,242
  • 3
  • 35
  • 65