Questions Tagged With linearizationhttp://www.or-exchange.com/tags/linearization/?type=rssquestions tagged <span class="tag">linearization</span>enTue, 15 May 2018 17:52:22 -0400Linearization of product of multiple binary decision varibaleshttp://www.or-exchange.com/questions/15680/linearization-of-product-of-multiple-binary-decision-varibales<p>Hi,
I want to linearize an objective function like Z=W.X.Y.Z, where W, X, Y, and Z are binary decision variables. Any suggestion would be appreciated.</p>
<p>Thanks,</p>ESNTue, 15 May 2018 17:52:22 -0400http://www.or-exchange.com/questions/15680/linearization-of-product-of-multiple-binary-decision-varibaleslinearizationLinearization with 4 variableshttp://www.or-exchange.com/questions/15623/linearization-with-4-variables<p>hi</p>
<p>Could someone please suggest a way of linearizing the following equation:</p>
<p>(x-y)*(a-b)</p>
<p>where x and y are binary variables and a and b are continues variables.</p>
<p>Tanks a lot</p>zalgiris28Fri, 27 Apr 2018 10:08:13 -0400http://www.or-exchange.com/questions/15623/linearization-with-4-variableslinearizationnonlinearbinary-programminglinearization of a conditioal constrainthttp://www.or-exchange.com/questions/15315/linearization-of-a-conditioal-constraint<p>Hello,
I liniarized the following constraint:</p>
<pre><code>if(r1<r2)
A1<A2
</code></pre>
<p>r1 and r2 are integers in [1,30]
A1 and A2 are deciimals in ]0,10]</p>
<p>the linear form:</p>
<pre><code>r2 * b1 + 30 * ( 1-b1 ) - r1 >= 0
b2 - b1 >= 0
A2 * b2 + 30 * ( 1-b2 ) - A1 >= 0
</code></pre>
<p>Where b1 and B2 are two binary variables</p>
<p>However this is not working. Your hel is highly appreciated</p>nardinebastaMon, 29 Jan 2018 10:08:36 -0500http://www.or-exchange.com/questions/15315/linearization-of-a-conditioal-constraintlinearizationlinear-programmingHow to linearize an indicator equality constraints?http://www.or-exchange.com/questions/15294/how-to-linearize-an-indicator-equality-constraints<p>Let \(x_i\) be binary variables and \(a_i\) given positive integers.</p>
<p>I have an equality constraint like the following
\[x_i\left(\sum_{j=1}^nx_{j}\right)=a_ix_i,\] for all \(i\). </p>
<p>This means that if \(x_i=1\), then there must exists a set \(S\) with cardinality \(|S|=a_i-1\) such that \(x_j=1\) for all \(j\in S\).</p>
<p>How can I linearize these constraints? If the constraints were of type inequality I could use a large (or small) number and write it as:</p>
<p>\[\left(\sum_{j=1}^nx_{j}\right)\leq a_ix_i+M(1-x_i),\] for all \(i\). </p>zbirThu, 18 Jan 2018 11:15:46 -0500http://www.or-exchange.com/questions/15294/how-to-linearize-an-indicator-equality-constraintslinearizationinteger-programmingformulationsbinary-programminglinearization-techniqueHow to choose at least one contraint from a set of constraints in integer programming?http://www.or-exchange.com/questions/15247/how-to-choose-at-least-one-contraint-from-a-set-of-constraints-in-integer-programming<p>I have a binary decision variable \(x_{kn}\) and I would like to model a situation like the following:</p>
<p>If \(x_{kn}=1\), then </p>
<ul>
<li>\(A_n\geqslant b_k\) or</li>
<li>\(A_n+C_{n+1}\geqslant b_k\) if \(C_{n+1}>0\) or</li>
<li>\(A_n+C_{n+1}+C_{n+2}\geqslant b_k\) if \(C_{n+1}>0\) and \(C_{n+2}>0\) or</li>
<li>... or</li>
<li>\(A_n+C_{n+1}+\ldots+C_{n+p}\geqslant b_k\) if \(C_{n+1}>0\) and \(C_{n+2}>0\) and \(\ldots\) \(C_{n+p}>0\)</li>
</ul>
<p>Where, \(p\geqslant2\) is given, \(C_n\) and \(b_k\) are non-negative integers given as inputs and \(A_n\) is a non-negative integer decision variable.</p>
<p>At least one constraint of the above \(p+1\) constraints has to be true. Can I model this in linear integer programming?</p>
<p>I thought of adding binary variables \(y_i\) such that \(x_{kn}=\sum_{i=1}^{p+1}y_{ikn}\) but I cannot continue (if I am even right).</p>zbirWed, 10 Jan 2018 11:41:37 -0500http://www.or-exchange.com/questions/15247/how-to-choose-at-least-one-contraint-from-a-set-of-constraints-in-integer-programminglinearizationinteger-programmingformulationsHow to linearize a constraint with variable summation?http://www.or-exchange.com/questions/15231/how-to-linearize-a-constraint-with-variable-summation<p>I have positive integer variables \(x_k\) and a constraint of the form \(\sum_{t=1}^{x_k}A_t\geq B_k\) for all \(k\) where \(A_t\) and \(B_k\) are nonnegative and given as inputs. Is it possible to linearize such a constraint?</p>zbirMon, 08 Jan 2018 17:12:30 -0500http://www.or-exchange.com/questions/15231/how-to-linearize-a-constraint-with-variable-summationlinearizationinteger-programminglinearization-techniquelinearize the absolute value of a differencehttp://www.or-exchange.com/questions/15225/linearize-the-absolute-value-of-a-difference<p>I would like to linearize the following :</p>
<pre><code>d=abs(c-r)
</code></pre>
<p>where c and r are continuous variables in [0,1]
the objective function is to minimize d</p>
<p>I tired</p>
<pre><code>d >=c-r
d >= r - c
</code></pre>
<p>it doesn't seem to work properly. I get a lot of non basic values. what am i doing wrong</p>nardinebastaThu, 04 Jan 2018 08:07:34 -0500http://www.or-exchange.com/questions/15225/linearize-the-absolute-value-of-a-differencelinearizationLinearize a logical constrainthttp://www.or-exchange.com/questions/15214/linearize-a-logical-constraint<p>Does anyone have any idea of how I can linearize the following logical constraints set?</p>
<p>$$(\sum_{t'=1}^t x_{it'}<1 \quad \rightarrow \quad \lambda_{it}=0), \quad \forall i,t$$</p>
<p>$$(\sum_{t'=1}^t x_{it'}=1 \quad \rightarrow \quad \lambda_{it}=1), \quad \forall i,t$$</p>
<p>$$\lambda_{it} \in \textbf{boolean}$$</p>
<p>$$x_{it} \in [0,1]$$</p>monashWed, 27 Dec 2017 03:06:38 -0500http://www.or-exchange.com/questions/15214/linearize-a-logical-constraintlinearizationinteger-programmingLinearization of multiplication of two continuous variableshttp://www.or-exchange.com/questions/15178/linearization-of-multiplication-of-two-continuous-variables<p>Hi,</p>
<p>I want to linearize two variables; the first variable (\(p\)) is non-negative and the second variable (\(x\)) is between zero and one. How to linearize?</p>
<p>\[
p \ge 0 ~~\text{and}~~ 0 \le x \le 1
\]</p>
<p>Thank you </p>mohadese mohamadiSun, 03 Dec 2017 04:53:02 -0500http://www.or-exchange.com/questions/15178/linearization-of-multiplication-of-two-continuous-variableslinearizationlinearization problemhttp://www.or-exchange.com/questions/15068/linearization-problem<p>How to linearize the following equality constraint?</p>
<p>z == x*(x-y);</p>
<p>where, x and y are continuous decision variables.</p>HabibWed, 11 Oct 2017 21:50:56 -0400http://www.or-exchange.com/questions/15068/linearization-problemlinearizationLinearization of constraint with several non-linear termshttp://www.or-exchange.com/questions/14954/linearization-of-constraint-with-several-non-linear-terms<p>Hello all,</p>
<p>I need to implement this constraint in an MILP formulation:</p>
<p>$$(x_{1} \cdot C_{1} + x_{2}) \cdot x_{3} \geq (x_4-x_2)^2 \cdot C_2$$</p>
<p>where \(x_{1}\) is an integer decision variable, \(x_2\), \(x_3\) and \(x_4\) are real decision variables, and \(C_1\) and \(C_2\) are constants.</p>
<p>Is there a way to linearize this expression? The integer variable \(x_1\) could be relaxed to a real variable if that would make things easier.</p>
<p>Thank you very much!</p>Luis BadesaMon, 04 Sep 2017 12:46:52 -0400http://www.or-exchange.com/questions/14954/linearization-of-constraint-with-several-non-linear-termslinearizationoptimizationlinearization-techniqueLinearization of a product of two variableshttp://www.or-exchange.com/questions/14763/linearization-of-a-product-of-two-variables<p>Hello!!!</p>
<p>I'm trying to linearize the constraint:</p>
<p><strong>sum {i in I} x_ijk*b_i >= d_j,k</strong>, for j in J and k in K.</p>
<p>with x and b are binary and d integers (like demands).
Can someone please help me?
I have already tried use the topic linearizations (replace x*b by x+b-1), but the problem happen when x and b are both 0.</p>
<p>Thanks and Happy New Year to everyone!</p>PauloSat, 31 Dec 2016 15:13:09 -0500http://www.or-exchange.com/questions/14763/linearization-of-a-product-of-two-variableslinearizationconvert non linear function to linearhttp://www.or-exchange.com/questions/14386/convert-non-linear-function-to-linear<p>Hi Dear
Are there anybody that know how to convert this function to linear? </p>
<p>min〖∑<em>(k=1)^K▒∑</em>(i=3)^I▒∑<em>(t=1)^T▒〖(( i * N_it^k )-(i^' * 〖N'〗</em>( i^' t)^k))〗^2 〗</p>
<p>N_it^k and 〖N'〗_( i^' t)^k) are binary variable</p>coolmanSun, 13 Nov 2016 02:01:42 -0500http://www.or-exchange.com/questions/14386/convert-non-linear-function-to-linearlinearizationlinearize nonlinear binary variableshttp://www.or-exchange.com/questions/14331/linearize-nonlinear-binary-variables<p>hello OR experts.</p>
<p>I have this function: Z = x.y which x and y are binary variables. I want to linearize Z.
Please help me about it.
Thank you.</p>peyman103Sun, 23 Oct 2016 14:59:04 -0400http://www.or-exchange.com/questions/14331/linearize-nonlinear-binary-variableslinearizationHalf the questions on this board could be eliminated if there were an FAQ directing people to automated software for linearizing constraints, conditional constraints, Big M, etc.http://www.or-exchange.com/questions/14268/half-the-questions-on-this-board-could-be-eliminated-if-there-were-an-faq-directing-people-to-automated-software-for-linearizing-constraints-conditional-constraints-big-m-etc<p>I'm sure people have noticed the large number of questions on this board asking how to linearize things, handle conditional constraints, how to do Big M, etc.</p>
<p>Hello folks, this is the 2nd decade of the 21st century. There is plenty of software to do Big M modeling to linearize things, handle conditional constraints, handle non-convex occurrence of certain operators, etc. So long as appropriate bounds are provided for the relevant variables, automated software should be able to automatically do most of these things, without human error, and with as good or better formulations than the typical non-expert could generate.</p>
<p>For example, indicator constraints in CPLEX and many optimization modeling systems.
Implies command in YALMIP, as well as under the hood automatic introduction of binary variables to handle non-convex occurrences of max or min, among many other things.</p>
<p>Hopefully, the posters who jump on these questions, with the same answers, more or less, over and over again, won't mind being put out of business, or at least having it reduced.</p>Mark L StoneMon, 10 Oct 2016 12:53:55 -0400http://www.or-exchange.com/questions/14268/half-the-questions-on-this-board-could-be-eliminated-if-there-were-an-faq-directing-people-to-automated-software-for-linearizing-constraints-conditional-constraints-big-m-etclinearizationbig-mconditional-constraintHow to linearize non-overlapping constraints for multiple intervals ? (in scheduling problems)http://www.or-exchange.com/questions/14259/how-to-linearize-non-overlapping-constraints-for-multiple-intervals-in-scheduling-problems<p>I know how to linearize non-overlapping constraint for two intervals. For example, [l1,u1] and [l2,u2]. Non-overlapping means that they do not have intersection, so I can use the following logical constraint:</p>
<pre><code>u1<l2 or u2<l1.
</code></pre>
<p>Then I introduce a binary variable s and a big M to linearize it to: </p>
<pre><code>l2-u1-M*s<0;
l1-u2+M*s>0;
l2-u1+M*(1-s)>0;
l1-u2-M*(1-s)<0.
</code></pre>
<p>However, if there are more than two intervals, for example, 3 intervals. Then there will be 6 possibilities: </p>
<pre><code>u1<l2,u2<l3
or u1<l3,u3<l2
or u2<l1,u1<l3
or u2<l3,u3<l1
or u3<l2,u2<l1
or u3<l1,u1<l2.
</code></pre>
<p>I don't how many binary variables I need to introduce in order to linearize these constraints.
More generally, for n intervals, there will be n! possibilities. Is there a way to linearize the non-overlapping constraint for all n intervals other than list out all possibilities? Furthermore, it will be even more difficult if I allow some intervals to overlap with each other. It is quite commonly encountered in scheduling problems: there are n operations to be performed, at most m(m<n) of them are allowed to be performed simultaneously. How do I linearize such a constraint?</p>Sulivan CheungSun, 09 Oct 2016 04:28:58 -0400http://www.or-exchange.com/questions/14259/how-to-linearize-non-overlapping-constraints-for-multiple-intervals-in-scheduling-problemslinearizationschedulingconstraint-programmingLinearization of a nonlinear modelhttp://www.or-exchange.com/questions/14176/linearization-of-a-nonlinear-model<p>Hi</p>
<p>I have a MINLP model. I prefer to run the model as an exact mathematical program and not use metaheuristics unless I have to. I use GAMS to run the model but due to the large size of the problem and nonlinearity of the model GAMS is now unable to solve it.</p>
<p>One of the nonlinear constraints is Eq(1). (FS and H are continuous positive variables and the others are parametes.) I considered using F=1/H but it would make other constraints non-linear.</p>
<p>Then again H is always positive and must be non-zero so I suppose I can move it to the left side and write it as the Eq(2).
<a href="http://i.stack.imgur.com/JSwHt.png">Eq1&2</a>
So are there any other ways to linearize this equation? if not can I linearize Eq(2)? How?
Please help me.</p>SherwinThu, 08 Sep 2016 17:13:12 -0400http://www.or-exchange.com/questions/14176/linearization-of-a-nonlinear-modellinearizationnonlinearLinearization of Min Functionhttp://www.or-exchange.com/questions/14160/linearization-of-min-function<p>Hello,</p>
<p>I am trying to linearize the following inequality:</p>
<p>X>=Min (Y,Z)</p>
<p>where X, Y, and Z are continuous variables and I am trying to minimize X in the objective function. I do not want to use a binary variable if possible.</p>
<p>I really appreciate your help.</p>
<p>Thanks,</p>
<p>Jonah</p>_Jonah_Sat, 03 Sep 2016 19:13:59 -0400http://www.or-exchange.com/questions/14160/linearization-of-min-functionlinearizationmin-functionLinearization of constraints described as convex functionshttp://www.or-exchange.com/questions/14143/linearization-of-constraints-described-as-convex-functions<p>I have a problem with constraints of the form yi = fi(x), where x and yi are variables, and f_i are nonlinear functions. </p>
<p>Our approach consists of linearizing the function fi and using SOS2 constraints to model the resulting piecewise linear functions.</p>
<p>Q1: a few of the functions fi are actually convex. Is there a different way of handling the constraint than the one described above that would exploit the convexity property? Or is there maybe some strategies that can used at optimization time?</p>
<p>Q2: say that all the fi are convex (Scenario 1) or nonconvex (Scenario 2)? Should I expect a difference in terms of resolution time? In other words, when modelling with SOS2 constraints, does the property of the fi matter?</p>
<p>Thanks</p>
<p>Alexis</p>aguigueFri, 26 Aug 2016 17:01:01 -0400http://www.or-exchange.com/questions/14143/linearization-of-constraints-described-as-convex-functionslinearizationfunctionconvexsos2constraintsLinearization of objective with absolute value function of decision variableshttp://www.or-exchange.com/questions/14054/linearization-of-objective-with-absolute-value-function-of-decision-variables<p>I am dealing with a situation similar to the one described <a href="https://www.or-exchange.org/questions/5358/linearization-of-a-penalty-type-function-with-absolute-values-in-objective-function">here</a> but a complex version of the same. </p>
<p>Using the same problem setting from the <a href="https://www.or-exchange.org/questions/5358/linearization-of-a-penalty-type-function-with-absolute-values-in-objective-function">other thread</a>, my constraint goes as follows : If patient i1 is treated by doctor j, I want the same doctor to treat patient i2 as well. I will have a pre-processing routine to identify (i1,i2) pairs. I can easily handle this with an additional constraint, but given the sizes of I and J, I would like to handle this as a penalty/incentive in the objective function. In this case, my objective is (-p*sum_i sum_j |x_{i2,j}-x_{i1,j}|)</p>
<p>It is also possible that this constraint can be violated with a penalty. For example, if (i1,i2) and (i1,i3) are predecessor-successor patient pairs but i2&i3 overlap(in time dimension), doctor j can treat only one of i2 or i3. So my constraint is x_{i1,j} <= x_{i2,j}+x_{i3,j}</p>
<p>The rest of my constraint matrix is structured such that the MIP solves in the root node, but this constraint causes the MIP to go into Branch & Bound. Hence trying to model it in the objective itself.</p>
<p>Any thoughts on this?</p>
<p>Thanks,
Raj</p>Rajeev NMon, 25 Jul 2016 23:32:43 -0400http://www.or-exchange.com/questions/14054/linearization-of-objective-with-absolute-value-function-of-decision-variableslinearizationabsolutecalculating min and max of variableshttp://www.or-exchange.com/questions/13839/calculating-min-and-max-of-variables<p>Hello all,</p>
<p>I have questions related to calculating the min and max of set of variables. First I need to calculate the max(x1,x2,x3) and then the min(x1,x2,x3) after that I want to minimize the difference between the max and the min. How do we formulate and linearize such problem (in the constraints)?</p>
<p>Thanks <br>
</p>hdauod1Tue, 31 May 2016 13:32:05 -0400http://www.or-exchange.com/questions/13839/calculating-min-and-max-of-variableslinearizationmixed-integer-programminglinearization of the sum functionhttp://www.or-exchange.com/questions/13718/linearization-of-the-sum-function<p>I am trying to do an optimization however the solver apparently does not perform well in the presence of a sum function.</p>
<p>how to linearize the following</p>
<pre><code>sum [u |v<>u and StringLength(PeriodDestination(u,t))>0 and edge(s)= PeriodDestination(u,t) ,PeopleAttraction(v,u,t)] ;
</code></pre>
<p>thank you :)</p>
<p>just in case please find below my code with the variables definitions the goal is to find optimal values of fa fr and co</p>
<pre><code> Constraint c4a {
IndexDomain: (v,s,t)| s in VehicleSocialSphere(v) and StringLength(PeriodDestination(v,t))>0;
Definition: {
SocialAttrPerLoc(v,s,t) <= maximumAttraction(v,t)+z1(v,s,t)+0.0001*z2(v,s,t)
}
}
Constraint c4b {
IndexDomain: (v,s,t)| s in VehicleSocialSphere(v) and StringLength(PeriodDestination(v,t))>0;
Definition: {
maximumAttraction(v,t)<=SocialAttrPerLoc(v,s,t) +z2(v,s,t)+0.0001*z1(v,s,t)
}
}
Constraint c4c {
IndexDomain: (v,s,t)|s in VehicleSocialSphere(v) and StringLength(PeriodDestinationID(v,t))>0;
Definition: z1(v,s,t)+chosenLocation(v,s,t)+z2(v,s,t)=1;
}
Constraint c2b {
IndexDomain: (v,s,t) | s in VehicleSocialSphere(v) and StringLength(PeriodDestination(v,t))>0;
Definition: {
maximumAttraction(v,t) >= SocialAttrPerLoc(v,s,t)
}
}
Constraint c2a {
IndexDomain: (v,t)|StringLength(PeriodDestination(v,t))>0;
Definition: sum( s | s in VehicleSocialSphere(v), chosenLocation(v,s,t) ) <= 1;
}
Constraint c1 {
IndexDomain: t;
Definition: {
co(t)+fr(t)+fa(t)=1
}
}
ElementParameter gmp1 {
Range: AllGeneratedMathematicalPrograms;
}
Variable co {
IndexDomain: t;
Range: [0, 1];
Default: 1;
}
Variable fr {
IndexDomain: t;
Range: [0, 1];
Default: 1;
}
Variable fa {
IndexDomain: t;
Range: [0, 1];
Default: 1;
}
MathematicalProgram MaximalMatchingPlan {
Objective: MatchingSum;
Direction: maximize;
Constraints: AllConstraints;
Variables: AllVariables;
Type: Automatic;
}
Variable MatchingSum {
Range: free;
Definition: {
! sum the number of chosen location that match the actual trace.
sum[(v,s,t) | s in VehicleSocialSphere(v) and StringLength(PeriodDestination(v,t))>0 and edge(s)=PeriodDestination(v,t),chosenLocation(v,s,t)]
}
}
Variable z1 {
IndexDomain: (v,s,t)|s in VehicleSocialSphere(v) and StringLength(PeriodDestinationID(v,t))>0;
Range: binary;
}
Variable z2 {
IndexDomain: (v,s,t)|s in VehicleSocialSphere(v) and StringLength(PeriodDestinationID(v,t))>0;
Range: binary;
}
Variable chosenLocation {
IndexDomain: (v,s,t)|s in VehicleSocialSphere(v) and StringLength(PeriodDestinationID(v,t))>0;
Range: binary;
Definition: {
!mark the location having the maximum attraction
}
}
Variable maximumAttraction {
IndexDomain: (v,t) |StringLength(PeriodDestinationID(v,t))>0;
Range: nonnegative;
Definition: {
! check the location with the maximum social attraction
}
}
Variable SocialAttrPerLoc {
IndexDomain: (v,s,t) |s in VehicleSocialSphere(v) and StringLength(PeriodDestination(v,t))>0;
Range: nonnegative;
Definition: {
!for each location in the vehicle v social sphere sum the attraction of its acquaintances u residing there
sum [u |v<>u and StringLength(PeriodDestination(u,t))>0 and edge(s)= PeriodDestination(u,t) ,PeopleAttraction(v,u,t)] ;
}
}
Variable peopleattraction {
IndexDomain: {
(v,u,t)|v<>u and StringLength(PeriodDestination(v,t))>0 !this condition to insure the exsistance of a trace at this period for this vehicle to allow the comparaison of the prduced destination guess
}
Range: [0, 1];
Definition: {
!the attraction of a vehicle to its aquaintances whether friends, family or coworkers
fr(t)*friends(v,u) + fa(t)*family(v,u) + co(t)*coworker(v,u);
}
}
}
</code></pre>nardinebastaSun, 08 May 2016 05:46:12 -0400http://www.or-exchange.com/questions/13718/linearization-of-the-sum-functionlinearizationlinear-programmingaimmsoptimizationHow to linearize this expression?http://www.or-exchange.com/questions/13343/how-to-linearize-this-expression<p>Hi,</p>
<p>I wonder how I can linearize the following expression:</p>
<p>$$z = \sum_{i=1}^{n} \max_{j=1,...,n} (y_{ij})$$</p>
<p>Thanks in advance.</p>monashThu, 11 Feb 2016 07:20:44 -0500http://www.or-exchange.com/questions/13343/how-to-linearize-this-expressionlinearizationmax-functionModelling P(x) when P is a unknown permutation and x an integer variablehttp://www.or-exchange.com/questions/13292/modelling-px-when-p-is-a-unknown-permutation-and-x-an-integer-variable<p>Hi OR Experts,</p>
<p>I am trying to solve this problem with MILP after having tried heuristic methods with no success.
(It is a cryptography challenge)<br>
Let E = {1,2,...25,26} be the set of positive integers <= 26. (the set of the 26 letters of the standard alphabet) <br>
Let P and P' be two unknown permutations of E.<br>
The (simplified) problem I have to solve is:<br>
</p>
<p>Find P , P' and variables Mk ϵ E subject to:<br>
</p>
<p>Ck = P(Ak) + P'(Mk) (mod 26) where Ck ϵ E and Ak ϵ E are known constants, for k = 1 to 49<br>
</p>
<p>The Mk are subject to 36 extra linear constraints.<br>
I have represented P and P' the usual way, with 26x26=676 binary variables for each permutation, summing to 1 for each row and each column: x(i,j) and x'(i,j) <br>
Each Mk is also represented by 26 binary variables m(k,i) summing to 1 over i for all k.<br>
The difficulty I face is to <strong>represent P'(Mk</strong>).<br>
Obviously P'(i) = sum( j * x'(i,j) ) over j.<br>
Hence P'(Mk) = sum( m(k,i)*P'(i) ) over i, but this turns the model into a quadratic one.<br>
Adding extra variables and constraints for linearizing the products m(k,i)*x'(i,j) makes the model gigantic...<br>
I'm using lp-solve for the moment.
There is no objective function, as any feasible solution will be *the* solution.</p>
<p>More generally, the question is: <strong>Is there a simple way/trick to index an array of variables by a variable, in a linear way ?</strong><br>
</p>
<p>Any advice is greatly appreciated.</p>
<p>Note: the (mod 26) is not an issue, as Ck = P(Ak) + P'(Mk) (mod 26) can be transformed into <br>
Ck = P(Ak) + P'(Mk) -26*Ek with Ek = binary</p>AlainSat, 30 Jan 2016 10:11:58 -0500http://www.or-exchange.com/questions/13292/modelling-px-when-p-is-a-unknown-permutation-and-x-an-integer-variablelinearizationmixed-integer-programmingpermutationtransform nonlinear constraint to linear constrainthttp://www.or-exchange.com/questions/13261/transform-nonlinear-constraint-to-linear-constraint<p>Hi </p>
<p>I have this constraint in my model; X>=Z*Y, which X and Y are nonegative continues variables. It is appreciated if anybody could help me to express this constraint to linear form.
Thanks in advance.</p>saeedSun, 24 Jan 2016 10:01:30 -0500http://www.or-exchange.com/questions/13261/transform-nonlinear-constraint-to-linear-constraintlinearizationHow can I linearize product of a binary and a continuous variables?http://www.or-exchange.com/questions/13120/how-can-i-linearize-product-of-a-binary-and-a-continuous-variables<p>Let X and Y be binary and continuous variables respectively, and there is the product of them in my problem, that is XY. Is there any way to linearize this product in such a way that in the linearized form the binary variable is replaced with a bounded continuous variable?</p>Amin-ShThu, 17 Dec 2015 08:44:57 -0500http://www.or-exchange.com/questions/13120/how-can-i-linearize-product-of-a-binary-and-a-continuous-variableslinearizationLinearization of Max Min functionhttp://www.or-exchange.com/questions/13017/linearization-of-max-min-function<p>I have a model like the one in below. I like to linearize my nonlinear model.</p>
<p>Max {Min (∅((T -μi*xi)/σi))}</p>
<p>there is no constraint. ∅ represents the CDF (cumulative density function) of the standard normal distribution. xi is decision variable.μi is the expected time and σi is the standard deviation of time. </p>
<p>Any help would be highly appreciated. Thanks alot <br>
</p>walfordSun, 15 Nov 2015 14:07:30 -0500http://www.or-exchange.com/questions/13017/linearization-of-max-min-functionlinearizationUsing min and max in the objective functionhttp://www.or-exchange.com/questions/12880/using-min-and-max-in-the-objective-function<p>hello, </p>
<p>I am trying to solve the following model in CPLEX, however, I am having in trouble in the part where I want to find min or max of a set. So I have a set of completion times for order i as C[i][j] = {2,3,5} and I want to get max (C_late) which is 5 and min (C_early) which is 2. And then I wand to minimize the difference between them. I think I need to use big M method however I am not sure why its not working. </p>
<pre><code>int I=...;
int J=...;
int K=...;
int T=...;
range Order = 1..I;
range Job = 1..J;
range Machine=1..K;
range Position = 1..T;
int p[Order][Job]=...;
int a[Order][Job][Machine]=...;
dvar boolean x[Order][Job][Machine][Position];
dvar boolean z[Order][Job];
dvar int+ C_late[Order];
dvar int+ C_early[Order];
dvar int FTW[Order];
dvar int CD;
dvar int+ y [Machine][Position];
dvar int+ C[Order][Job];
dvar int Cmax;
minimize
sum(i in Order) (C_late[i] - C_early[i]);
subject to{
// Ensure that a job is scheduled on one position only
forall(i in Order, j in Job: p[i][j]>0) sum(t in Position, m in Machine)
x[i][j][m][t] == 1;
forall(m in Machine, t in Position) sum(i in Order, j in Job: p[i][j]>0)
x[i][j][m][t] <= 1;
forall(i in Order, j in Job: p[i][j]>0 , m in Machine, t in Position)
x[i][j][m][t] - a[i][j][m] <= 0;
forall (m in Machine)
y[m][1] >= sum(i in Order, j in Job) p[i][j]*x[i][j][m][1];
forall(m in Machine, t in Position: t>=2)
y[m][t] >= y[m][t-1] + sum(i in Order, j in Job) p[i][j]*x[i][j][m][t];
forall(i in Order, j in Job: p[i][j]>0, m in Machine, t in Position)
C[i][j] >= y[m][t] - 100000*(1 - x[i][j][m][t]);
forall(m in Machine)
sum(i in Order, j in Job, t in Position) p[i][j]*x[i][j][m][t] - Cmax <= 0;
**forall(i in Order, j in Job: p[i][j]>0)
C_early[i] <= C[i][j];
forall(i in Order, j in Job: p[i][j]>0)
C_late[i] >= C[i][j];**
}
</code></pre>
<p>and here is sample data set: </p>
<pre><code>J=3;
K=3;
T=10;
I=10;
p= [
[15,0,0],
[14,0,0],
[16,0,0],
[15,0,0],
[14,0,0],
[16,0,0],
[16,0,0],
[14,0,0],
[15,0,0],
[17,16,14]
];
a = [
[[1,1,1], [0,0,0], [0,0,0]],
[[0,1,1], [0,0,0], [0,0,0]],
[[1,1,1], [0,0,0], [0,0,0]],
[[1,0,1], [0,0,0], [0,0,0]],
[[0,1,1], [0,0,0], [0,0,0]],
[[1,1,1], [0,0,0], [0,0,0]],
[[0,1,1], [0,0,0], [0,0,0]],
[[0,1,1], [0,0,0], [0,0,0]],
[[1,1,1], [0,0,0], [0,0,0]],
[[1,1,1], [1,1,1], [1,0,1]],
];
</code></pre>
<p>So is it possible to minimize function like this? <br>
</p>HD_1Tue, 13 Oct 2015 17:54:59 -0400http://www.or-exchange.com/questions/12880/using-min-and-max-in-the-objective-functionlinearizationcplexmixed-integer-programmingHow to linearize this logical constrainthttp://www.or-exchange.com/questions/12585/how-to-linearize-this-logical-constraint<p>Dear my friends,
How can I efficiently linearize the following logical constraint?</p>
<p><img alt="alt text" src="http://uupload.ir/files/70w1_untitled.png"></p>monashFri, 10 Jul 2015 12:03:54 -0400http://www.or-exchange.com/questions/12585/how-to-linearize-this-logical-constraintlinearizationinteger-programmingLinearize equality constraint with binary variablehttp://www.or-exchange.com/questions/12581/linearize-equality-constraint-with-binary-variable<p>I have an equality constraint like z(Ax-y)=0, where z>=0 ,and x is binary variable, and y is bounded variable Lx<=y<=Ux. How can it be linearized? Thanks in advance.</p>zunTue, 07 Jul 2015 16:58:40 -0400http://www.or-exchange.com/questions/12581/linearize-equality-constraint-with-binary-variablelinearizationbinaryvariableequalityconstraint