Jsun Yui Wong
The computer program listed below seeks to solve the following problem from Floudas [1].
Objective function:
Maximize:
.7*X(3)-5*(X(1)-.5)^2-.8
Constraints:
0-EXP(X(1)-.2)-X(2)<=0
1+X(2)+1.1*X(3)<=0
-.2+X(1)-1.2*X(3)<=0
0.2<=X(1)<=1
-2.22554<=X(2)<=-1
X(3)= 0 or 1.
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
93 A(1)=.6
94 A(2)=-1.61277
103 A(3)=FIX(RND*2)
126 IMAR=10+FIX(RND*10000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
811 IF RND<.99 THEN 903 ELSE 961
903 IF RND<1/2 THEN 911 ELSE 921
911 X(1)=.2+.00001*FIX(RND*80001!)
915 GOTO 1151
921 X(2)=-2.22554+.00001*FIX(RND*122555!)
925 GOTO 1151
961 X(3)=FIX(RND*2)
1151 P1=0-EXP(X(1)-.2)-X(2)
1159 IF P1>0 THEN P1=P1 ELSE P1=0
1255 P2=1+X(2)+1.1*X(3)
1259 IF P2>0 THEN P2=P2 ELSE P2=0
1355 P3=-.2+X(1)-1.2*X(3)
1359 IF P3>0 THEN P3=P3 ELSE P3=0
1488 P=.7*X(3)-5*(X(1)-.5)^2-.8-333333!*(ABS(P1)+ABS(P2)+ABS(P3))
1499 PR=.7*X(3)-5*(X(1)-.5)^2-.8
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-1.078 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3)
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 2.5 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
.9419499635696411 -2.100019931793213 1
-1.076598875337893 -1.076598875337893 -31978
.9421799778938294 -2.100460052490234 1
-1.077615688092795 -1.077615688092795 -31871
.9420099854469299 -2.100139856338501 1
-1.076864160015834 -1.076864160015834 -31729
Interpreted in accordance with line 1912 and line 1915, the output through JJJJ=-31729 was produced in the first 2.5 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] Floudas, C. A. (1995) Nonlinear and Mixed-Integer Optimization--Fundamentals and Applications. Oxford University Press, Oxford.