Skip to content

Instantly share code, notes, and snippets.

@upadhyan
Created October 19, 2022 04:04
Show Gist options
  • Save upadhyan/c5a3e0f9ddd407f05c1395a79384a456 to your computer and use it in GitHub Desktop.
Save upadhyan/c5a3e0f9ddd407f05c1395a79384a456 to your computer and use it in GitHub Desktop.
m = gp.Model("2SP")
m.ModelSense = GRB.MINIMIZE
m.setParam('OutputFlag', 0) # Telling gurobi to not be verbose
m.params.logtoconsole=0
# VARIABLES
## First Stage Decision variable
x = m.addMVar((3,), vtype = GRB.INTEGER, name = "x")
## 2nd stage decision for each potential scenario
y = m.addMVar((3,K), vtype = GRB.INTEGER, name = "y")
### Gurobi automatically sets bounds to (0, inf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment