Thursday, October 29, 2009

An Illustration of a Computer Program for Relative Location of Three-Dimensional Facilities

Jsun Yui Wong

The complete computer program listed below is concerned with a three-dimensional layout problem based on the two-dimensional problem of Armour and Buffa (1963). The facility sizes for facility 1 through facility 3 are 25x20x40, 25x20x40,
and 35x30x70, respectively; the flows are shown in line 1621 of the following program. Some of these given data are from Heragu (2008, page 220). In order to have integer solutions, these original lengths and widths are multiplied by 4; then these longer lengths and widths are used in line 551 through line 554 of the following program.

0 DEFSNG A-Z
3 DEFINT I,J,K
4 DIM X(466),A(466),L(466),K(466),P(466),B(466),S(466),J(466),HS(99)
6 DIM T(11,11,5),TZ(11,11),TL(33)
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 9
88 A(I)=FIX(RND*1000)
89 NEXT I
126 IMAR=10+FIX(RND*2000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 9
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*9)
234 X(IJL)=FIX(RND*1000)
291 HS(1)=ABS(X(1)-X(2))
292 HS(2)=ABS(X(1)-X(3))
293 HS(3)=ABS(X(2)-X(3))
294 HS(4)=ABS(X(4)-X(5))
295 HS(5)=ABS(X(4)-X(6))
296 HS(6)=ABS(X(5)-X(6))
297 HS(7)=ABS(X(7)-X(8))
307 HS(8)=ABS(X(7)-X(9))
308 HS(9)=ABS(X(8)-X(9))
551 IF HS(1)-100<-.0001 AND HS(4)-80<-.0001 AND HS(7)-160<-.0001 THEN HS(1)=99999!
553 IF HS(2)-120<-.0001 AND HS(5)-100<-.0001 AND HS(8)-220<-.0001 THEN HS(2)=99999!
554 IF HS(3)-120<-.0001 AND HS(6)-100<-.0001 AND HS(9)-220<-.0001 THEN HS(3)=99999!
1621 PR1=-10*(HS(1)+HS(4)+HS(7))-75*(HS(2)+HS(5)+HS(8))-20*(HS(3)+HS(6)+HS(9))
1655 P=PR1
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 9
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-11561 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1914 PRINT A(6),A(7),A(8),A(9)
1919 PRINT M,JJJJ
1999 NEXT JJJJ

This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the output through JJJJ=-31839 is presented below. What immediately follows is a manual copy from the computer screen.

756 756 756 504 705
604 682 681 682
-11560 -31979

831 831 831 660 862
760 609 609 609
-11560 -31939

740 740 740 94 294
194 46 46 46
-11500 -31927

146 146 146 562 763
662 639 639 639
-11530 -31903

520 520 520 387 187
287 249 249 249
-11500 -31839

Interpreted in accordance with line 1912 through line 1919, the output above was produced in thirty seconds on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.

References

G. C. Armour and E. S. Buffa, "A Heuristic Algorithm and Simulation Approach to Relative Location of Facilities," Management Science 9, 294-309 (1963).

S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.