Thursday, August 13, 2009

An Integer Programming Computer Program Applied to a Quadratic Assignment Problem

Jsun Yui Wong

The computer program listed below seeks to solve the six-department problem in Nugent, Vollmann, and Ruml (1968).

0 DEFSNG A-Z
3 DEFINT I,J,K
4 DIM X(166),A(166),L(166),K(166),P(166),B(166),S(166)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
111 FOR K=1 TO 12
113 A(K)=FIX(RND*3)
115 NEXT K
126 IMAR=10+FIX(RND*500)
128 FOR I=1 TO IMAR
129 FOR KK=1 TO 12
131 X(KK)=A(KK)
132 NEXT KK
222 IJL=1+FIX(RND*12)
234 X(IJL)=FIX(RND*3)
501 B(1)=ABS(X(1)-X(2))+ABS(X(7)-X(8))
502 B(2)=ABS(X(1)-X(3))+ABS(X(7)-X(9))
503 B(3)=ABS(X(1)-X(4))+ABS(X(7)-X(10))
504 B(4)=ABS(X(1)-X(5))+ABS(X(7)-X(11))
505 B(5)=ABS(X(1)-X(6))+ABS(X(7)-X(12))
506 B(6)=ABS(X(2)-X(3))+ABS(X(8)-X(9))
507 B(7)=ABS(X(2)-X(4))+ABS(X(8)-X(10))
508 B(8)=ABS(X(2)-X(5))+ABS(X(8)-X(11))
509 B(9)=ABS(X(2)-X(6))+ABS(X(8)-X(12))
510 B(10)=ABS(X(3)-X(4))+ABS(X(9)-X(10))
511 B(11)=ABS(X(3)-X(5))+ABS(X(9)-X(11))
512 B(12)=ABS(X(3)-X(6))+ABS(X(9)-X(12))
513 B(13)=ABS(X(4)-X(5))+ABS(X(10)-X(11))
514 B(14)=ABS(X(4)-X(6))+ABS(X(10)-X(12))
515 B(15)=ABS(X(5)-X(6))+ABS(X(11)-X(12))
1107 FOR IJUL=1 TO 15
1111 IF B(IJUL)=0 THEN B(IJUL)=333333!
1115 NEXT IJUL
1380 PH=-5*B(1)-2*B(2)-4*B(3)-1*B(4)
1381 PI=-.01*B(5)-3*B(6)-.01*B(7)
1384 PJ=-2*B(8)-2*B(9)-.01*B(10)
1385 PK=-.01*B(11)-.01*B(12)-5*B(13)-2*B(14)
1386 PL=-10*B(15)
1588 P=PH+PI+PJ+PK+PL
1651 IF P<=M THEN 1670
1657 FOR KEW=1 TO 12
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-45 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),A(8),A(9),A(10)
1914 PRINT A(11),A(12),M,JJJJ
1999 NEXT JJJJ

One notes that the artificial .01 flows of lines 1381, 1384 and 1385 replace the original 0 flows.

This BASIC computer program was run with the IBM basica/D interpreter, and the output produced in the first 10 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)

0 1 2 0 1
1 0 0 0 1
1 2 -43.13 -31989

0 0 0 1 1
2 2 1 0 2
1 1 -43.13 -31910

0 0 0 1 1
2 0 1 2 0
1 1 -43.13 -31906

2 1 1 2 1
0 1 1 2 0
0 0 -43.13 -31884

1 1 2 0 0
0 2 1 1 2
1 0 -43.13 -31825

1 1 1 2 2
2 0 1 2 0
1 2 -43.11 -31793

2 1 0 2 1
1 2 2 2 1
1 0 -43.13 -31779

The candidate solution above at JJJJ=-31793 is usable. Interpreted in accordance with line 1912 through line 1914, the output through JJJJ=-31779 was produced in the first 10 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.

References

Heragu, S. S., and Kusiak, A. (1991), "Efficient models for the facility layout problem," European Journal of Operational Research 53, 1-13.

Nugent, C. E., Vollmann, T. E., and Ruml, J. (1968), "An experimental comparisons of techniques for the assignment of facilities to locations," Operations Research 16, 150-173.