SETS: jobs/1..5/:s,c,r,d,p,y; prec(jobs,jobs)|&1#LT#&2:z; ENDSETS DATA: r=3 ,5,1,8,4 ; p=5,2, 3,5, 2 ; d=15,12,16,15,10 ; M=100; ENDDATA MIN = @SUM(jobs:y); @FOR(jobs(i):y(i) > c(i) - d(i); y(i) > d(i) - c(i)); @FOR(jobs(i): s(i) > r(i); s(i)+p(i)=c(i)); @FOR(prec(i,j)|i#LT#j: s(i) > c(j) - M*(1-z(i,j)); s(j) > c(i) - M*z(i,j)); @FOR(prec(i,j):@GIN(z(i,j)));