How to convert CPLEX constraint to GOOGLE OR TOOLS grammar in Python?

377 Views Asked by At

I have a constraint in CPLEX:

Constraint in CPLEX

And I have already tried to convert this constraint into GOOGLE OR TOOLS with Python.

constraint10=[zs[(0,j)] for j in range(17,22)]
constraint11=[zs[(1,j)] for j in range(21,26)]
constraint12=[zs[(2,j)] for j in range(15,20)]
constraint13=[zs[(3,j)] for j in range(18,23)]
constraint14=[zs[(4,j)] for j in range(9,14)]
constraint15=[zs[(5,j)] for j in range(12,17)]
solver.Add(sum(constraint10)==5)
solver.Add(sum(constraint11)==5)
solver.Add(sum(constraint12)==5)
solver.Add(sum(constraint13)==5)
solver.Add(sum(constraint14)==5)
solver.Add(sum(constraint15)==5)

In CPLEX, this constraint's Objective value is none. But GOOGLE OR TOOLS finds certain objective value. These two program's result should be same. Why this happen? Am I wrong?

0

There are 0 best solutions below