[SCIP] Coding in ZIMPL regarding

Ambros Gleixner gleixner at zib.de
Thu Jan 19 09:54:04 CET 2017


Dear Shahul,

You need to use the "if then" and the "and" keywords.  This is explained 
in an example on page 16 and 17 of the Zimpl manual

http://zimpl.zib.de/download/zimpl.pdf


Best,
Ambros


> Von: Shahul Hameed K K [mailto:Shahul.Hameed at ibsplc.com]
> Gesendet: Donnerstag, 19. Januar 2017 06:49
> An: kasse at zib.de
> Betreff: Coding in ZIMPL regarding
>
>
>
> Dear sir,
>
>
>
> I am Shahul Hameed K K, from India. I am a  post graduate in operations research.  I need to code an LP problem in LPSolve IDE using ZIMPL. But unfortunately I am not getting the required assistance from anywhere including the group.
>
>
>
> I have thoroughly gone through the ZIMPL manual. I need assistance basically in writing the constraints. I started modelling in ZIMPL which is not complete , I am trying to assign trips on aircrafts;
>
>
>
> set TRIPS:= {read "trip.txt" as "<1n>"};
>
> set AIRCRAFTS:={read "tail.txt" as "<1n>"};
>
> set TA:=  TRIPS * AIRCRAFTS;
>
>
>
> param arrTime[TRIPS]:= read "arrTime.txt" as "<1n> 2n";
>
> param depTime[TRIPS]:= read "depTime.txt" as "<1n> 2n";
>
> param cost[TA]:= read "cost.txt" as "<1n,2n> 3n";
>
>
>
> var x[TA] binary;
>
> minimize totalcost: sum <t,a> in TA: cost[t,a] * x[t,a];
>
>
>
> subto constraint1:
>
> forall<t> in TRIPS do
>
> sum<a> in AIRCRAFTS: x[t,a] ==1;
>
>
>
> now I need to write another constraint,
>
>
>
> forall(a in aircrafts, t in trips) sum( k in trips such that arrTime[k] > depTime[t] and deptime[k] < arrTime[t]) x[k,a] = (1 – x[t,a])*10;
>
>
>
> How to write this? Could you please help me ? I am urgently in need of this. I actually started doing in CPLEX but I need to do it in open solver now?
>
>
>
> Looking forward to your response and thank you in advance.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Regards,
>
> Shahul


-- 
Ambros Gleixner, Zuse Institute Berlin, http://www.zib.de/gleixner


More information about the Scip mailing list