Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-5*X(1)-1*X(2)-3*X(3)-2*X(4)-6*X(5)-4*X(6)-7*X(7)-2*X(8)-4*X(9)-1*X(10)-1*X(11)-5*X(12)
Constraints:
6-1*X(1)+3*X(2)-12*X(3)-X(5)+7*X(6)-X(7)+3*X(10)-5*X(11)-1*X(12)<=0
-1+3*X(1)-7*X(2)+1*X(4)+6*X(5)<=0
4+11*X(1)+X(3)-7*X(4)-1*X(6)+2*X(7)+X(8)-5*X(9)+9*X(11)<=0
-8+5*X(2)+6*X(3)-12*X(5)+7*X(6)+3*X(8)+X(9)-8*X(10)+5*X(12)<=0
7-7*X(1)-1*X(2)-5*X(3)+3*X(4)+1*X(5)-8*X(6)-2*X(8)+7*X(9)+1*X(10)-7*X(12)<=0
4-2*X(1)-4*X(4)-3*X(7)-5*X(8)-1*X(9)+X(11)+X(12)<=0
X(j)=0, 1
j=1, 2, 3,...,12
This problem is based on Example 4 of Balas [1, pp. 542-544].
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 K=1 TO 12
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 12
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*12)
1111 X(IJU)=FIX(RND*2)
1151 PEN1=6-1*X(1)+3*X(2)-12*X(3)-X(5)+7*X(6)-X(7)+3*X(10)-5*X(11)-1*X(12)
1159 IF PEN1>0 THEN PEN1=PEN1 ELSE PEN1=0
1255 PEN2=-1+3*X(1)-7*X(2)+1*X(4)+6*X(5)
1259 IF PEN2>0 THEN PEN2=PEN2 ELSE PEN2=0
1355 PEN3=4+11*X(1)+X(3)-7*X(4)-1*X(6)+2*X(7)+X(8)-5*X(9)+9*X(11)
1359 IF PEN3>0 THEN PEN3=PEN3 ELSE PEN3=0
1455 PEN4=-8+5*X(2)+6*X(3)-12*X(5)+7*X(6)+3*X(8)+X(9)-8*X(10)+5*X(12)
1459 IF PEN4>0 THEN PEN4=PEN4 ELSE PEN4=0
1462 PEN5=7-7*X(1)-1*X(2)-5*X(3)+3*X(4)+1*X(5)-8*X(6)-2*X(8)+7*X(9)+1*X(10)-7*X(12)
1469 IF PEN5>0 THEN PEN5=PEN5 ELSE PEN5=0
1472 PEN6=4-2*X(1)-4*X(4)-3*X(7)-5*X(8)-1*X(9)+X(11)+X(12)
1479 IF PEN6>0 THEN PEN6=PEN6 ELSE PEN6=0
1488 P=-5*X(1)-1*X(2)-3*X(3)-2*X(4)-6*X(5)-4*X(6)-7*X(7)-2*X(8)-4*X(9)-1*X(10)-1*X(11)-5*X(12)-333333!*(ABS(PEN1)+ABS(PEN2)+ABS(PEN3)+ABS(PEN4)+ABS(PEN5)+ABS(PEN6))
1499 PR=-5*X(1)-1*X(2)-3*X(3)-2*X(4)-6*X(5)-4*X(6)-7*X(7)-2*X(8)-4*X(9)-1*X(10)-1*X(11)-5*X(12)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 12
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-20 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),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 4 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 1 1 0
0 1 0 0 1
0 1 -18 -18 -31998
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31993
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31984
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31980
0 0 1 1 0
0 1 0 0 1
0 1 -18 -18 -31976
0 0 1 1 0
0 1 0 0 1
0 1 -18 -18 -31971
0 0 1 1 0
0 0 1 0 1
0 1 -13 -13 -31967
0 0 1 1 0
0 1 0 0 1
0 1 -18 -18 -31960
0 0 1 1 0
0 1 0 0 1
0 1 -18 -18 -31953
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31948
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31943
0 1 1 1 1
0 0 1 0 0
0 1 -19 -19 -31942
0 0 1 1 0
0 0 1 0 1
0 1 -13 -13 -31938
0 0 1 1 0
0 0 1 0 1
0 1 -13 -13 -31937
Interpreted in accordance with line 1912, line 1914, and line 1915, the output through JJJJ=-31937 was produced during the first 4 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] E. Balas, "An Additive Algorithm for Solving Linear Programs with Zero-One Variables," Operations Research 13, 517-546 (1965).
Sunday, July 5, 2009
Saturday, July 4, 2009
An Integer Nonlinear Programming Computer Program Applied to a 0-1 Problem
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)
Constraints:
-2-3*X(1)+12*X(2)+8*X(3)-X(4)+7*X(9)-2*X(10)>=0
-1-X(2)+10*X(3)+5*X(5)-X(6)-7*X(7)-X(8)>=0
-1-5*X(1)+3*X(2)+X(3)+2*X(8)-X(10)>=0
1+5*X(1)-3*X(2)-X(3)-2*X(8)+X(10)>=0
-3+4*X(3)+2*X(4)+5*X(6)-X(7)+9*X(8)+2*X(9)>=0
-7-9*X(2)+12*X(4)+7*X(5)-6*X(6)-2*X(8)+15*X(9)-3*X(10)>=0
-1+8*X(1)-5*X(2)-2*X(3)+7*X(4)+X(5)+5*X(7)+10*X(9)>=0
X(j)=0, 1
j=1, 2, 3,...,10
This problem is the 10-variable 0,1 problem on page 58 of Plane and McMillan [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
91 FOR K=1 TO 10
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 10
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*10)
1111 X(IJU)=FIX(RND*2)
1151 PEN1=-2-3*X(1)+12*X(2)+8*X(3)-X(4)+7*X(9)-2*X(10)
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1255 PEN2=-1-X(2)+10*X(3)+5*X(5)-X(6)-7*X(7)-X(8)
1259 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1355 PEN3=-1-5*X(1)+3*X(2)+X(3)+2*X(8)-X(10)
1359 IF PEN3<0 THEN PEN3=PEN3 ELSE PEN3=0
1455 PEN4=1+5*X(1)-3*X(2)-X(3)-2*X(8)+X(10)
1459 IF PEN4<0 THEN PEN4=PEN4 ELSE PEN4=0
1462 PEN5=-3+4*X(3)+2*X(4)+5*X(6)-X(7)+9*X(8)+2*X(9)
1469 IF PEN5<0 THEN PEN5=PEN5 ELSE PEN5=0
1472 PEN6=-7-9*X(2)+12*X(4)+7*X(5)-6*X(6)-2*X(8)+15*X(9)-3*X(10)
1479 IF PEN6<0 THEN PEN6=PEN6 ELSE PEN6=0
1482 PEN7=-1+8*X(1)-5*X(2)-2*X(3)+7*X(4)+X(5)+5*X(7)+10*X(9)
1485 IF PEN7<0 THEN PEN7=PEN7 ELSE PEN7=0
1488 P=-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)-333333!*(ABS(PEN1)+ABS(PEN2)+ABS(PEN3)+ABS(PEN4)+ABS(PEN5)+ABS(PEN6)+ABS(PEN7))
1499 PR=-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 10
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-7 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),A(8),A(9),A(10)
1914 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 5 seconds of running is presented below.
0 0 1 0 0
0 0 0 1 0
-6 -6 -32000
This solution also occurred at JJJJ=-31992, -31989, -31988, -31982, -31981, -31980,
-31970, -31969, -31964, -31962, -31960, -31957, -31956, -31954, -31952, -31942,
-31939, -31936, and -31927.
And a different solution also occurred:
0 0 1 0 1
0 1 0 0 0
-6 -6 -31938
0 0 1 0 1
0 1 0 0 0
-6 -6 -31929
0 0 1 0 1
0 1 0 0 0
-6 -6 -31926
Interpreted in accordance with line 1912, line 1913, and line 1914, the output through JJJJ=-31926 was produced in the first 5 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] D. R. Plane, C. McMillan, Jr., "Discrete Optimization," Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1971.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)
Constraints:
-2-3*X(1)+12*X(2)+8*X(3)-X(4)+7*X(9)-2*X(10)>=0
-1-X(2)+10*X(3)+5*X(5)-X(6)-7*X(7)-X(8)>=0
-1-5*X(1)+3*X(2)+X(3)+2*X(8)-X(10)>=0
1+5*X(1)-3*X(2)-X(3)-2*X(8)+X(10)>=0
-3+4*X(3)+2*X(4)+5*X(6)-X(7)+9*X(8)+2*X(9)>=0
-7-9*X(2)+12*X(4)+7*X(5)-6*X(6)-2*X(8)+15*X(9)-3*X(10)>=0
-1+8*X(1)-5*X(2)-2*X(3)+7*X(4)+X(5)+5*X(7)+10*X(9)>=0
X(j)=0, 1
j=1, 2, 3,...,10
This problem is the 10-variable 0,1 problem on page 58 of Plane and McMillan [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
91 FOR K=1 TO 10
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 10
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*10)
1111 X(IJU)=FIX(RND*2)
1151 PEN1=-2-3*X(1)+12*X(2)+8*X(3)-X(4)+7*X(9)-2*X(10)
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1255 PEN2=-1-X(2)+10*X(3)+5*X(5)-X(6)-7*X(7)-X(8)
1259 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1355 PEN3=-1-5*X(1)+3*X(2)+X(3)+2*X(8)-X(10)
1359 IF PEN3<0 THEN PEN3=PEN3 ELSE PEN3=0
1455 PEN4=1+5*X(1)-3*X(2)-X(3)-2*X(8)+X(10)
1459 IF PEN4<0 THEN PEN4=PEN4 ELSE PEN4=0
1462 PEN5=-3+4*X(3)+2*X(4)+5*X(6)-X(7)+9*X(8)+2*X(9)
1469 IF PEN5<0 THEN PEN5=PEN5 ELSE PEN5=0
1472 PEN6=-7-9*X(2)+12*X(4)+7*X(5)-6*X(6)-2*X(8)+15*X(9)-3*X(10)
1479 IF PEN6<0 THEN PEN6=PEN6 ELSE PEN6=0
1482 PEN7=-1+8*X(1)-5*X(2)-2*X(3)+7*X(4)+X(5)+5*X(7)+10*X(9)
1485 IF PEN7<0 THEN PEN7=PEN7 ELSE PEN7=0
1488 P=-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)-333333!*(ABS(PEN1)+ABS(PEN2)+ABS(PEN3)+ABS(PEN4)+ABS(PEN5)+ABS(PEN6)+ABS(PEN7))
1499 PR=-10*X(1)-7*X(2)-X(3)-12*X(4)-2*X(5)-8*X(6)-3*X(7)-X(8)-5*X(9)-3*X(10)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 10
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-7 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),A(8),A(9),A(10)
1914 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 5 seconds of running is presented below.
0 0 1 0 0
0 0 0 1 0
-6 -6 -32000
This solution also occurred at JJJJ=-31992, -31989, -31988, -31982, -31981, -31980,
-31970, -31969, -31964, -31962, -31960, -31957, -31956, -31954, -31952, -31942,
-31939, -31936, and -31927.
And a different solution also occurred:
0 0 1 0 1
0 1 0 0 0
-6 -6 -31938
0 0 1 0 1
0 1 0 0 0
-6 -6 -31929
0 0 1 0 1
0 1 0 0 0
-6 -6 -31926
Interpreted in accordance with line 1912, line 1913, and line 1914, the output through JJJJ=-31926 was produced in the first 5 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] D. R. Plane, C. McMillan, Jr., "Discrete Optimization," Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1971.
A Computer Program for 0-1 Nonlinear Programming
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
X(1)
Constraints:
X(2)-X(1)^3>=0
X(1)^2-X(2)>=0
X(2)-X(1)^3-X(3)^2=0
X(1)^2-X(2)-X(4)^2=0
X(1)=0, 1
X(2)=0, 1
X(3)=0, 1
X(4)=0, 1
This problem is an adaptation of Problem 263 on page 87 of Schittkowski [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
91 FOR K=1 TO 4
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=FIX(RND*2)
1151 PEN1=X(2)-X(1)^3
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1255 PEN2=X(1)^2-X(2)
1259 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1355 PEN3=X(2)-X(1)^3-X(3)^2
1359 IF PEN3=0 THEN PEN3=0 ELSE PEN3=PEN3
1455 PEN4=X(1)^2-X(2)-X(4)^2
1459 IF PEN4=0 THEN PEN4=0 ELSE PEN4=PEN4
1488 P=X(1)-333333!*ABS(PEN1)-333333!*ABS(PEN2)-333333!*ABS(PEN3)-333333!*ABS(PEN4)
1499 PR=X(1)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its output produced in the first 2 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 0 0 0
0 -32000
0 0 0 0 0
0 -31999
1 1 0 0 1
1 -31998
0 0 0 0 0
0 -31997
0 0 0 0 0
0 -31996
0 0 0 0 0
0 -31995
0 0 0 0 0
0 -31994
0 0 0 0 0
0 -31993
0 0 0 0 0
0 -31992
1 1 0 0 1
1 -31991
0 0 0 0 0
0 -31990
0 0 0 0 0
0 -31989
1 1 0 0 1
1 -31988
Interpreted in accordance with line 1912, the output above--with the best solution at JJJJ=-31998, JJJJ=-31991, and JJJJ=-31988--was produced in the first 2 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
X(1)
Constraints:
X(2)-X(1)^3>=0
X(1)^2-X(2)>=0
X(2)-X(1)^3-X(3)^2=0
X(1)^2-X(2)-X(4)^2=0
X(1)=0, 1
X(2)=0, 1
X(3)=0, 1
X(4)=0, 1
This problem is an adaptation of Problem 263 on page 87 of Schittkowski [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
91 FOR K=1 TO 4
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=FIX(RND*2)
1151 PEN1=X(2)-X(1)^3
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1255 PEN2=X(1)^2-X(2)
1259 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1355 PEN3=X(2)-X(1)^3-X(3)^2
1359 IF PEN3=0 THEN PEN3=0 ELSE PEN3=PEN3
1455 PEN4=X(1)^2-X(2)-X(4)^2
1459 IF PEN4=0 THEN PEN4=0 ELSE PEN4=PEN4
1488 P=X(1)-333333!*ABS(PEN1)-333333!*ABS(PEN2)-333333!*ABS(PEN3)-333333!*ABS(PEN4)
1499 PR=X(1)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its output produced in the first 2 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 0 0 0
0 -32000
0 0 0 0 0
0 -31999
1 1 0 0 1
1 -31998
0 0 0 0 0
0 -31997
0 0 0 0 0
0 -31996
0 0 0 0 0
0 -31995
0 0 0 0 0
0 -31994
0 0 0 0 0
0 -31993
0 0 0 0 0
0 -31992
1 1 0 0 1
1 -31991
0 0 0 0 0
0 -31990
0 0 0 0 0
0 -31989
1 1 0 0 1
1 -31988
Interpreted in accordance with line 1912, the output above--with the best solution at JJJJ=-31998, JJJJ=-31991, and JJJJ=-31988--was produced in the first 2 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
Thursday, July 2, 2009
A Computer Program and Its Output for a 0-1 Nonlinear Programming Problem
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
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
A Computer Program for 0-1 Nonlinear Programming
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(1000)^1000*EXP(-X(1000)).
Constraints:
X(1)=0, 1
X(2)=0, 1
X(3)=0, 1
.
.
.
X(999)=0, 1
X(1000)=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 1000 0-1 variables, X(1), X(2), X(3),..., X(1000), are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(1555),A(1555),L(1555),K(1555),J(1555)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1.701411834604692D+38
91 FOR K=1 TO 1000
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*2000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 1000
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*1000)
1105 X(IJL)=FIX(RND*2)
1221 P=0
1224 FOR JL=1 TO 1000
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 1000
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1988 PRINT A(999),A(1000),JJJJ,M
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 5.5 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 -32000 0
0 0 -31999 -1.103638323514327
0 0 -31998 -2.943035529371539
0 0 -31997 0
0 0 -31996 0
Interpreted in accordance with line 1988, the output above was produced during the first 5.5 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
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(1000)^1000*EXP(-X(1000)).
Constraints:
X(1)=0, 1
X(2)=0, 1
X(3)=0, 1
.
.
.
X(999)=0, 1
X(1000)=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 1000 0-1 variables, X(1), X(2), X(3),..., X(1000), are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(1555),A(1555),L(1555),K(1555),J(1555)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1.701411834604692D+38
91 FOR K=1 TO 1000
93 A(K)=FIX(RND*2)
99 NEXT K
126 IMAR=10+FIX(RND*2000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 1000
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*1000)
1105 X(IJL)=FIX(RND*2)
1221 P=0
1224 FOR JL=1 TO 1000
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 1000
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1988 PRINT A(999),A(1000),JJJJ,M
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 5.5 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 -32000 0
0 0 -31999 -1.103638323514327
0 0 -31998 -2.943035529371539
0 0 -31997 0
0 0 -31996 0
Interpreted in accordance with line 1988, the output above was produced during the first 5.5 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
A Computer Program and Its Output for an Integer Nonlinear Programming Test Example
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
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
Wednesday, July 1, 2009
A Computer Program for Integer Nonlinear Programming
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(50)^50*EXP(-X(50)).
Constraints:
X(1)=0, 1, 2
X(2)=0, 1, 2
X(3)=0, 1, 2
.
.
.
X(50)=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 fifty constraints above are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(55),A(55),L(55),K(55),J(55)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 50
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 50
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*50)
1105 X(IJL)=FIX(RND*3)
1221 P=0
1224 FOR JL=1 TO 50
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 50
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)
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 25 seconds of running are presented below. (What immediately follows is a 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 -3200
And this optimal solution also occurred at JJJJ=-31999 through JJJJ=-31936 but not at JJJJ=-31990, JJJJ=-31975, JJJJ=-31968, JJJJ=-31953, and JJJJ=-31936. These exceptions are shown below.
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
-.3678794411714423 -31990
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
-.3678794411714423 -31975
0 0 0 0 0
0 0 0 0 0
1 0 0 0 0
0 0 0 0 0
1 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
-1.103638323514327 -31968
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
-.3678794411714423 -31953
0 0 0 0 0
0 0 0 2 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
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
-70.02742389948858 -31936
Interpreted in accordance with line 1911 through line 1988, the output above shows the candidate solutions produced during the first 25 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
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(50)^50*EXP(-X(50)).
Constraints:
X(1)=0, 1, 2
X(2)=0, 1, 2
X(3)=0, 1, 2
.
.
.
X(50)=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 fifty constraints above are handled by line 1104 and line 1105 below.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(55),A(55),L(55),K(55),J(55)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 50
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 50
131 X(K)=A(K)
132 NEXT K
1104 IJL=1+FIX(RND*50)
1105 X(IJL)=FIX(RND*3)
1221 P=0
1224 FOR JL=1 TO 50
1227 P=P-X(JL)^JL*EXP(-X(JL))
1229 NEXT JL
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 50
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)
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 25 seconds of running are presented below. (What immediately follows is a 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 -3200
And this optimal solution also occurred at JJJJ=-31999 through JJJJ=-31936 but not at JJJJ=-31990, JJJJ=-31975, JJJJ=-31968, JJJJ=-31953, and JJJJ=-31936. These exceptions are shown below.
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
-.3678794411714423 -31990
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
-.3678794411714423 -31975
0 0 0 0 0
0 0 0 0 0
1 0 0 0 0
0 0 0 0 0
1 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
-1.103638323514327 -31968
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
-.3678794411714423 -31953
0 0 0 0 0
0 0 0 2 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 1
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
-70.02742389948858 -31936
Interpreted in accordance with line 1911 through line 1988, the output above shows the candidate solutions produced during the first 25 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
Subscribe to:
Posts (Atom)