Jsun Yui Wong
The computer program listed below seeks to optimize the following problem.
Objective function:
Maximize:
-X(1)^1*EXP(-X(1))-X(2)^2*EXP(-X(2))-X(3)^3*EXP(-X(3))-...-X(2000)^2000*EXP(-X(2000)).
Constraints:
X(1)=0, 1
X(2)=0, 1
X(3)=0, 1
.
.
.
X(1999)=0, 1
X(2000)=0, 1.
This problem is an adaptation of the contribution of Leon [1], of Schwefel [2,
Problem 3.10 on page 329], and of Smith and Rudd [3].
The 2000 0-1 variables, X(1), X(2), X(3),..., and X(2000), are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(2000),A(2000),L(2000),K(2000),J(2000)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1.701411834604692D+38
91 FOR K=1 TO 2000
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*3000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 2000
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*2000)
1105 X(IJL)=FIX(RND*2)
1221 P=0
1224 FOR JL=1 TO 2000
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 2000
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1988 PRINT A(1999),A(2000),JJJJ,M
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 50 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 -32000 0
0 0 -31999 0
0 0 -31998 -12.87578044100048
0 0 -31997 -4.046673852885866
0 0 -31996 -.7357588823428846
0 0 -31995 -6.25395049991452
0 0 -31994 -1.839397205857212
0 0 -31993 -.7357588823428846
0 0 -31992 0
0 0 -31991 -12.87578044100048
0 0 -31990 -1.839397205857212
0 0 -31989 -.7357588823428846
0 0 -31988 0
Interpreted in accordance with line 1988, the output above was produced during the first 50 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
References
[1] Leon, A. (1966), A comparison among eight known optimizing procedures, in: Lavi and Vogl (1966) p. 23-46
[2] Schwefel, H.P. (1981), Numerical optimization of computer models, John Wiley and Sons, New York
[3] Smith, N.H., D.F. Rudd (1964), The feasibility of directed random search, Univ. Wisconsin, Dept. Chem. Engng., report