Saturday, June 27, 2009

A Computer Program for Integer Nonlinear Programming

Jsun Yui Wong

The computer program listed below seeks to solve the following problem.

Objective function:
Maximize:
-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2

Constraints:
34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2>=0
X(1)=1, 2, 3, 4, 5, 6,...
X(2)=2, 3, 4, 5, 6,...
X(3)=3, 4, 5, 6,...
X(4)=4, 5, 6,...
X(5)=-1000, -999, -998, -997,..., 0, 1, 2, 3,...

This problem is an adaptation of Problem 270 on page 94 of Schittkowski [1]. The adaptation has five general integer variables as shown above.

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 5
93 A(K)=4+FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 5
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.8 THEN GOTO 1110 ELSE GOTO 1115
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=IJU+FIX(RND*1001)
1112 GOTO 1151
1115 X(5)=-1000+FIX(RND*2001)
1151 PEN1=34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1486 PON=-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
1487 PTW=-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2
1488 P=PON+PTW-333333!*ABS(PEN1)
1499 PR=PON+PTW
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 5
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),A(5),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 two minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)

1 2 3 4 2
1 1 -31973

2 2 3 4 1
-1 -1 -31865

1 2 3 4 0
0 0 -31801

1 2 3 4 2
1 1 -31598

1 2 3 4 0
0 0 -31400

2 2 3 4 1
-1 -1 -31384

1 2 3 4 2
1 1 -31318

Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31973, JJJJ=-31598, and JJJJ=-31318 during the first two minutes 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.