Forum Discussion
FICO
8 years agoCommunity Manager
Help with consecutive binarys
I'm trying to model a constraint that tells me that my binary variable (index in months) can't be 1 in more than 2 consecutive periods of time. Here is a picture of a smilar constraint. Thank you so ...
FICO
8 years agoCommunity Manager
This is quite straightforward from the constraint formulation in your example (within 3 consecutive variables the following code snippet allows at most 2 non-zeros):
declarations
O=1..2
T=1..10
y: array(O,T) of mpvar
end-declarations
forall(i in O, t in T) y(i,t) is_binary
forall(i in O, t in T | t<=T.last-2) sum(h in t..t+2) y(i,h) <= 2
! Display what has been defined
exportprob("")
Related Content
Related Content
Infeasible model after consecutive invocation
We have the following workflow implemented in Java with Xpress 9.2.2 8.14.5: 1. Build BCL MIP model 2. Fix subset of variables (xprbVar.fix(.)). This simplified model is referred to as model A 3...3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2CommentsBinary variable constraint not respected
Hi, In my model I have binary variables but I see in the results that they are not binary and I don't know why... The pictures can help you understand my problem.5 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1CommentHas anyone seen an issue with binary variables becoming non-binary?
I'm new to the community and fairly new to xpress. I've attached my code for the project (both as text and PDF). Whenever I am running this code, I am getting a solution but my solutions are not bina...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1Comment