The computer program listed below seeks to solve the following example from Tsai, Lin, and Hu [10]:
Maximize 10 * (X(1) + X(2) + X(3)) + 8 * (X(4) + X(5) + X(6)) - 4 * (X(1) + X(4)) - 5 * (X(2) + X(5)) - 6 * (X(3) + X(6))
subject to X(1) + X(4)<=400
X(2) + X(5)<=300
X(3) + X(6)<=500
.2 * (X(1) + X(2) + X(3)) >= X(1)
.1 * (X(1) + X(2) + X(3)) >= X(2)
.2 * (X(1) + X(2) + X(3)) <= X(3)
.4 * (X(4) + X(5) + X(6)) >= X(4)
.5 * (X(4) + X(5) + X(6)) >= X(6)
X(i)=0, 1, 2, 3, ... where i=1 to 6.
In the following computer program X(7) through X(14) are slack variables.
0 REM DEFDBL A-Z
2 DEFINT I, J, K
3 DIM B(99), N(99), A(99), H(99), L(99), U(99), X(1111), D(111), P(111), PS(33), PE(111)
12 FOR JJJJ = -32000 TO 32111
14 RANDOMIZE JJJJ
16 M = -1D+37
64 FOR J44 = 1 TO 6
65 A(J44) = FIX(RND * 1001)
66 NEXT J44
128 FOR I = 1 TO 25000
129 FOR KKQQ = 1 TO 6
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
133 FOR IPP = 1 TO (1 + FIX(RND * 4))
181 J = 1 + FIX(RND * 6)
183 R = (1 - RND * 2) * A(J)
187 X(J) = A(J) + (RND ^ (RND * 10)) * R
222 NEXT IPP
251 FOR J41 = 1 TO 6
253 X(J41) = INT(X(J41))
255 NEXT J41
261 FOR J42 = 1 TO 6
263 IF X(J42) < 0 THEN 1670
265 NEXT J42
291 X(7) = 400 - X(1) - X(4)
292 X(8) = 500 - X(2) - X(5)
293 X(9) = 300 - X(3) - X(6)
301 X(10) = .2 * (X(1) + X(2) + X(3)) - X(1)
302 X(11) = .1 * (X(1) + X(2) + X(3)) - X(2)
303 X(12) = -.2 * (X(1) + X(2) + X(3)) + X(3)
304 X(13) = .4 * (X(4) + X(5) + X(6)) - X(4)
305 X(14) = .5 * (X(4) + X(5) + X(6)) - X(6)
401 FOR J44 = 7 TO 14
402 IF X(J44) < 0 THEN PE(J44) = 1000000 * X(J44) ELSE PE(J44) = 0
403 NEXT J44
428 POBA = 10 * (X(1) + X(2) + X(3)) + 8 * (X(4) + X(5) + X(6)) - 4 * (X(1) + X(4)) - 5 * (X(2) + X(5)) - 6 * (X(3) + X(6)) + PE(7) + PE(8) + PE(9) + PE(10) + PE(11) + PE(12) + PE(13) + PE(14)
459 POB1 = POBA
463 P1NEWMAY = POB1
466 P = P1NEWMAY
1111 IF P <= M THEN 1670
1452 M = P
1453 PPOBA2 = POBA2
1454 FOR KLX = 1 TO 14
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 REM GOTO 128
1670 NEXT I
1889 IF M < 4515 THEN 1999
1900 PRINT A(1), A(2), A(3), A(4)
1901 PRINT A(5), A(6), A(7), A(8)
1904 PRINT A(9), A(10), A(11), A(12), A(13), A(14), M, JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with qb64v1000-win [11]. The complete output through JJJJ=-31298 is shown below:
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31929
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31889
85 42 299 306
458 1 9 0
0 .2 .6 213.8 0
381.5 4516 -31860
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31726
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31712
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31662
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31646
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31624
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31619
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31590
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31565
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31530
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31490
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31460
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31445
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31391
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31365
85 41 300 306
459 0 9 0
0 .2 1.6 214.8 0
382.5 4516 -31363
85 42 299 306
458 1 9 0
0 .2 .6 213.8 0
381.5 4516 -31298
Above there is no rounding by hand; it is just straight copying by hand from the monitor screen.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and qb64v1000-win [11], the wall-clock time for obtaining the output through JJJJ=-31298 was one minute.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] Yuichiro Anzai (1974). On Integer Fractional Programming. Journal Operations Research Society of Japan, Volume 17, No. 1, March 1974, pp. 49-66.
www..orsj.or.jp/~archiv/pdf/e_mag/Vol.17_01_049.pdf.
[2] Sjirk Boon. Solving systems of nonlinear equations. Sci. Math. Num-Analysis,1992, Newsgroup Article 3529.
[3] Han-Lin Li, Jung-Fa Tsai (2008). A distributed computational algorithm for solving portfolio problems with integer variables. European Journal of Operational Research 186 (2008) pp.882-891.
[4] Harry Markowitz (1952). Portfolio Selection. The Journal of Finance 7 (2008) pp. 77-91.
[5] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.
[6] H. S. Ryoo, N. V. Sahinidis (1995). Global optimization of nonconvex NLP and MINLP with applications in process design. Computers and Chemical Engineering Vol. 19 (5) (1995) pp. 551-566.
[7] Jung-Fa Tsai, Ming-Hua Lin, Yi-Chung Hu (2007). On generalized geometric programming problems with non-positive variables. European Journal of Operational Research 178 (2007) pp. 10-19.
[8] Jung-Fa Tsai, Ming-Hua Lin (2008). Global optimization of signomial mixed-integer nonlinear programming with free variables. Journal of Global Optimization (2008) 42 pp. 39-49.
[9] Jung-Fa Tsai, Ming-Hua Lin (2007). Finding all solutions of systems of nonlinear equations with free variables. Engineering Optimization (2007) 39:6, pp. 649-659
[10] Jung-Fa Tsai, Ming-Hua Lin, Yi-Chung Hu (2008). Fing multiple integer solutions to general integer linear programs. European Journal of Operational Research 184 (2008) pp. 802-809.
[11] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
[12] Jsun Yui Wong (2012, April 12). The Domino Method of General Integer Nonlinear Programming Applied to a Nonlinear Fractional Programming Problem from the Literature. http://myblogsubstance.typepad.com/substance/2012/04/12/
No comments:
Post a Comment