Thursday, July 16, 2009

An Integer Programming Computer Program Applied to One-Dimensional Space Allocation

Jsun Yui Wong

The computer program listed below seeks to solve Problem S8 of Amaral (2006, p. 514), which is a problem from Simmons (1969). In order to have integer locations, the department lengths used in the following computer program have been made twice as long as the given department lengths.

0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33),P(33),B(33),S(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
111 FOR K=1 TO 8
113 A(K)=FIX(RND*99)
115 NEXT K
126 IMAR=10+FIX(RND*2000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 8
131 X(KK)=A(KK)
132 NEXT KK
222 IJL=1+FIX(RND*8)
233 X(IJL)=FIX(RND*99)
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(1)-X(8))
508 B(8)=ABS(X(2)-X(3))
509 B(9)=ABS(X(2)-X(4))
510 B(10)=ABS(X(2)-X(5))
511 B(11)=ABS(X(2)-X(6))
512 B(12)=ABS(X(2)-X(7))
513 B(13)=ABS(X(2)-X(8))
514 B(14)=ABS(X(3)-X(4))
515 B(15)=ABS(X(3)-X(5))
516 B(16)=ABS(X(3)-X(6))
517 B(17)=ABS(X(3)-X(7))
518 B(18)=ABS(X(3)-X(8))
519 B(19)=ABS(X(4)-X(5))
520 B(20)=ABS(X(4)-X(6))
521 B(21)=ABS(X(4)-X(7))
522 B(22)=ABS(X(4)-X(8))
523 B(23)=ABS(X(5)-X(6))
524 B(24)=ABS(X(5)-X(7))
525 B(25)=ABS(X(5)-X(8))
526 B(26)=ABS(X(6)-X(7))
527 B(27)=ABS(X(6)-X(8))
528 B(28)=ABS(X(7)-X(8))
529 REM
530 REM
531 REM
901 S(1)=B(1)-5
902 S(2)=B(2)-6
903 S(3)=B(3)-7
904 S(4)=B(4)-8
905 S(5)=B(5)-5
906 S(6)=B(6)-9
907 S(7)=B(7)-6
908 S(8)=B(8)-7
909 S(9)=B(9)-8
910 S(10)=B(10)-9
911 S(11)=B(11)-6
912 S(12)=B(12)-10
913 S(13)=B(13)-7
914 S(14)=B(14)-9
915 S(15)=B(15)-10
916 S(16)=B(16)-7
917 S(17)=B(17)-11
918 S(18)=B(18)-8
919 S(19)=B(19)-11
920 S(20)=B(20)-8
921 S(21)=B(21)-12
922 S(22)=B(22)-9
923 S(23)=B(23)-9
924 S(24)=B(24)-13
925 S(25)=B(25)-10
926 S(26)=B(26)-10
927 S(27)=B(27)-7
928 S(28)=B(28)-11
1107 FOR IJUL=1 TO 28
1111 IF S(IJUL)<0 THEN S(IJUL)=ABS(S(IJUL)) ELSE S(IJUL)=0
1115 NEXT IJUL
1480 PH=-6*B(1)-4*B(2)-1*B(3)-7*B(4)-3*B(5)-5*B(6)-0*B(7)-1*B(8)-2*B(9)
1481 PI=-5*B(10)-2*B(11)-4*B(12)-3*B(13)-0*B(14)-6*B(15)-3*B(16)-2*B(17)-2*B(18)
1484 PJ=-3*B(19)-4*B(20)-0*B(21)-1*B(22)-0*B(23)-6*B(24)-6*B(25)-3*B(26)-5*B(27)-2*B(28)
1485 PL=-333333!*(S(1)+S(2)+S(3)+S(4)+S(5)+S(6)+S(7)+S(8)+S(9)+S(10)+S(11)+S(12)+S(13)+S(14)+S(15)+S(16)+S(17)+S(18)+S(19)+S(20)+S(21)+S(22)+S(23)+S(24)+S(25)+S(26)+S(27)+S(28))
1486 PK=PH+PI+PJ
1488 P=PK+PL
1499 PR=PK
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-1611 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),A(8)
1915 PRINT M,MM,JJJJ
1999 NEXT JJJJ

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

54 49 72 95 62
87 39 80
-1602 -1602 -30956

71 76 53 30 63
38 86 45
-1602 -1602 -27316

Interpreted in accordance with line 1912, line 1913, and line 1915, the output through
JJJJ=-27316 was produced in the first 50 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.

References

Amaral, 2006 A.R.S. Amaral, On the exact solution of a facility layout problem, European Journal of Operational Research 173 (2006), pp. 508-518.

Simmons, 1969 D.M. Simmons, One-dimensional space allocation: An ordering algorithm, Operations Research 17 (1969), pp. 812-826.