Skip to content
Discussion options

You must be logged in to vote

Split this line into 2 constraints:

model.Add(
    num_min - 1
    <= sum(neighbors[i, n] for i in range(num_nodes) if i != n)
    <= num_max - 1
).OnlyEnforceIf(nodes[n])

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Mizux
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Lang: Python Python wrapper issue Solver: CP-SAT Solver Relates to the CP-SAT solver
2 participants