Jsun Yui Wong
The three similar computer programs listed below try to solve the three formulations in Chapter 6 of Floudas and Pardalos [1, pp. 58-61], respectively.
These computer programs are similar to those of the May 29 post of http://wongsblog-wong.blogspot.com.
Case I of Floudas and Pardalos:
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR KK=1 TO 8
94 A(KK)=RND*205
95 NEXT KK
126 IMAR=10+RND*32666
128 FOR I=1 TO IMAR
129 FOR K=1 TO 8
131 X(K)=A(K)
132 NEXT K
141 FOR IPHO=1 TO 2+FIX(RND*15)
181 J=1+FIX(RND*8)
183 R=(1-RND*2)*A(J)
191 IF RND<.14 THEN X(J)=FIX(RND*205) ELSE IF RND<.17 THEN X(J)=A(J)+R ELSE IF RND<.2 THEN X(J)=A(J)+RND*R ELSE IF RND<.25 THEN X(J)=A(J)+RND^2*R ELSE IF RND<.33 THEN X(J)=A(J)+RND^3*R ELSE IF RND<.5 THEN X(J)=A(J)+RND^4*R ELSE X(J)=INT(A(J))
277 NEXT IPHO
301 IF X(1)>100 THEN X(1)=0
302 IF X(2)>200 THEN X(2)=0
304 X(5)=X(1)-X(7)
305 X(6)=X(2)-X(8)
309 X(4)=X(7)+X(8)-X(3)
1117 IF X(7)+X(8)=0 THEN 1670
1119 W=(3*X(3)+X(4))/(X(7)+X(8))
1121 L1=W*X(7)+2*X(5)-2.5*X(1)
1122 IF L1>0 THEN 1670
1123 L2=W*X(8)+2*X(6)-1.5*X(2)
1124 IF L2>0 THEN 1670
1201 FOR IPO=1 TO 8
1203 IF X(IPO)<0 THEN 1670
1206 NEXT IPO
1225 P1NEWMAY=9*X(1)+15*X(2)-6*X(3)-16*X(4)-10*X(5)-10*X(6)
1448 P=P1NEWMAY
1451 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1660 WA=W
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>394 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8),WA
1913 PRINT M,JJJJ
1999 NEXT JJJJ
The BASIC computer program above was run with Microsoft's GW BASIC 3.11 interpreter, which is not a compiler. Its complete output through
JJJJ=-31998 is presented below. What immediately follows is a manual copy from the computer screen.
0 200 0 100 0
100 0 100 1
400 -32000
0 200 0 100 0
100 0 100 1
400 -31999
0 199.999802785422 0 99.99990139281525
0 99.99990139260676 0 99.99990139281525
1
399.9996055702185 -31998
Interpreted in accordance with line 1912 and line 1913, the output above was obtained in 2 minutes on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Case II of Floudas and Pardalos:
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR KK=1 TO 8
94 A(KK)=RND*605
95 NEXT KK
126 IMAR=10+RND*32666
128 FOR I=1 TO IMAR
129 FOR K=1 TO 8
131 X(K)=A(K)
132 NEXT K
141 FOR IPHO=1 TO 2+FIX(RND*15)
181 J=1+FIX(RND*8)
183 R=(1-RND*2)*A(J)
191 IF RND<.14 THEN X(J)=FIX(RND*605) ELSE IF RND<.17 THEN X(J)=A(J)+R ELSE IF RND<.2 THEN X(J)=A(J)+RND*R ELSE IF RND<.25 THEN X(J)=A(J)+RND^2*R ELSE IF RND<.33 THEN X(J)=A(J)+RND^3*R ELSE IF RND<.5 THEN X(J)=A(J)+RND^4*R ELSE X(J)=INT(A(J))
277 NEXT IPHO
301 IF X(1)>600 THEN X(1)=0
302 IF X(2)>200 THEN X(2)=0
304 X(5)=X(1)-X(7)
305 X(6)=X(2)-X(8)
309 X(4)=X(7)+X(8)-X(3)
1117 IF X(7)+X(8)=0 THEN 1670
1119 W=(3*X(3)+X(4))/(X(7)+X(8))
1121 L1=W*X(7)+2*X(5)-2.5*X(1)
1122 IF L1>0 THEN 1670
1123 L2=W*X(8)+2*X(6)-1.5*X(2)
1124 IF L2>0 THEN 1670
1201 FOR IPO=1 TO 8
1203 IF X(IPO)<0 THEN 1670
1206 NEXT IPO
1225 P1NEWMAY=9*X(1)+15*X(2)-6*X(3)-16*X(4)-10*X(5)-10*X(6)
1448 P=P1NEWMAY
1451 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1660 WA=W
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>594 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8),WA
1913 PRINT M,JJJJ
1999 NEXT JJJJ
The BASIC computer program above was run with Microsoft's GW BASIC 3.11 interpreter, which is not a compiler. Its complete output through
JJJJ=-31928 is presented below. What immediately follows is a manual copy from the computer screen.
599.9141480403103 0 299.9571890075342
1.149912691360555D-04 299.95684041507 0
299.9573039988033 0 2.99999923328242
599.9139180422116 -31968
599.9399224686729 0 299.9726214965366
2.660342267787996D-03 299.9646406298684 0
299.9752818388044 0 2.999982262923455
599.934601463867 -31951
599.9584589087624 0 299.4797050692913
4.756849602287616D-04 299.4782781545109 0
299.4801807542515 0 2.999996823262501
598.9575072586413 -31928
Interpreted in accordance with line 1912 and line 1913, the output above was obtained in 20 minutes on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Case III of Floudas and Pardalos:
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR KK=1 TO 8
94 A(KK)=RND*205
95 NEXT KK
126 IMAR=10+RND*32666
128 FOR I=1 TO IMAR
129 FOR K=1 TO 8
131 X(K)=A(K)
132 NEXT K
141 FOR IPHO=1 TO 2+FIX(RND*15)
181 J=1+FIX(RND*8)
183 R=(1-RND*2)*A(J)
191 IF RND<.14 THEN X(J)=FIX(RND*205) ELSE IF RND<.17 THEN X(J)=A(J)+R ELSE IF RND<.2 THEN X(J)=A(J)+RND*R ELSE IF RND<.25 THEN X(J)=A(J)+RND^2*R ELSE IF RND<.33 THEN X(J)=A(J)+RND^3*R ELSE IF RND<.5 THEN X(J)=A(J)+RND^4*R ELSE X(J)=INT(A(J))
277 NEXT IPHO
301 IF X(1)>100 THEN X(1)=0
302 IF X(2)>200 THEN X(2)=0
304 X(5)=X(1)-X(7)
305 X(6)=X(2)-X(8)
309 X(4)=X(7)+X(8)-X(3)
1117 IF X(7)+X(8)=0 THEN 1670
1119 W=(3*X(3)+X(4))/(X(7)+X(8))
1121 L1=W*X(7)+2*X(5)-2.5*X(1)
1122 IF L1>0 THEN 1670
1123 L2=W*X(8)+2*X(6)-1.5*X(2)
1124 IF L2>0 THEN 1670
1201 FOR IPO=1 TO 8
1203 IF X(IPO)<0 THEN 1670
1206 NEXT IPO
1225 P1NEWMAY=9*X(1)+15*X(2)-6*X(3)-13*X(4)-10*X(5)-10*X(6)
1448 P=P1NEWMAY
1451 IF P<=M THEN 1670
1657 FOR KEW=1 TO 8
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1660 WA=W
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>740 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8),WA
1913 PRINT M,JJJJ
1999 NEXT JJJJ
The BASIC computer program above was run with Microsoft's GW BASIC 3.11 interpreter, which is not a compiler. Its complete output through
JJJJ=-31996 is presented below. What immediately follows is a manual copy from the computer screen.
0 199.9999991702184 49.41530681308674
149.4153064337752 0 1.169385923356462
0 199.830613246862 1.497059341176343
749.4153038021134 -32000
0 199.9986815280429 49.72581889765022
149.7251596630286 0 .547702967364085
0 199.4509785606788 1.498626973469796
749.7212042417296 -31999
0 200 49.65246449766539 149.652464570163
0 .6950709321715749 0 199.3049290678284
1.498256262199792
749.6524642801725 -31998
0 199.99571121132 49.41544894619624
149.4133046782789 0 1.166957586844831
0 198.8287536244751 1.49706541981877
749.4004378065481 -31997
0 199.9999632134356 49.99196974992971
149.9919513841026 0 1.604207940330937D-02
0 199.9839211340323 1.499959891439716
749.991840914589 -31996
Interpreted in accordance with line 1912 and line 1913, the output above was obtained in 3 minutes on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
References
[1] C. A. Floudas, P. M. Pardalos. A collection of test problems for constrained global optimization algorithms. Lecture notes in computer science, edited by G. Goos and J. Hartmanis. Springer-Verlag, 1990.
[2] C. A. Haverly. Studies of the behavior of recursion for the pooling problem. ACM SIGMAP Bulletin, 25:19, 1978.
[3] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.
[4] C. Mohan, H. T. Nguyen. A controlled random search technique incorporating the simulated annealing concept for solving integer and mixed integer global optimization problems. Computational Optimiztion and Applications 14, 103-132 (1999).