Friday, August 14, 2009

An Application of an Integer Programming Computer Program

Jsun Yui Wong

The computer program listed below seeks to solve the single-row seven-facility layout problem in Kumar, Hadjinicola, and Lin (1995).

0 DEFSNG A-Z
3 DEFINT I,J,K
4 DIM X(166),A(166),L(166),K(166),P(166),B(166),S(166)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
111 FOR K=1 TO 7
113 A(K)=FIX(RND*6)
115 NEXT K
126 IMAR=10+FIX(RND*500)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 7
131 X(KK)=A(KK)
132 NEXT KK
222 IJL=1+FIX(RND*7)
234 X(IJL)=FIX(RND*7)
501 B(1)=ABS(X(1)-X(2))
502 B(2)=ABS(X(1)-X(3))
503 B(3)=ABS(X(1)-X(4))
504 B(4)=ABS(X(1)-X(5))
505 B(5)=ABS(X(1)-X(6))
506 B(6)=ABS(X(1)-X(7))
507 B(7)=ABS(X(2)-X(3))
508 B(8)=ABS(X(2)-X(4))
509 B(9)=ABS(X(2)-X(5))
510 B(10)=ABS(X(2)-X(6))
511 B(11)=ABS(X(2)-X(7))
512 B(12)=ABS(X(3)-X(4))
513 B(13)=ABS(X(3)-X(5))
514 B(14)=ABS(X(3)-X(6))
515 B(15)=ABS(X(3)-X(7))
516 B(16)=ABS(X(4)-X(5))
517 B(17)=ABS(X(4)-X(6))
518 B(18)=ABS(X(4)-X(7))
519 B(19)=ABS(X(5)-X(6))
520 B(20)=ABS(X(5)-X(7))
521 B(21)=ABS(X(6)-X(7))
1107 FOR IJUL=1 TO 21
1111 IF B(IJUL)=0 THEN B(IJUL)=333333!
1115 NEXT IJUL
1380 PH=-69*B(1)-78*B(2)-5*B(3)-51*B(4)-76*B(5)-59*B(6)-42*B(7)
1381 PI=-58*B(8)-31*B(9)-88*B(10)-97*B(11)-6*B(12)-30*B(13)-22*B(14)
1382 PJ=-29*B(15)-99*B(16)-98*B(17)-26*B(18)-99*B(19)-2*B(20)-85*B(21)
1588 P=PH+PI+PJ
1599 PR=PK
1651 IF P<=M THEN 1670
1657 FOR KEW=1 TO 7
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-2300 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),M,JJJJ
1999 NEXT JJJJ

This BASIC computer program was run with the IBM basica/D interpreter, and the output produced in the first 9 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)

1 3 0 6 5
4 2 -2285 -27726

1 3 0 6 5
4 2 -2285 -27250

1 3 0 6 5
4 2 -2285 -26608

1 3 0 6 5
4 2 -2285 -22917

1 3 0 6 5
4 2 -2285 -20880

1 3 0 6 5
4 2 -2285 -17442

1 3 0 6 5
4 2 -2285 -16211

1 3 0 6 5
4 2 -2285 -14739

1 3 0 6 5
4 2 -2285 -14482

5 3 6 0 1
2 4 -2285 -13063

2285 is optimal, Kumar et al. (1995, p. 69). Interpreted in accordance with line 1912 and line 1913, the output through JJJJ=-13063 was produced in the first 9 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.

References

Heragu, S. S., and Kusiak, A. (1991), "Efficient models for the facility layout problem," European Journal of Operational Research 53, 1-13.

Kumar, K. R., Hadjinicola, G. C., and Lin, T. L. (1995), "A Heuristic procedure for the single-row facility layout problem," European Journal of Operational Research 87, 65-73.