Jsun Yui Wong
The following computer program tries to solve the twelve-city traveling salesperson problem on page 807 of Winston and Vankataramanan [10]. The new formulation is partly described by line 194 through line 355.
0 REM DEFDBL A-Z
2 DEFINT I,J,K,X
3 DIM B(99),N(99),A(2002),H(99),L(99),U(99),X(2002),D(111),P(111),PS(33),J44(2002)
8 DIM HR(49,49)
11 FOR IZ=0 TO 8
14 FOR JZ=0 TO 8
16 READ HR(IZ,JZ)
18 NEXT JZ
19 NEXT IZ
21 DATA 999,172,250,127,103,170,264,82,159
22 DATA 172,999,170,177,200,325,178,139,241
23 DATA 250,170,999,206,134,252,201,233,291
24 DATA 127,177,206,999,191,181,184,57,172
25 DATA 103,200,134,191,999,201,144,197,268
26 DATA 170,325,252,181,201,999,229,211,129
27 DATA 264,178,201,184,144,229,999,132,202
28 DATA 82,139,233,57,197,211,132,999,186
29 DATA 159,241,291,172,268,129,202,186,999
68 FOR JJJJ=-32000 TO 32000
69 RANDOMIZE JJJJ
70 M=-1D+37
91 A(1)=1:A(2)=2:A(3)=3:A(4)=4:A(5)=5:A(6)=6:A(7)=7:A(8)=8
126 IMAR=10+FIX(RND*666)
128 FOR I=1 TO IMAR
129 FOR KKQQ=1 TO 8
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
194 J=1+FIX(RND*8)
196 JJ=1+FIX(RND*8)
198 X(J)=A(JJ)
199 X(JJ)=A(J)
305 PDU=0
311 FOR J88=0 TO 7
315 PDU=PDU-HR(X(J88),X(J88+1))
320 NEXT J88
355 POB1=PDU-HR(X(8),0)
444 P1NEWMAY=POB1
466 P=P1NEWMAY
1111 IF P<=M THEN 1670
1452 M=P
1454 FOR KLX=1 TO 8
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M<-1236 THEN 1999
1933 PRINT A(1),A(2),A(3),A(4),A(5)
1934 PRINT A(6),A(7),A(8),M,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with Microsoft's GW BASIC 3.11 interpreter. The complete output through JJJJ=-31908 is shown below. What follows is a hand copy of the output on the computer-monitor screen; below there is no rounding by hand.
4 2 1 6 8
5 3 7 -1236 -31999
4 2 1 6 8
5 3 7 -1236 -31988
4 2 1 6 8
5 3 7 -1236 -31985
4 2 1 6 8
5 3 7 -1236 -31983
4 2 1 6 8
5 3 7 -1236 -31978
4 2 1 6 8
5 3 7 -1236 -31977
4 2 1 6 8
5 3 7 -1236 -31975
4 2 1 6 8
5 3 7 -1236 -31974
4 2 1 6 8
5 3 7 -1236 -31971
4 2 1 6 8
5 3 7 -1236 -31964
4 2 1 6 8
5 3 7 -1236 -31961
4 2 1 6 8
5 3 7 -1236 -31955
4 2 1 6 8
5 3 7 -1236 -31951
4 2 1 6 8
5 3 7 -1236 -31933
4 2 1 6 8
5 3 7 -1236 -31917
4 2 1 6 8
5 3 7 -1236 -31916
4 2 1 6 8
5 3 7 -1236 -31912
4 2 1 6 8
5 3 7 -1236 -31911
4 2 1 6 8
5 3 7 -1236 -31910
7 3 5 8 6
1 2 4 -1236 -31908
On a personal computer with an Intel 2.66 chip and the IBM basica/D interpreter, version GW BASIC 3.11, the throughput time (including printing) from JJJJ=-32000 through JJJJ=-31908 was four seconds, real time, not cpu time.
References
[1] Larry M. Austin, Parviz Ghandforoush, Management Science for Decision Makers. St. Paul, MN: West Publishing Company, 1993.
[2] Robert Garfinkel, George L. Nemhauser, Integer Programming. John Wiley and Sons, Inc., 1972.
[3] Frederick S. Hillier, Gerard J. Lieberman, Introduction to Operations Research, 8th Edition. New York: McGraw-Hill, 2005.
[4] Claude McMillan, Mathematical Programming, Second Edition. John Wiley and Sons Inc., 1975.
[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] Ronald L. Rardin, Optimization in Operations Research. Upper Saddle River, NJ: Prentice Hall, 1998.
[7] Hamdy A. Taha, Integer Programming--Theory, Applications, and Computations. Academic Press, In., 1975.
[8] Hamdy A. Taha, Operations Research: an Introduction, 8th Edition. Upper Saddle River, NJ 07458: Pearson Prentice Hall, 2007.
[9] Wayne L. Winston, Operations Research: Applications and Algorithms, Fourth Edition. Brooks/Cole, a division of Thomson, 2004.
[10] Wayne L. Winston, Munirpallam Venkataramanan, Introduction to Mathematical Programming, Third Edition. Brooks/Cole, a division of Thomson, 2003.