Skip to content

Instantly share code, notes, and snippets.

@mlabonne
Last active May 10, 2022 15:58
Show Gist options
  • Save mlabonne/a00e5605fb3c0cd095eff49c860eab8e to your computer and use it in GitHub Desktop.
Save mlabonne/a00e5605fb3c0cd095eff49c860eab8e to your computer and use it in GitHub Desktop.
# Instantiate model and solver
model = cp_model.CpModel()
solver = cp_model.CpSolver()
# 1. Variables
capacity = 19
bread = model.NewIntVar(0, capacity, 'bread')
meat = model.NewIntVar(0, capacity, 'meat')
beer = model.NewIntVar(0, capacity, 'beer')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment