logmip4.gms : LogMIP User's Manual Example 4 - Job Shop Scheduling

**Description**

This model solves a jobshop scheduling, which has a set of jobs (5) which must be processed in sequence of stages (5) but not all jobs require all stages. A zero wait transfer policy is assumed between stages. To obtain a feasible solution it is necessary to eliminate all clashes between jobs. It requires that no two jobs be performed at any stage at any time. The objective is to minimize the makespan, the time to complete all jobs. References: Raman & Grossmann, Computers and Chemical Engineering 18, 7, p.563-578, 1994. Aldo Vecchietti, LogMIP User's Manual, 2007 http://www.logmip.ceride.gov.ar/files/pdfs/logmip_manual.pdf

**References**

- Vecchietti, A, LogMIP User's Manual, 2007. http://www.logmip.ceride.gov.ar/files/pdfs/logmip_manual.pdf
- Raman, R, and Grossmann, I E, Modeling and Computational Techniques for Logic Based Integer Programming. Computers and Chemical Engineering 18, 7 (1994), 563-578.

**Small Model of Type :** EMP

**Category :** GAMS Model library

**Main file :** logmip4.gms

```
$title LogMIP User's Manual Example 4 - Job Shop Scheduling (LOGMIP4,SEQ=337)
$ontext
This model solves a jobshop scheduling, which has a set of jobs (5)
which must be processed in sequence of stages (5) but not all jobs
require all stages. A zero wait transfer policy is assumed between
stages. To obtain a feasible solution it is necessary to eliminate
all clashes between jobs. It requires that no two jobs be performed
at any stage at any time. The objective is to minimize the makespan,
the time to complete all jobs.
References:
Raman & Grossmann, Computers and Chemical Engineering 18, 7, p.563-578, 1994.
Aldo Vecchietti, LogMIP User's Manual, 2007
http://www.logmip.ceride.gov.ar/files/pdfs/logmip_manual.pdf
$offtext
SETS I jobs / A, B, C, D, E, F, G /
J stages / 1*5 /;
ALIAS (I,K),(J,M);
SET L(I,K,J) Subset to prevent clasges at stage j between stage j and k
/A.B.3, A.B.5, A.C.1, A.D.3, A.E.3, A.E.5, A.F.1, A.F.3, A.G.5,
B.C.2, B.D.2, B.D.3, B.E.2, B.E.3, B.E.5, B.F.3, B.G.2, B.G.5,
C.D.2, C.D.4, C.E.2, C.F.1, C.F.4, C.G.2, C.G.4,
D.E.2, D.E.3, D.F.3, D.F.4, D.G.2, D.G.4,
E.F.3, E.G.2, E.G.5,
F.G.4 / ;
TABLE TAU(I,J) processing time of job i in stage j
1 2 3 4 5
A 3 5 2
B 3 4 3
C 6 3 6
D 8 5 1
E 4 6 2
F 2 5 7
G 8 5 4 ;
VARIABLE MS makespan ;
BINARY VARIABLE Y(I,K,J) sequencing variable between jobs i and k ;
POSITIVE VARIABLE T(I) ;
EQUATIONS
FEAS(I) makespan greater than all processing times
NOCLASH1(I,K,J) when i precedes k
NOCLASH2(I,K,J) when k precedes i
DUMMY ;
FEAS(I).. MS =G= T(I) + SUM(M, TAU(I,M)) ;
NOCLASH1(I,K,J)$((ORD(I) LT ORD(K)) AND L(I,K,J)) ..
T(I) + SUM(M$(ORD(M) LE ORD(J)), TAU(I,M)) =L=
T(K) + SUM(M$(ORD(M) LT ORD(J)), TAU(K,M));
NOCLASH2(I,K,J)$((ORD(I) LT ORD(K)) AND L(I,K,J)) ..
T(K) + SUM(M$(ORD(M) LE ORD(J)), TAU(K,M)) =L=
T(I) + SUM(M$(ORD(M) LT ORD(J)), TAU(I,M));
DUMMY.. SUM((I,K,J)$((ORD(I) LT ORD(K)) AND L(I,K,J)), Y(I,K,J)) =G= 0;
MODEL JOBSHOP / ALL / ;
*Find a quick and dirty BigM to overwrite LOGMIP's default
scalar BIGM; BIGM = SUM((I,J),TAU(I,J));
file fx /"%lm.info%"/;
putclose fx 'default bigm' BIGM 'disjunction Y NOCLASH1 else NOCLASH2';
OPTION OPTCR = 0.0, OPTCA = 0.0, EMP = LOGMIP;
SOLVE JOBSHOP MINIMIZING MS USING EMP ;
DISPLAY Y.L, T.L ;
```