# Min function in objective problem

 0 How can I convert this Min function (bold highlihted) in objective problem into simple mathematical equation: Min a[i]*(x[i]-y[i]) + b[i] min⁡(x[i],M-c[i]) s.t. c[i]-x[i]+y[i]≤M Here x[i] and y[i] are decision variables. asked 20 Feb '18, 05:58 fadiz 11●2 accept rate: 0% fbahr ♦ 4.6k●7●16 What are the bounds on the decision variables x and y? are they greater than or equal to zero? Are a, and b greater than or equal to zero too? (20 Feb '18, 09:36) Naveen Divak... Both x and y are greater than or equal to zero. a, and b are also non-negative inputs (22 Feb '18, 04:45) fadiz

 1 Replace $$\min(x_i, M-c_i)$$ with a new variable $$z_i$$. Also add a binary variable $$w_i$$. Assuming that $$b_i>0$$, constrain $$z_i$$ as follows: \begin{align*} z_{i} & \ge x_{i}-Kw_{i}\\ z_{i} & \ge M-c_{i}-L(1-w_{i}) \end{align*} where $$K$$ is a valid upper bound for $$x_i - M + c_i$$ when $$M - c_i < x_i$$ and $$L$$ is a valid upper bound for $$M - c_i - x_i$$ when $$M - c_i > x_i$$. This forces $$z_i$$ to be either $$x_i$$ or $$M - c_i$$; the assumption that $$b_i > 0$$ combined with the fact that the overall objective is minimization ensures that the solver will pick whichever choice is smaller (i.e., the minimum). If $$b_i < 0$$, you don't need the binary variable $$w_i$$. Just constrain $$z_i$$ to be less than or equal to both $$x_i$$ and $$M - c_i$$. answered 21 Feb '18, 16:59 Paul Rubin ♦♦ 14.6k●4●13 accept rate: 19% Thanks Paul for such valuable information. What if I have conditional variable such as z[i]: Min a[i]*(x[i]-y[i]) + b[i] z[i] where if c[i] > M and x[i] ≥ c[i] - M z[i] = M - c[i] elseif c[i] > M and 0 ≤ x[i] ≤ c[i] - M z[i] = x[i] else z[i] = 0 endif where x[i] and y[i] are non-negative variables and a[i], b[i], c[i] and M are positive inputs. Can it be converted into linear constraints? (22 Feb '18, 09:13) fadiz So in the first case you want z[i] to be negative, in the second case you want z[i] to be nonnegative, and if M - c[i] >= 0 you want z[i] to be zero? (04 Mar '18, 19:55) Paul Rubin ♦♦
 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:

×190