Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Operations Research Stack Exchange is a question and answer site for operations research and analytics professionals, educators, and students. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
I am trying to implement a constraint as follows:
routing.solver().Add(capacity_dimension.CumulVar(idx) * routing.ActiveVar(idx) >= capacity_dimension.CumulVar(routing.End(v)) * 0.5 )
It gives error:
TypeError: unsupported operand type(s) for *: 'IntVar' and 'float'
How can I resolve this?
capacity_dimension.CumulVar(routing.End(v)).Value() * 0.5 on RHS but this kills the kernel.
asked Dec 11, 2022 at 7:38
This is solved as follows:
2 * capacity_dimension.CumulVar(idx) * routing.ActiveVar(idx) >= capacity_dimension.CumulVar(routing.End(v))
answered Dec 11, 2022 at 7:40