[Scip] ZIMPL Constraint translation

Soukaina Sema soukaina.sema at gmail.com
Sat Feb 28 19:03:00 CET 2015


Dear Mailing List,

I am currently trying to write my mathematical K-TSP model in ZIMPL format,
i found some difficulties to translate these two constraints :


*Constraint 1* :  (*xi* - ai)² + (yi -bi)²  <=  c²  , i= 1....n  ;



 (ai,bi) = the coordinate of a node i ( a city) and  (xi,yi) = the
coordinate of a special linked -point far away from the node i.


I want to calculate the distance between each node and it’s  linked-point,  I
stock the coordinate of each city in  file1 , and the coordinate of each
linked-point (i) in another  file2,  the set E is the set of arc, E = {
<i,j> in V * V with i < j }; M is the set of  Linked-point, I put this 2
code in my LP-solver but it's stop and give the some error:


 *CODE 1:* subto calculate_linked_point:
      forall <i,j> in E  do
       (x[i]-pa[i]) ^ 2 + (y[i]-pb[i]) ^ 2 <= r ^ 2;


*CODE 1*: subto calculate_repoint:
      forall <v> in V  do
      forall <m> in M do
       (x[m]-pa[v]) ^ 2 + (y[m]-pb[v]) ^ 2 <= r ^ 2;


*** Error 106: Empty LHS, constraint trivially violated
*** File: C:\Program Files\LPSolve IDE\_tmpfile Line 42
*** in A do        (x[i]-pa[i]) ^ 2 + (y[i]-pb[i]) ^ 2 <= c ^ 2;
***
^^
Elem store count
8
Numb store count 2





*Constraint 2* :  sum((i,j) in A) *Lambdawij*  * *g[i,j]* >= 1 ; for each w
from W;   //  * g[i,j] is a binary variable*


subto 2:
       forall <w> in W do

    sum <i,j> in E : Lambda[w,i,j] * g[i,j] >= 1;

    *** Error 800: File C:\Program Files\LPSolve IDE\_tmpfile Line 44 :
syntax error
, unexpected
VARSYM

*** do             sum <i,j> in E : Lambda[w,i,j] * g[i,j] >=
1;
***                                                 ^^^


Any ideas ??????
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20150228/919c7ecc/attachment.html>


More information about the Scip mailing list