Jsun Yui Wong
Partly because of line 21 through line 32 and line 1631 through line 1639, the computer program listed below is shorter than the one in the September 7 post "An Integer-Programming Computer Program Applied to a One-Dimensional Space Allocation Problem" of the present blog.
0 DEFSNG A-Z
3 DEFINT I,J,K
4 REM
5 DIM X(466),A(466),L(466),K(466),P(466),B(466),S(466),J(466)
6 DIM T(11,11,5),TZ(11,11),TL(33),HT(33,33),TM(24,24),HR(24,24),HS(24,24)
21 FOR IW=1 TO 7
23 FOR JW=IW+1 TO 8
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
32 DATA 5,6,7,8,5,9,6,7,8,9,6,10,7,9,10,7,11,8,11,8,12,9,9,13,10,10,7,11
41 FOR IZ=1 TO 7
43 FOR JZ=IZ+1 TO 8
46 READ HS(IZ,JZ)
48 NEXT JZ
49 NEXT IZ
52 DATA 6,4,1,7,3,5,0,1,2,5,2,4,3,0,6,3,2,2,3,4,0,1,0,6,6,3,5,2
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR II=1 TO 8
88 A(II)=FIX(RND*99)
89 NEXT II
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
223 IJL=1+FIX(RND*8)
234 X(IJL)=FIX(RND*99)
533 FOR IX=1 TO 7
534 FOR JX=IX+1 TO 8
542 IF ABS(X(IX)-X(JX))-HR(IX,JX)<-.0001 THEN TM(IX,JX)=999999! ELSE TM(IX,JX)=0
545 NEXT JX
547 NEXT IX
1611 SUMTL=0
1612 FOR IR1=1 TO 7
1614 FOR IR2=IR1+1 TO 8
1616 SUMTL=SUMTL+TM(IR1,IR2)
1617 NEXT IR2
1619 NEXT IR1
1631 SUMUL=0
1632 FOR IS1=1 TO 7
1634 FOR IS2=IS1+1 TO 8
1636 SUMUL=SUMUL+HS(IS1,IS2)*ABS(X(IS1)-X(IS2))
1637 NEXT IS2
1639 NEXT IS1
1645 P=-SUMUL-SUMTL
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-1605 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1914 PRINT A(6),A(7),A(8),M,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the output produced during the first 1.5 hours of running is presented below. What immediately follows is a manual copy from the computer screen.
48 53 30 7 40
15 63 22 -1602 -29841
44 39 62 85 52
77 29 70 -1602 -28965
65 70 47 24 57
32 80 39 -1602 -27466
1602 is optimal. Interpreted in accordance with line 1912 and line 1914, the output through JJJJ=-27466 was produced during the first 1.5 hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
References
Amaral, A. R. S., "On the exact solution of a facility layout problem," European Journal of Operational Research 173, 508-518 (2006).
Simmons, D. M., "One-dimensional space allocation: an ordering algorithm," Operations Research 17, 812-826 (1969).
Tuesday, November 17, 2009
Monday, November 16, 2009
A Computer Program for Scheduling to Minimize Interaction Cost
Jsun Yui Wong
The computer programn listed below is concerned with the scheduling problem of Carlson and Nemhauser (1966). As shown in line 32 below for a case of scheduling eight activities among three facilities, the interaction cost between activity 1 and activity 2 (if scheduled on the same facility), the interaction cost between activity 1 and activity 3, the interaction cost between activity 1 and activity 4, ..., and the interaction cost between activity 7 and activity 8 are 10, 12, 11, ..., and 12, respectively.
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),HT(33,33),TM(24,24),HR(24,24)
21 FOR IW=1 TO 7
23 FOR JW=IW+1 TO 8
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
32 DATA 10,12,11,12,17,13,9,12,11,12,17,13,9,13,14,19,15,11,13,18,14,10,19,15,11,20,16,12
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 8
88 A(I)=FIX(RND*3)
89 NEXT I
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 8
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*8)
234 X(IJL)=FIX(RND*3)
533 FOR IX=1 TO 7
534 FOR JX=IX+1 TO 8
542 IF X(IX)=X(JX) THEN TM(IX,JX)=HR(IX,JX) ELSE TM(IX,JX)=0
545 NEXT JX
547 NEXT IX
1611 SUMTL=0
1612 FOR IR1=1 TO 7
1614 FOR IR2=IR1+1 TO 8
1616 SUMTL=SUMTL+TM(IR1,IR2)
1617 NEXT IR2
1619 NEXT IR1
1645 P=-SUMTL
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-90 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1914 PRINT A(6),A(7),A(8),M,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the output produced during the first three seconds of running is presented below. What immediately follows is a manual copy from the computer screen.
1 2 2 1 2
0 0 1 -88 -31997
1 0 0 0 1
2 2 1 -88 -31996
2 2 0 0 1
1 0 2 -89 -31994
0 0 2 2 0
1 1 2 -88 -31992
Interpreted in accordance with line 1912 and line 1914, the output above was produced during the first three seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
Reference
Carlson, R. C., and G. L. Nemhauser, "Scheduling to Minimize Interaction Cost," Operations Research 14, 52-58 (1966).
The computer programn listed below is concerned with the scheduling problem of Carlson and Nemhauser (1966). As shown in line 32 below for a case of scheduling eight activities among three facilities, the interaction cost between activity 1 and activity 2 (if scheduled on the same facility), the interaction cost between activity 1 and activity 3, the interaction cost between activity 1 and activity 4, ..., and the interaction cost between activity 7 and activity 8 are 10, 12, 11, ..., and 12, respectively.
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),HT(33,33),TM(24,24),HR(24,24)
21 FOR IW=1 TO 7
23 FOR JW=IW+1 TO 8
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
32 DATA 10,12,11,12,17,13,9,12,11,12,17,13,9,13,14,19,15,11,13,18,14,10,19,15,11,20,16,12
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 8
88 A(I)=FIX(RND*3)
89 NEXT I
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 8
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*8)
234 X(IJL)=FIX(RND*3)
533 FOR IX=1 TO 7
534 FOR JX=IX+1 TO 8
542 IF X(IX)=X(JX) THEN TM(IX,JX)=HR(IX,JX) ELSE TM(IX,JX)=0
545 NEXT JX
547 NEXT IX
1611 SUMTL=0
1612 FOR IR1=1 TO 7
1614 FOR IR2=IR1+1 TO 8
1616 SUMTL=SUMTL+TM(IR1,IR2)
1617 NEXT IR2
1619 NEXT IR1
1645 P=-SUMTL
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-90 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1914 PRINT A(6),A(7),A(8),M,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the output produced during the first three seconds of running is presented below. What immediately follows is a manual copy from the computer screen.
1 2 2 1 2
0 0 1 -88 -31997
1 0 0 0 1
2 2 1 -88 -31996
2 2 0 0 1
1 0 2 -89 -31994
0 0 2 2 0
1 1 2 -88 -31992
Interpreted in accordance with line 1912 and line 1914, the output above was produced during the first three seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
Reference
Carlson, R. C., and G. L. Nemhauser, "Scheduling to Minimize Interaction Cost," Operations Research 14, 52-58 (1966).
Friday, November 6, 2009
A Shorter Computer Program for Relative Location of Three-Dimensional Facilities
Jsun Yui Wong
Because of line 252 through line 286 and line 533 through line 547, the computer programn listed below is shorter than the one in the October 24 post "A Computer Program for Relative Location of Three-Dimensional Facilities, Second Edition" of the present blog. The newer program and its earliest output are as follows:
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),HT(33,33),TM(24,24),HR(24,24)
21 FOR IW=1 TO 7
23 FOR JW=IW+1 TO 8
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
32 DATA 100,120,110,120,170,130,90,120,110,120,170,130,90,130,140,190,150,110,130,180,140,100,190,150,110,200,160,120
41 FOR IW2=9 TO 15
42 FOR JW2=IW2+1 TO 16
43 READ HR(IW2,JW2)
44 NEXT JW2
45 NEXT IW2
46 DATA80,100,80,80,120,60,60,100,80,80,120,60,60,100,100,140,80,80,80,120,60,60,120,60,60,100,100,40
51 FOR IW3=17 TO 23
52 FOR JW3=IW3+1 TO 24
53 READ HR(IW3,JW3)
54 NEXT JW3
55 NEXT IW3
57 DATA 160,160,180,180,180,220,220,160,180,180,180,220,220,180,180,180,220,220,200,200,240,240,200,240,240,240,240,280
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 24
88 A(I)=FIX(RND*1000)
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 24
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*24)
234 X(IJL)=FIX(RND*1000)
252 FOR IY=1 TO 23
263 FOR JY=IY+1 TO 24
271 HT(IY,JY)=ABS(X(IY)-X(JY))-HR(IY,JY)
285 NEXT JY
286 NEXT IY
533 FOR IX=1 TO 7
534 FOR JX=IX+1 TO 8
541 IF HT(IX, JX)<-.0001 AND HT(IX+8,JX+8)<-.0001 AND HT(IX+16,JX+16)<-.0001 THEN TM(IX, JX)=999999! ELSE TM(IX,JX)=0
545 NEXT JX
547 NEXT IX
1611 SUMTL=0
1612 FOR IR1=1 TO 7
1613 REM
1614 FOR IR2=IR1+1 TO 8
1615 REM
1616 SUMTL=SUMTL+TM(IR1,IR2)
1617 NEXT IR2
1618 REM
1619 NEXT IR1
1621 PR1=-10*ABS(X(1)-X(2))-15*ABS(X(1)-X(3))-20*ABS(X(1)-X(4))-0*ABS(X(1)-X(5))-17*ABS(X(1)-X(6))-0*ABS(X(1)-X(7))-6*ABS(X(1)-X(8))
1622 PR2=-30*ABS(X(2)-X(3))-35*ABS(X(2)-X(4))-10*ABS(X(2)-X(5))-32*ABS(X(2)-X(6))-10*ABS(X(2)-X(7))-2*ABS(X(2)-X(8))
1631 PR3=-10*ABS(X(3)-X(4))-20*ABS(X(3)-X(5))-26*ABS(X(3)-X(6))-0*ABS(X(3)-X(7))-10*ABS(X(3)-X(8))
1632 PR4=-15*ABS(X(4)-X(5))-13*ABS(X(4)-X(6))-10*ABS(X(4)-X(7))-10*ABS(X(4)-X(8))
1633 PR5=-19*ABS(X(5)-X(6))-4*ABS(X(5)-X(7))-10*ABS(X(5)-X(8))-20*ABS(X(6)-X(7))-0*ABS(X(6)-X(8))-0*ABS(X(7)-X(8))
1636 REM
1643 PR8=-10*ABS(X(9)-X(10))-15*ABS(X(9)-X(11))-20*ABS(X(9)-X(12))-0*ABS(X(9)-X(13))-17*ABS(X(9)-X(14))-0*ABS(X(9)-X(15))-6*ABS(X(9)-X(16))
1644 PR9=-30*ABS(X(10)-X(11))-35*ABS(X(10)-X(12))-10*ABS(X(10)-X(13))-32*ABS(X(10)-X(14))-10*ABS(X(10)-X(15))-2*ABS(X(10)-X(16))
1645 PR10=-10*ABS(X(11)-X(12))-20*ABS(X(11)-X(13))-26*ABS(X(11)-X(14))-0*ABS(X(11)-X(15))-10*ABS(X(11)-X(16))
1646 PR11=-15*ABS(X(12)-X(13))-13*ABS(X(12)-X(14))-10*ABS(X(12)-X(15))-10*ABS(X(12)-X(16))
1647 PR12=-19*ABS(X(13)-X(14))-4*ABS(X(13)-X(15))-10*ABS(X(13)-X(16))-20*ABS(X(14)-X(15))-0*ABS(X(14)-X(16))-0*ABS(X(15)-X(16))
1650 PR13=-10*ABS(X(17)-X(18))-15*ABS(X(17)-X(19))-20*ABS(X(17)-X(20))-0*ABS(X(17)-X(21))-17*ABS(X(17)-X(22))-0*ABS(X(17)-X(23))-6*ABS(X(17)-X(24))
1651 PR14=-30*ABS(X(18)-X(19))-35*ABS(X(18)-X(20))-18*ABS(X(18)-X(21))-32*ABS(X(18)-X(22))-10*ABS(X(18)-X(23))-2*ABS(X(18)-X(24))
1652 PR15=-10*ABS(X(19)-X(20))-20*ABS(X(19)-X(21))-26*ABS(X(19)-X(22))-0*ABS(X(19)-X(23))-10*ABS(X(19)-X(24))
1653 PR16=-15*ABS(X(20)-X(21))-13*ABS(X(20)-X(22))-10*ABS(X(20)-X(23))-10*ABS(X(20)-X(24))
1654 PR17=-19*ABS(X(21)-X(22))-4*ABS(X(21)-X(23))-10*ABS(X(21)-X(24))-20*ABS(X(22)-X(23))-0*ABS(X(22)-X(24))-0*ABS(X(23)-X(24))
1655 P=PR1+PR2+PR3+PR4+PR5+PR8+PR9+PR10+PR11+PR12+PR13+PR14+PR15+PR16+PR17-999*SUMTL
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 24
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1662 MM=PR1+PR2+PR3+PR4+PR5+PR8+PR9+PR10+PR11+PR12+PR13+PR14+PR15+PR16+PR17
1666 GOTO 128
1670 NEXT I
1890 IF M>-67450! 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 PRINT A(16),A(17),A(18),A(19),A(20)
1917 PRINT A(21),A(22),A(23),A(24)
1919 PRINT MM,M,JJJJ
1999 NEXT JJJJ
503 603 603 713 744
603 853 713 371 371
271 371 234 491 372
294 691 691 690 691
690 690 690 691
-67446 -67446 -32000
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.
A. R. S. Amaral, "An Exact Approach to the One-Dimensional Facility Layout Problem," Operations Research 56, 1026-1033 (2008).
Because of line 252 through line 286 and line 533 through line 547, the computer programn listed below is shorter than the one in the October 24 post "A Computer Program for Relative Location of Three-Dimensional Facilities, Second Edition" of the present blog. The newer program and its earliest output are as follows:
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),HT(33,33),TM(24,24),HR(24,24)
21 FOR IW=1 TO 7
23 FOR JW=IW+1 TO 8
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
32 DATA 100,120,110,120,170,130,90,120,110,120,170,130,90,130,140,190,150,110,130,180,140,100,190,150,110,200,160,120
41 FOR IW2=9 TO 15
42 FOR JW2=IW2+1 TO 16
43 READ HR(IW2,JW2)
44 NEXT JW2
45 NEXT IW2
46 DATA80,100,80,80,120,60,60,100,80,80,120,60,60,100,100,140,80,80,80,120,60,60,120,60,60,100,100,40
51 FOR IW3=17 TO 23
52 FOR JW3=IW3+1 TO 24
53 READ HR(IW3,JW3)
54 NEXT JW3
55 NEXT IW3
57 DATA 160,160,180,180,180,220,220,160,180,180,180,220,220,180,180,180,220,220,200,200,240,240,200,240,240,240,240,280
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 24
88 A(I)=FIX(RND*1000)
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 24
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*24)
234 X(IJL)=FIX(RND*1000)
252 FOR IY=1 TO 23
263 FOR JY=IY+1 TO 24
271 HT(IY,JY)=ABS(X(IY)-X(JY))-HR(IY,JY)
285 NEXT JY
286 NEXT IY
533 FOR IX=1 TO 7
534 FOR JX=IX+1 TO 8
541 IF HT(IX, JX)<-.0001 AND HT(IX+8,JX+8)<-.0001 AND HT(IX+16,JX+16)<-.0001 THEN TM(IX, JX)=999999! ELSE TM(IX,JX)=0
545 NEXT JX
547 NEXT IX
1611 SUMTL=0
1612 FOR IR1=1 TO 7
1613 REM
1614 FOR IR2=IR1+1 TO 8
1615 REM
1616 SUMTL=SUMTL+TM(IR1,IR2)
1617 NEXT IR2
1618 REM
1619 NEXT IR1
1621 PR1=-10*ABS(X(1)-X(2))-15*ABS(X(1)-X(3))-20*ABS(X(1)-X(4))-0*ABS(X(1)-X(5))-17*ABS(X(1)-X(6))-0*ABS(X(1)-X(7))-6*ABS(X(1)-X(8))
1622 PR2=-30*ABS(X(2)-X(3))-35*ABS(X(2)-X(4))-10*ABS(X(2)-X(5))-32*ABS(X(2)-X(6))-10*ABS(X(2)-X(7))-2*ABS(X(2)-X(8))
1631 PR3=-10*ABS(X(3)-X(4))-20*ABS(X(3)-X(5))-26*ABS(X(3)-X(6))-0*ABS(X(3)-X(7))-10*ABS(X(3)-X(8))
1632 PR4=-15*ABS(X(4)-X(5))-13*ABS(X(4)-X(6))-10*ABS(X(4)-X(7))-10*ABS(X(4)-X(8))
1633 PR5=-19*ABS(X(5)-X(6))-4*ABS(X(5)-X(7))-10*ABS(X(5)-X(8))-20*ABS(X(6)-X(7))-0*ABS(X(6)-X(8))-0*ABS(X(7)-X(8))
1636 REM
1643 PR8=-10*ABS(X(9)-X(10))-15*ABS(X(9)-X(11))-20*ABS(X(9)-X(12))-0*ABS(X(9)-X(13))-17*ABS(X(9)-X(14))-0*ABS(X(9)-X(15))-6*ABS(X(9)-X(16))
1644 PR9=-30*ABS(X(10)-X(11))-35*ABS(X(10)-X(12))-10*ABS(X(10)-X(13))-32*ABS(X(10)-X(14))-10*ABS(X(10)-X(15))-2*ABS(X(10)-X(16))
1645 PR10=-10*ABS(X(11)-X(12))-20*ABS(X(11)-X(13))-26*ABS(X(11)-X(14))-0*ABS(X(11)-X(15))-10*ABS(X(11)-X(16))
1646 PR11=-15*ABS(X(12)-X(13))-13*ABS(X(12)-X(14))-10*ABS(X(12)-X(15))-10*ABS(X(12)-X(16))
1647 PR12=-19*ABS(X(13)-X(14))-4*ABS(X(13)-X(15))-10*ABS(X(13)-X(16))-20*ABS(X(14)-X(15))-0*ABS(X(14)-X(16))-0*ABS(X(15)-X(16))
1650 PR13=-10*ABS(X(17)-X(18))-15*ABS(X(17)-X(19))-20*ABS(X(17)-X(20))-0*ABS(X(17)-X(21))-17*ABS(X(17)-X(22))-0*ABS(X(17)-X(23))-6*ABS(X(17)-X(24))
1651 PR14=-30*ABS(X(18)-X(19))-35*ABS(X(18)-X(20))-18*ABS(X(18)-X(21))-32*ABS(X(18)-X(22))-10*ABS(X(18)-X(23))-2*ABS(X(18)-X(24))
1652 PR15=-10*ABS(X(19)-X(20))-20*ABS(X(19)-X(21))-26*ABS(X(19)-X(22))-0*ABS(X(19)-X(23))-10*ABS(X(19)-X(24))
1653 PR16=-15*ABS(X(20)-X(21))-13*ABS(X(20)-X(22))-10*ABS(X(20)-X(23))-10*ABS(X(20)-X(24))
1654 PR17=-19*ABS(X(21)-X(22))-4*ABS(X(21)-X(23))-10*ABS(X(21)-X(24))-20*ABS(X(22)-X(23))-0*ABS(X(22)-X(24))-0*ABS(X(23)-X(24))
1655 P=PR1+PR2+PR3+PR4+PR5+PR8+PR9+PR10+PR11+PR12+PR13+PR14+PR15+PR16+PR17-999*SUMTL
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 24
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1662 MM=PR1+PR2+PR3+PR4+PR5+PR8+PR9+PR10+PR11+PR12+PR13+PR14+PR15+PR16+PR17
1666 GOTO 128
1670 NEXT I
1890 IF M>-67450! 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 PRINT A(16),A(17),A(18),A(19),A(20)
1917 PRINT A(21),A(22),A(23),A(24)
1919 PRINT MM,M,JJJJ
1999 NEXT JJJJ
503 603 603 713 744
603 853 713 371 371
271 371 234 491 372
294 691 691 690 691
690 690 690 691
-67446 -67446 -32000
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.
A. R. S. Amaral, "An Exact Approach to the One-Dimensional Facility Layout Problem," Operations Research 56, 1026-1033 (2008).
Thursday, November 5, 2009
A Shorter Computer Program for Relative Location of Spherical Facilities, Second Edition
Jsun Yui Wong
Because of line 333 through line 477 and line 522 through line 566, the computer programn listed below is shorter than the one in the post "A Computer Program for Relative Location of Spherical Facilities" of the present blog. The newer program and its earliest output are as follows:
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),HR(9,9)
6 DIM T(11,11,5),TZ(11,11),TL(33),HT(11,22)
21 FOR IW=1 TO 4
23 FOR JW=IW+1 TO 5
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
33 DATA 25.2312,30.8974,26.4353,27.5426,30.8974
38 DATA 26.4353,27.5426,32.1015,33.2088,28.7467
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
333 FOR IX=1 TO 4
344 FOR JX=IX+1 TO 5
401 HT(IX,JX)=((X(IX)-X(JX))^2+(X(IX+5)-X(JX+5))^2+(X(IX+10)-X(JX+10))^2)^.5
455 NEXT JX
477 NEXT IX
522 FOR IY=1 TO 4
533 FOR JY=IY+1 TO 5
551 IF HT(IY,JY)-HR(IY,JY)<-.00001 THEN HT(IY,JY)=999999!
555 NEXT JY
566 NEXT IY
1621 PR1=-10*HT(1,2)-15*HT(1,3)-20*HT(1,4)-.01*HT(1,5)
1622 PR2=-30*HT(2,3)-35*HT(2,4)-10*HT(2,5)
1631 PR3=-10*HT(3,4)-20*HT(3,5)
1632 PR4=-15*HT(4,5)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
One notes that the flow of .01 in line 1621 above is an artificial flow.
References
Drezner, Z. "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
Heragu, S. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
Because of line 333 through line 477 and line 522 through line 566, the computer programn listed below is shorter than the one in the post "A Computer Program for Relative Location of Spherical Facilities" of the present blog. The newer program and its earliest output are as follows:
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),HR(9,9)
6 DIM T(11,11,5),TZ(11,11),TL(33),HT(11,22)
21 FOR IW=1 TO 4
23 FOR JW=IW+1 TO 5
26 READ HR(IW,JW)
28 NEXT JW
29 NEXT IW
33 DATA 25.2312,30.8974,26.4353,27.5426,30.8974
38 DATA 26.4353,27.5426,32.1015,33.2088,28.7467
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
333 FOR IX=1 TO 4
344 FOR JX=IX+1 TO 5
401 HT(IX,JX)=((X(IX)-X(JX))^2+(X(IX+5)-X(JX+5))^2+(X(IX+10)-X(JX+10))^2)^.5
455 NEXT JX
477 NEXT IX
522 FOR IY=1 TO 4
533 FOR JY=IY+1 TO 5
551 IF HT(IY,JY)-HR(IY,JY)<-.00001 THEN HT(IY,JY)=999999!
555 NEXT JY
566 NEXT IY
1621 PR1=-10*HT(1,2)-15*HT(1,3)-20*HT(1,4)-.01*HT(1,5)
1622 PR2=-30*HT(2,3)-35*HT(2,4)-10*HT(2,5)
1631 PR3=-10*HT(3,4)-20*HT(3,5)
1632 PR4=-15*HT(4,5)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
One notes that the flow of .01 in line 1621 above is an artificial flow.
References
Drezner, Z. "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
Heragu, S. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
Wednesday, November 4, 2009
A Shorter Computer Program for Relative Location of Spherical Facilities
Jsun Yui Wong
Because of line 333 through line 477, the computer programn listed below is shorter than the one in the preceding post of the present blog. The newer program and its earliest output are as follows:
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),HT(11,22)
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
333 FOR IX=1 TO 4
344 FOR JX=IX+1 TO 5
401 HT(IX,JX)=((X(IX)-X(JX))^2+(X(IX+5)-X(JX+5))^2+(X(IX+10)-X(JX+10))^2)^.5
455 NEXT JX
477 NEXT IX
651 IF HT(1,2)-25.2312<-.00001 THEN HT(1,2)=999999!
653 IF HT(1,3)-30.8974<-.00001 THEN HT(1,3)=999999!
654 IF HT(1,4)-26.4353<-.00001 THEN HT(1,4)=999999!
655 IF HT(1,5)-27.5426<-.00001 THEN HT(1,5)=999999!
665 IF HT(2,3)-30.8974<-.00001 THEN HT(2,3)=999999!
668 IF HT(2,4)-26.4353<-.00001 THEN HT(2,4)=999999!
669 IF HT(2,5)-27.5426<-.00001 THEN HT(2,5)=999999!
684 IF HT(3,4)-32.1015<-.00001 THEN HT(3,4)=999999!
685 IF HT(3,5)-33.2088<-.00001 THEN HT(3,5)=999999!
689 IF HT(4,5)-28.7467<-.00001 THEN HT(4,5)=999999!
1621 PR1=-10*HT(1,2)-15*HT(1,3)-20*HT(1,4)-.01*HT(1,5)
1622 PR2=-30*HT(2,3)-35*HT(2,4)-10*HT(2,5)
1631 PR3=-10*HT(3,4)-20*HT(3,5)
1632 PR4=-15*HT(4,5)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
One notes that the flow of .01 in line 1621 above is an artificial flow.
References
Drezner, Z. "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
Heragu, S. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
Because of line 333 through line 477, the computer programn listed below is shorter than the one in the preceding post of the present blog. The newer program and its earliest output are as follows:
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),HT(11,22)
65 FOR JJJJ=-32000 TO 32000
74 RANDOMIZE JJJJ
76 M=-1D+17
85 FOR I=1 TO 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
333 FOR IX=1 TO 4
344 FOR JX=IX+1 TO 5
401 HT(IX,JX)=((X(IX)-X(JX))^2+(X(IX+5)-X(JX+5))^2+(X(IX+10)-X(JX+10))^2)^.5
455 NEXT JX
477 NEXT IX
651 IF HT(1,2)-25.2312<-.00001 THEN HT(1,2)=999999!
653 IF HT(1,3)-30.8974<-.00001 THEN HT(1,3)=999999!
654 IF HT(1,4)-26.4353<-.00001 THEN HT(1,4)=999999!
655 IF HT(1,5)-27.5426<-.00001 THEN HT(1,5)=999999!
665 IF HT(2,3)-30.8974<-.00001 THEN HT(2,3)=999999!
668 IF HT(2,4)-26.4353<-.00001 THEN HT(2,4)=999999!
669 IF HT(2,5)-27.5426<-.00001 THEN HT(2,5)=999999!
684 IF HT(3,4)-32.1015<-.00001 THEN HT(3,4)=999999!
685 IF HT(3,5)-33.2088<-.00001 THEN HT(3,5)=999999!
689 IF HT(4,5)-28.7467<-.00001 THEN HT(4,5)=999999!
1621 PR1=-10*HT(1,2)-15*HT(1,3)-20*HT(1,4)-.01*HT(1,5)
1622 PR2=-30*HT(2,3)-35*HT(2,4)-10*HT(2,5)
1631 PR3=-10*HT(3,4)-20*HT(3,5)
1632 PR4=-15*HT(4,5)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
One notes that the flow of .01 in line 1621 above is an artificial flow.
References
Drezner, Z. "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
Heragu, S. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
A Computer Program for Relative Location of Spherical Facilities
Jsun Yui Wong
The computer programn listed below is concerned with an extension of the assumption that "facilities have circular shapes, and that the distance between facilities is measured from center to center," Drezner (1980, p. 1375). In this paper the facilities are spheres of different sizes. For the following program for five facilities, the facility radii are 12.6156, 12.6156, 18.2818, 13.8197, and 14.9270. These radii are based on the rectangles of Heragu (2008, p. 220). Sums of pairs of radii are used in line 551 through line 589; from Heragu (2008), the flows are shown in line 1621 through line 1632 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 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
291 HS(1)=((X(1)-X(2))^2+(X(6)-X(7))^2+(X(11)-X(12))^2)^.5
292 HS(2)=((X(1)-X(3))^2+(X(6)-X(8))^2+(X(11)-X(13))^2)^.5
293 HS(3)=((X(1)-X(4))^2+(X(6)-X(9))^2+(X(11)-X(14))^2)^.5
294 HS(4)=((X(1)-X(5))^2+(X(6)-X(10))^2+(X(11)-X(15))^2)^.5
295 HS(5)=((X(2)-X(3))^2+(X(7)-X(8))^2+(X(12)-X(13))^2)^.5
296 HS(6)=((X(2)-X(4))^2+(X(7)-X(9))^2+(X(12)-X(14))^2)^.5
297 HS(7)=((X(2)-X(5))^2+(X(7)-X(10))^2+(X(12)-X(15))^2)^.5
298 HS(8)=((X(3)-X(4))^2+(X(8)-X(9))^2+(X(13)-X(14))^2)^.5
299 HS(9)=((X(3)-X(5))^2+(X(8)-X(10))^2+(X(13)-X(15))^2)^.5
300 HS(10)=((X(4)-X(5))^2+(X(9)-X(10))^2+(X(14)-X(15))^2)^.5
551 IF HS(1)-25.2312<-.00001 THEN HS(1)=999999!
553 IF HS(2)-30.8974<-.00001 THEN HS(2)=999999!
554 IF HS(3)-26.4353<-.00001 THEN HS(3)=999999!
555 IF HS(4)-27.5426<-.00001 THEN HS(4)=999999!
565 IF HS(5)-30.8974<-.00001 THEN HS(5)=999999!
568 IF HS(6)-26.4353<-.00001 THEN HS(6)=999999!
569 IF HS(7)-27.5426<-.00001 THEN HS(7)=999999!
584 IF HS(8)-32.1015<-.00001 THEN HS(8)=999999!
585 IF HS(9)-33.2088<-.00001 THEN HS(9)=999999!
589 IF HS(10)-28.7467<-.00001 THEN HS(10)=999999!
1621 PR1=-10*HS(1)-15*HS(2)-20*HS(3)-.01*HS(4)
1622 PR2=-30*HS(5)-35*HS(6)-10*HS(7)
1631 PR3=-10*HS(8)-20*HS(9)
1632 PR4=-15*HS(10)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
One notes that the flow of .01 in line 1621 above is an artificial flow.
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the best candidate solutions produced during the first ten hours of running are presented below. What immediately follows is a manual copy from the computer screen.
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
307.2313 324.6127 336.2557 325.9749 350.9761
887.4272 870.5788 898.0033 872.8292 867.5846
762.154 747.3267 755.9315 773.7556 760.2586
-4880.799 -29546
Interpreted in accordance with line 1912 through line 1919, the candidate solutions above were produced during the first ten hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
References
Z. Drezner, "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
The computer programn listed below is concerned with an extension of the assumption that "facilities have circular shapes, and that the distance between facilities is measured from center to center," Drezner (1980, p. 1375). In this paper the facilities are spheres of different sizes. For the following program for five facilities, the facility radii are 12.6156, 12.6156, 18.2818, 13.8197, and 14.9270. These radii are based on the rectangles of Heragu (2008, p. 220). Sums of pairs of radii are used in line 551 through line 589; from Heragu (2008), the flows are shown in line 1621 through line 1632 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 15
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 15
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*15)
234 X(IJL)=RND*1000
291 HS(1)=((X(1)-X(2))^2+(X(6)-X(7))^2+(X(11)-X(12))^2)^.5
292 HS(2)=((X(1)-X(3))^2+(X(6)-X(8))^2+(X(11)-X(13))^2)^.5
293 HS(3)=((X(1)-X(4))^2+(X(6)-X(9))^2+(X(11)-X(14))^2)^.5
294 HS(4)=((X(1)-X(5))^2+(X(6)-X(10))^2+(X(11)-X(15))^2)^.5
295 HS(5)=((X(2)-X(3))^2+(X(7)-X(8))^2+(X(12)-X(13))^2)^.5
296 HS(6)=((X(2)-X(4))^2+(X(7)-X(9))^2+(X(12)-X(14))^2)^.5
297 HS(7)=((X(2)-X(5))^2+(X(7)-X(10))^2+(X(12)-X(15))^2)^.5
298 HS(8)=((X(3)-X(4))^2+(X(8)-X(9))^2+(X(13)-X(14))^2)^.5
299 HS(9)=((X(3)-X(5))^2+(X(8)-X(10))^2+(X(13)-X(15))^2)^.5
300 HS(10)=((X(4)-X(5))^2+(X(9)-X(10))^2+(X(14)-X(15))^2)^.5
551 IF HS(1)-25.2312<-.00001 THEN HS(1)=999999!
553 IF HS(2)-30.8974<-.00001 THEN HS(2)=999999!
554 IF HS(3)-26.4353<-.00001 THEN HS(3)=999999!
555 IF HS(4)-27.5426<-.00001 THEN HS(4)=999999!
565 IF HS(5)-30.8974<-.00001 THEN HS(5)=999999!
568 IF HS(6)-26.4353<-.00001 THEN HS(6)=999999!
569 IF HS(7)-27.5426<-.00001 THEN HS(7)=999999!
584 IF HS(8)-32.1015<-.00001 THEN HS(8)=999999!
585 IF HS(9)-33.2088<-.00001 THEN HS(9)=999999!
589 IF HS(10)-28.7467<-.00001 THEN HS(10)=999999!
1621 PR1=-10*HS(1)-15*HS(2)-20*HS(3)-.01*HS(4)
1622 PR2=-30*HS(5)-35*HS(6)-10*HS(7)
1631 PR3=-10*HS(8)-20*HS(9)
1632 PR4=-15*HS(10)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 15
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-4900 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),A(10)
1915 PRINT A(11),A(12),A(13),A(14),A(15)
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
One notes that the flow of .01 in line 1621 above is an artificial flow.
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the best candidate solutions produced during the first ten hours of running are presented below. What immediately follows is a manual copy from the computer screen.
660.8163 671.9393 664.7956 645.4153 656.898
754.6052 750.77 780.2496 751.776 763.7252
130.8193 154.4491 148.1102 152.1257 175.8217
-4859.761 -30413
307.2313 324.6127 336.2557 325.9749 350.9761
887.4272 870.5788 898.0033 872.8292 867.5846
762.154 747.3267 755.9315 773.7556 760.2586
-4880.799 -29546
Interpreted in accordance with line 1912 through line 1919, the candidate solutions above were produced during the first ten hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
References
Z. Drezner, "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
Monday, November 2, 2009
A Computer Program for Relative Location of Circular Facilities
Jsun Yui Wong
The computer programn listed below assumes that "facilities have circular shapes, and that the distance between facilities is measured from center to center," Drezner (1980, p. 1375). For the following program for five facilities, the facility radii are 12.6156, 12.6156, 18.2818, 13.8197, and 14.9270. These radii are based on the rectangles of Heragu (2008, p. 220). Sums of pairs of radii are used in line 551 through line 589; from Heragu (2008), the flows are shown in line 1621 through line 1632 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 10
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 10
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*10)
234 X(IJL)=RND*1000
291 HS(1)=((X(1)-X(2))^2+(X(6)-X(7))^2)^.5
292 HS(2)=((X(1)-X(3))^2+(X(6)-X(8))^2)^.5
293 HS(3)=((X(1)-X(4))^2+(X(6)-X(9))^2)^.5
294 HS(4)=((X(1)-X(5))^2+(X(6)-X(10))^2)^.5
295 HS(5)=((X(2)-X(3))^2+(X(7)-X(8))^2)^.5
296 HS(6)=((X(2)-X(4))^2+(X(7)-X(9))^2)^.5
297 HS(7)=((X(2)-X(5))^2+(X(7)-X(10))^2)^.5
298 HS(8)=((X(3)-X(4))^2+(X(8)-X(9))^2)^.5
299 HS(9)=((X(3)-X(5))^2+(X(8)-X(10))^2)^.5
300 HS(10)=((X(4)-X(5))^2+(X(9)-X(10))^2)^.5
551 IF HS(1)-25.2312<-.00001 THEN HS(1)=999999!
553 IF HS(2)-30.8974<-.00001 THEN HS(2)=999999!
554 IF HS(3)-26.4353<-.00001 THEN HS(3)=999999!
555 IF HS(4)-27.5426<-.00001 THEN HS(4)=999999!
565 IF HS(5)-30.8974<-.00001 THEN HS(5)=999999!
568 IF HS(6)-26.4353<-.00001 THEN HS(6)=999999!
569 IF HS(7)-27.5426<-.00001 THEN HS(7)=999999!
584 IF HS(8)-32.1015<-.00001 THEN HS(8)=999999!
585 IF HS(9)-33.2088<-.00001 THEN HS(9)=999999!
589 IF HS(10)-28.7467<-.00001 THEN HS(10)=999999!
1621 PR1=-10*HS(1)-15*HS(2)-20*HS(3)-.01*HS(4)
1622 PR2=-30*HS(5)-35*HS(6)-10*HS(7)
1631 PR3=-10*HS(8)-20*HS(9)
1632 PR4=-15*HS(10)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 10
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-5400 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),A(10)
1915 REM
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
One notes that the flow of .01 in line 1621 above is an artificial flow.
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the best candidate solutions produced during the first ten hours of running are presented below. What immediately follows is a manual copy from the computer screen.
556.7183 534.6341 505.9124 533.788 509.3705
644.7668 658.6841 649.2176 631.5781 616.2713
-5369.511 -31610
138.7942 134.8886 155.6561 159.9009 184.9188
872.151 897.4762 920.3549 888.4004 904.4385
-5353.261 -30343
Interpreted in accordance with line 1912 through line 1919, the candidate solutions above were produced during the first ten hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
References
Z. Drezner, "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
The computer programn listed below assumes that "facilities have circular shapes, and that the distance between facilities is measured from center to center," Drezner (1980, p. 1375). For the following program for five facilities, the facility radii are 12.6156, 12.6156, 18.2818, 13.8197, and 14.9270. These radii are based on the rectangles of Heragu (2008, p. 220). Sums of pairs of radii are used in line 551 through line 589; from Heragu (2008), the flows are shown in line 1621 through line 1632 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 10
88 A(I)=RND*1000
89 NEXT I
126 IMAR=10+FIX(RND*20000)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 10
131 X(KK)=A(KK)
132 NEXT KK
223 IJL=1+FIX(RND*10)
234 X(IJL)=RND*1000
291 HS(1)=((X(1)-X(2))^2+(X(6)-X(7))^2)^.5
292 HS(2)=((X(1)-X(3))^2+(X(6)-X(8))^2)^.5
293 HS(3)=((X(1)-X(4))^2+(X(6)-X(9))^2)^.5
294 HS(4)=((X(1)-X(5))^2+(X(6)-X(10))^2)^.5
295 HS(5)=((X(2)-X(3))^2+(X(7)-X(8))^2)^.5
296 HS(6)=((X(2)-X(4))^2+(X(7)-X(9))^2)^.5
297 HS(7)=((X(2)-X(5))^2+(X(7)-X(10))^2)^.5
298 HS(8)=((X(3)-X(4))^2+(X(8)-X(9))^2)^.5
299 HS(9)=((X(3)-X(5))^2+(X(8)-X(10))^2)^.5
300 HS(10)=((X(4)-X(5))^2+(X(9)-X(10))^2)^.5
551 IF HS(1)-25.2312<-.00001 THEN HS(1)=999999!
553 IF HS(2)-30.8974<-.00001 THEN HS(2)=999999!
554 IF HS(3)-26.4353<-.00001 THEN HS(3)=999999!
555 IF HS(4)-27.5426<-.00001 THEN HS(4)=999999!
565 IF HS(5)-30.8974<-.00001 THEN HS(5)=999999!
568 IF HS(6)-26.4353<-.00001 THEN HS(6)=999999!
569 IF HS(7)-27.5426<-.00001 THEN HS(7)=999999!
584 IF HS(8)-32.1015<-.00001 THEN HS(8)=999999!
585 IF HS(9)-33.2088<-.00001 THEN HS(9)=999999!
589 IF HS(10)-28.7467<-.00001 THEN HS(10)=999999!
1621 PR1=-10*HS(1)-15*HS(2)-20*HS(3)-.01*HS(4)
1622 PR2=-30*HS(5)-35*HS(6)-10*HS(7)
1631 PR3=-10*HS(8)-20*HS(9)
1632 PR4=-15*HS(10)
1655 P=PR1+PR2+PR3+PR4
1656 IF P<=M THEN 1670
1657 FOR KEW=1 TO 10
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-5400 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),A(10)
1915 REM
1916 REM
1917 REM
1919 PRINT M,JJJJ
1999 NEXT JJJJ
One notes that the flow of .01 in line 1621 above is an artificial flow.
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter, and the best candidate solutions produced during the first ten hours of running are presented below. What immediately follows is a manual copy from the computer screen.
556.7183 534.6341 505.9124 533.788 509.3705
644.7668 658.6841 649.2176 631.5781 616.2713
-5369.511 -31610
138.7942 134.8886 155.6561 159.9009 184.9188
872.151 897.4762 920.3549 888.4004 904.4385
-5353.261 -30343
Interpreted in accordance with line 1912 through line 1919, the candidate solutions above were produced during the first ten hours of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter, which is not a compiler.
References
Z. Drezner, "DISCON: A New Method for the Layout Problem," Operations Research 28, 1375-1384 (1980).
S. S. Heragu. Facilities Design, Third Edition. Boca Raton, Florida: CRC Press, 2008.
Subscribe to:
Posts (Atom)