Jsun Yui Wong
The computer program listed below seeks to optimize in integers 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(100)^100*EXP(-X(100)).
Constraints:
X(1)=0, 1, 2
X(2)=0, 1, 2
X(3)=0, 1, 2
.
.
.
X(100)=0, 1, 2.
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 100 constraints above are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(155),A(155),L(155),K(155),J(155)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1.701411834604692D+38
91 FOR K=1 TO 100
93 A(K)=FIX(RND*3)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 100
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*100)
1105 X(IJL)=FIX(RND*3)
1221 P=0
1224 FOR JL=1 TO 100
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 100
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1911 PRINT A(1),A(2),A(3),A(4),A(5)
1912 PRINT A(6),A(7),A(8),A(9),A(10)
1913 PRINT A(11),A(12),A(13),A(14),A(15)
1914 PRINT A(16),A(17),A(18),A(19),A(20)
1915 PRINT A(21),A(22),A(23),A(24),A(25)
1916 PRINT A(26),A(27),A(28),A(29),A(30)
1917 PRINT A(31),A(32),A(33),A(34),A(35)
1918 PRINT A(36),A(37),A(38),A(39),A(40)
1919 PRINT A(41),A(42),A(43),A(44),A(45)
1920 PRINT A(46),A(47),A(48),A(49),A(50)
1921 PRINT A(51),A(52),A(53),A(54),A(55)
1922 PRINT A(56),A(57),A(58),A(59),A(60)
1923 PRINT A(61),A(62),A(63),A(64),A(65)
1924 PRINT A(66),A(67),A(68),A(69),A(70)
1925 PRINT A(71),A(72),A(73),A(74),A(75)
1926 PRINT A(76),A(77),A(78),A(79),A(80)
1927 PRINT A(81),A(82),A(83),A(84),A(85)
1928 PRINT A(86),A(87),A(88),A(89),A(90)
1929 PRINT A(91),A(92),A(93),A(94),A(95)
1930 PRINT A(96),A(97),A(98),A(99),A(100)
1988 PRINT M,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its candidate solutions produced during the first 15 seconds of running are presented below. (What immediately follows is an abbreviated manual copy from the computer screen.)
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 -32000
.
.
.
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
-.3678794411714423 -31994
The optimal solution at JJJJ=-32000 also occurred at JJJJ=-31999 through JJJJ=-31995.
Interpreted in accordance with line 1911 through line 1988, the output above shows the candidate solutions produced during the first 15 seconds 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