# How to update a variable in integer programming?

 0 I am confused about this situation: I have a binary variable $$x_{ij}$$ and an integer variable $$y_j$$. Also, if $$x_{ij}=1$$ then $$y_j$$ decreases by $$1$$, i.e., $$y_j\gets y_j-1$$. Here, $$y_j=c_j$$ at the start of the otpimization process. I don't know if I can express this constraint as a linear one? Can I juste write: $$y_j=y_j-x_{ij}$$? Doesn't this forces $$x_{ij}=0$$ all times? asked 17 Jan '18, 18:21 zbir 17●1●5 accept rate: 0%

 1 Doesn't $$y_j$$ have a starting value that is constant? If that is $$c_j$$, could'nt it be written as $$y_j=c_j-\sum_i x_{ij}$$ ? Maybe I did not understand the question right. answered 17 Jan '18, 18:26 Naveen Divak... 74●1●8 accept rate: 25% Yes, $$y_j=c_j$$ at the start. See the updated question. (17 Jan '18, 18:29) zbir then ((y_j=c_j-\sum_{i}x_{ij})) should work (17 Jan '18, 18:38) Naveen Divak... Was my answer helpful? Or did I still understand your question wrong? (18 Jan '18, 01:49) Naveen Divak... I think you did understand the question correctly but which one is the right answer? Is it $$y_j=c_j-x_{ij}$$ or $$y_j=c_j-\sum_i x_{ij}$$? (18 Jan '18, 10:18) zbir (y_j=c_j-\sum_i x_{ij}) (18 Jan '18, 10:21) Naveen Divak...
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags: