Monday, June 29, 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:
-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
where
W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
W3=(X(3)+.03)/(.13*X(3)+.03)

Constraints:
X(1)+X(2)+X(3)-1=0
X(1)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(2)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(3)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000

This problem is an adaptation of Problem 347 on page 168 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 3
93 A(K)=+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*3)
1111 X(IJU)=+FIX(RND*2001)
1161 PEN1=X(1)+X(2)+X(3)-1
1163 IF PEN1=0 THEN PEN1=0 ELSE PEN1=PEN1
1411 W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
1422 W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
1433 W3=(X(3)+.03)/(.13*X(3)+.03)
1486 P=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)-333333!*ABS(PEN1)
1499 PR=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-18888 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),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 20 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)

0 0 1 -17374.6255045664
-17374.6255045664 -31997

1 0 0 -17637.93743737338
-17637.93743737338 -31976

0 0 1 -17374.6255045664
-17374.6255045664 -31936

1 0 0 -17637.93743737338
-17637.93743737338 -31897

0 0 1 -17374.6255045664
-17374.6255045664 -31876

Interpreted in accordance with line 1912, the output above shows the best solutions--at JJJJ=
-31997, JJJJ=-31976, and JJJJ=-31876--produced during the first 20 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.