The following computer program seeks to solve Li and Sun's Problem 14.4, [7, p. 415], but with n=9500 integer unknowns and 0<=X(i)<=+1, as shown in in line 110, line 112, and line 168. One notes line 110, line 112, and line 113, which are 110 FOR J44=1 TO 9500, 112 A(J44)=FIX( RND*2), and 113 NEXT J44.
In other words, the problem is to minimize the following:
n-1
SIGMA [ 100*( X( i+1 ) -X(i)^2 )^2+(1-X( i))^2 ]
i=1
subject to lower bound<=X(i)<=upper bound, X(i) integer, i=1, 2, 3,..., n. See Li and Sun [7, p. 415].
0 REM DEFDBL A-Z
1 DEFINT J,K,X
2 DIM A(10001),X(10001)
88 FOR JJJJ=-32000 TO 32000
89 RANDOMIZE JJJJ
90 M=-3D+30
110 FOR J44=1 TO 9500
112 A(J44)=FIX( RND*2)
113 NEXT J44
128 FOR I=1 TO 32000
129 FOR KKQQ=1 TO 9500
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
139 FOR IPP=1 TO FIX(1+RND*3)
140 B=1+FIX(RND*9501)
144 GOTO 168
150 R=(1-RND*2)*A(B)
155 IF RND<.5 THEN 160 ELSE 167
160 X(B)=(A(B) +RND^3*R)
165 GOTO 168
167 IF RND<.5 THEN X(B)=A(B)-1 ELSE X(B)=A(B) +1
168 IF A(B)=0 THEN X(B)=1 ELSE X(B)=0
169 NEXT IPP
170 GOTO 220
182 FOR J44=1 TO 5000
183 IF X(J44)<-5 THEN X(J44)=A(J44)
184 IF X(J44)>5 THEN X(J44)=A(J44)
185 NEXT J44
220 SUMM=0
222 FOR J44=1 TO 9499
223 SUMM=SUMM+ 100*( X( J44 +1 ) -X(J44)^2 )^2+(1-X( J44))^2
226 NEXT J44
333 PD1=-SUMM
1111 IF PD1<=M THEN 1670
1452 M=PD1
1454 FOR KLX=1 TO 9500
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1544 IF M<-8 THEN 1557
1546 PRINT I,A(9500),M,JJJJ
1557 GOTO 128
1670 NEXT I
1889 IF M<-999 THEN 2999
1904 PRINT A(1),A(2),A(3),A(4),A(5)
1911 PRINT A(102),A(104),A(106),A(107),A(109)
1913 PRINT A(193),A(197),A(198),A(199),A(200)
1916 PRINT A(202),A(207),A(208),A(209),A(233)
1917 PRINT A(294),A(297),A(298),A(299),A(300)
1918 PRINT A(700),A(702),A(703),A(704),A(705)
1919 PRINT A(902),A(904),A(906),A(907),A(909)
1921 PRINT A(1096),A(1097),A(1098),A(1099),A(1100)
1926 PRINT A(9496),A(9497),A(9498),A(9499),A(9500)
1927 PRINT M,JJJJ
2999 NEXT JJJJ
This BASIC computer program was run via basica/D of Microsoft's GW-BASIC 3.11 interpreter for DOS. See [8]. The output below is copied by hand from the screen. Immediately below there is no rounding by hand.
650 1 0 -32000
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
0 -32000
14892 1 0 -31999
Specified by line 1904 through line 1926, only 45 A's of the 9500 A's are shown above.
The word PRINT in the computer program above can be replaced by the word LPRINT for printing on paper.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM, and the IBM basica/D interpreter, version GW BASIC 3.11, the wall-clock time for obtaining the output shown above was eight hours.
Similar to the computer program above, the following computer program seeks to solve Newton's original equation X(1)^3-2*X(1)-5=0; see Cajori [3, pp. 29-30] and Lashover [4, pp. 39-40]. One notes line 114, which is 114 A(J44)=-50+( RND*100).
0 DEFDBL A-Z
1 DEFINT I,J,K
2 DIM A(1000),X(1000)
88 FOR JJJJ=-32000 TO 32000
89 RANDOMIZE JJJJ
90 M=-3D+30
110 FOR J44=1 TO 1
112 REM A(J44)=FIX( RND*2)
113 REM NEXT J44
114 A(J44)=-50+( RND*100)
116 NEXT J44
128 FOR I=1 TO 500
129 FOR KKQQ=1 TO 1
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
139 FOR IPP=1 TO FIX(1+RND*.3)
140 REM B=1+FIX(RND*8001)
141 B=1
144 REM GOTO 168
150 R=(1-RND*2)*A(B)
155 REM IF RND<.5 THEN 160 ELSE 167
160 X(B)=(A(B) +RND^3*R)
165 GOTO 251
167 IF RND<.5 THEN X(B)=A(B)-1 ELSE X(B)=A(B) +1
168 IF A(B)=0 THEN X(B)=1 ELSE X(B)=0
169 NEXT IPP
170 GOTO 220
182 FOR J44=1 TO 5000
183 IF X(J44)<-5 THEN X(J44)=A(J44)
184 IF X(J44)>5 THEN X(J44)=A(J44)
185 NEXT J44
220 SUMM=0
222 FOR J44=1 TO 7999
223 SUMM=SUMM+ 100*( X( J44 +1 ) -X(J44)^2 )^2+(1-X( J44))^2
226 NEXT J44
251 N=X(1)^3-2*X(1)-5
333 REM PD1=-SUMM
444 PD1=-ABS(N)
1111 IF PD1<=M THEN 1670
1452 M=PD1
1454 FOR KLX=1 TO 1
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1544 REM IF M<-8 THEN 1557
1546 REM PRINT I,A(8000),M,JJJJ
1557 GOTO 128
1670 NEXT I
1889 IF M<-.0000001 THEN 2999
1904 PRINT A(1),M,JJJJ
1911 GOTO 2999
1913 PRINT A(193),A(197),A(198),A(199),A(200)
1916 PRINT A(202),A(207),A(208),A(209),A(233)
1917 PRINT A(294),A(297),A(298),A(299),A(300)
1918 PRINT A(700),A(702),A(703),A(704),A(705)
1919 PRINT A(902),A(904),A(906),A(907),A(909)
1921 PRINT A(1096),A(1097),A(1098),A(1099),A(1100)
1926 PRINT A(7996),A(7997),A(7998),A(7999),A(8000)
1927 PRINT M,JJJJ
2999 NEXT JJJJ
This BASIC computer program was run via basica/D of Microsoft's GW-BASIC 3.11 interpreter for DOS. See [8]. The complete output through JJJJ=-31990 is copied by hand from the screen and shown below. Immediately below there is no rounding by hand.
2.094551478163554 -3.771196066537641D-08 -31999
2.09455148846776 -7.729779427645411D-08 -31997
2.094551489702948 -9.368674946941269D-09 -31990
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM, and the IBM basica/D interpreter, version GW BASIC 3.11, the wall-clock time for obtaining the output through JJJJ=-31990 was one second.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] E. Balas, An Additive Algorithm for Solving Linear Programs with Zero-One Variables. Operations Research, Vol. 13, No. 4 (1965), pp. 517-548.
[2] E. Balas, Discrete Programming by the Filter Method. Operations Research, Vol. 15, No. 5 (Sep. - Oct., 1967), pp. 915-957.
[3] F. Cajori (1911) Historical Note on the Newton-Raphson Method of Approximation. The American Mathematical Monthly, Volume 18 #2, pp. 29-32.
[4] Jack Lashover (November 12, 2012). Monte Carlo Marching. www.academia.edu/5481312/MONTE_ CARLO_MARCHING
[5] E. L. Lawler, M. D. Bell, A Method for Solving Discrete Optimization Problems. Operations Research, Vol. 14, No. 6 (Nov. - Dec., 1966), pp. 1098-1112.
[6] E. L. Lawler, M. D. Bell, Errata: A Method for Solving Discrete Optimization Problems. Operations Research, Vol. 15, No. 3 (May - June, 1967), p. 578.
[7] Duan Li, Xiaoling Sun, Nonlinear Integer Programming. Publisher: Springer Science+Business Media,LLC (2006). http://www.books.google.ca/books?isbn=0387329951
[8] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C,Boca Raton, Floridda 33432, 1981.
[9] Harvey M. Salkin, Integer Programming. Menlo Park, California: Addison-Wesley Publishing Company (1975).
[10] Harvey M. Salkin, Kamlesh Mathur, Foundations of Integer Programming. Publisher: Elsevier Science Ltd (1989).
[11] K. Schittkowski, More Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1987.
[12] Jsun Yui Wong (2012, April 23). The Domino Method of General Integer Nonlinear Programming Applied to Problem 2 of Lawler and Bell. http://computationalresultsfromcomputerprograms.wordpress.com/2012/04/23/
[13] Jsun Yui Wong (2013, September 4). A Nonlinear Integer/Discrete/Continuous Programming Solver Applied to a Literature Problem with Twenty Binary Variables and Three Constraints, Third Edition. http://myblogsubstance.typepad.com/substance/2013/09/