Forum Discussion
FICO
9 years agoCommunity Manager
MPVAR mod integer
Hi all,
I'm wondering is it possible to modulo an mpvar. I have a set of mpvars Xs which are binary and I want to have Sum(i in set) Xi mod 2 = 0 (in other words), the sum of the binary variabl...
FICO
9 years agoCommunity Manager
In a (linear) mixed integer problem formulation you won't be able to use the "mod" operator on decision variables to state the problem. What about introducing an integer variable, say "y", and rewrite your constraint as follows:
y is_integer
forall(i in aSet) x(i) is_binary
sum(i in aSet) x(i) = 2*y
Related Content
Related Content
Mosel: E-101: Incompatible types for operator (`mpvar' *SQUARE* `integer' not defined).
Please note syntax is weird in this post because this forum prohibits special characters. I've thus replaced the arrow/hat/square operator with *SQUARE* throughout my post... Hi Again! I am hoping I...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread0Views0likes3CommentsError 101 Incompatible types for operator ('set of integer' * 'mpvar' not defined)
I'm trying to solve a VRP-model and I receive "Error 101 Incompatible types for operator ('set of integer' * 'mpvar' not defined)" when I try to run, and I have no idea how to solve this. The error is...8 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread0Views0likes5Commentsmpvar variables and identifiers
Hi, Is it possible to sum a mpvar and an integer variable into an index of another mpvar ? Example: declarations x: array(1..10,1..5) of mpvar y: mpvar end-declarations y is_integer y <= 2 fo...5 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread0Views0likes5Comments