Monday, June 19, 2017

Solving a Double Row Layout Problem Having 16 Facilities

Jsun Yui Wong

Based on the computer program in Wong [17], the following computer program seeks to solve the problem named P16_a in Fischer, Fischer, and Hungerlander [10, p. 129, Table 1]. The data come from the PROP Instances-Amaral 2013 section of Anjos [8].

0 REM DEFDBL A-Z
1 DEFINT I, J, K, X, A
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J44(2002), J(99), AA(99), HR(32), HHR(32), Y(33), C(33), CC(33)
3 DIM HS(49, 49)
4 DIM PE(49, 49)
5 DIM SD(49, 49)
27 HR(1) = 14: HR(2) = 11: HR(3) = 9: HR(4) = 5: HR(5) = 13

28 REM   HR(6)=4:HR(7)=6:HR(8)=8:HR(9)=9
29 HR(6) = 5: HR(7) = 14: HR(8) = 7: HR(9) = 10: HR(10) = 11

30 HR(11) = 8: HR(12) = 14: HR(13) = 10: HR(14) = 11: HR(15) = 8: HR(16) = 5

31 FOR IL = 1 TO 16
    32 FOR JL = 1 TO 16
        33 READ HS(IL, JL)
    34 NEXT JL
35 NEXT IL
61 DATA 999,0,5,0,5,2,10,3,1,5,5,5,0,0,5,4

62 DATA 0,999,3,10,5,1,5,1,2,4,2,5,0,10,10,3
63 DATA 5,3,999,2,0,5,2,4,4,5,0,0,0,5,1,0
64 DATA 0,10,2,999,1,0,5,2,1,0,10,2,2,0,2,1

66 DATA 5,5,0,1,999,5,6,5,2,5,2,0,5,1,1,1
67 DATA 2,1,5,0,5,999,5,2,1,6,0,0,10,0,2,0

68 DATA 10,5,2,5,6,5,999,0,0,0,5,10,2,2,5,1


69 DATA 3,1,4,2,5,2,0,999,1,1,10,10,2,0,10,2

70 DATA 1,2,4,1,2,1,0,1,999,2,0,3,5,5,0,5

71 DATA 5,4,5,0,5,6,0,1,2,999,5,5,0,5,1,0

72 DATA 5,2,0,10,2,0,5,10,0,5,999,5,2,5,1,10
73 DATA 5,5,0,2,0,0,10,10,3,5,5,999,2,10,5,0

74 DATA 0,0,0,2,5,10,2,2,5,0,2,2,999,2,2,1

75 DATA 0,10,5,0,1,0,2,0,5,5,5,10,2,999,5,5
76 DATA 5,10,1,2,1,2,5,10,0,1,1,5,2,5,999,3
77 DATA 4,3,0,1,1,0,1,2,5,0,10,0,1,5,3,999
78 FOR JJJJ = -32000 TO 32000
    79 RANDOMIZE JJJJ
    80 M = -1D+37


    81 IMAX = 2 + FIX(RND * 13)


    82 FOR J44 = 1 TO 16

        83 A(J44) = J44
    84 NEXT J44
    111 REM IF RND < 1 / 4 THEN IMAX = 8 ELSE IF RND < 1 / 3 THEN IMAX = 9 ELSE IF RND < 1 / 2 THEN IMAX = 10 ELSE IMAX = 11

    126 REM IMAR=10+FIX(RND*1000)
    128 FOR I = 1 TO 1000


        129 FOR KKQQ = 1 TO 16
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 III = 1 + FIX(RND * 16)
        134 JJJ = 1 + FIX(RND * 16)
        221 X(III) = A(JJJ)
        223 X(JJJ) = A(III)
        231 FOR J44 = 1 TO 16
            233 FOR J45 = 1 TO 16
                234 IF X(J44) = J45 THEN HHR(J44) = HR(J44) ELSE GOTO 238
                237 Y(J45) = J44
            238 NEXT J45
            253 FOR ISE20 = 1 TO IMAX
                254 C(ISE20) = .5 * HHR(Y(ISE20))
                258 FOR ISE2000 = ISE20 + 1 TO IMAX
                    259 C(ISE20) = C(ISE20) + HHR(Y(ISE2000))
                263 NEXT ISE2000
            269 NEXT ISE20
            386 FOR ISE20N = IMAX + 1 TO 16
                387 C(ISE20N) = .5 * HHR(Y(ISE20N))
                388 FOR ISE2000N = ISE20N + 1 TO 16
                    389 C(ISE20N) = C(ISE20N) + HHR(Y(ISE2000N))
                390 NEXT ISE2000N
            391 NEXT ISE20N
        395 NEXT J44
        411 PROD = 0
        412 FOR J44 = 1 TO 16
            413 FOR J45 = J44 + 1 TO 16
                414 PROD = PROD - HS(Y(J44), Y(J45)) * ABS(C(J44) - C(J45))
            415 NEXT J45
        416 NEXT J44
        422 P = PROD
        1111 IF P <= M THEN 1670
        1452 M = P
        1453 FOR KLX = 1 TO 16
            1454 CC(KLX) = C(KLX)
            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1559 Iimax = IMAX
        1657 GOTO 128
    1670 NEXT I
    1889 IF M < -7371 THEN 1999


    1901 PRINT A(1), A(2), A(3), A(4), A(5)
    1902 PRINT A(6), A(7), A(8), A(9), A(10)
    1903 PRINT A(11), A(12), A(13), A(14), A(15), A(16)

    1905 REM PRINT  CC(1), CC(2), CC(3), CC(4), CC(5)
    1906 REM PRINT CC(6), CC(7), CC(8), CC(9), CC(10)
    1907 REM PRINT CC(11), CC(12), CC(13), CC(14), CC(15)
    1919 PRINT M, JJJJ, Iimax
1999 NEXT JJJJ

This computer program was run with qb64v1000-win [16]. The complete output through JJJJ=-29826 is shown below:

16    4       3       13      2
9      7      14      1        10
5      6       8       11      15
12
-7370    -31479        7

16    4   3     13     2
9    7   14      1    10
5    6     8     11    15
12
-7370    -31269        7

16    4   3     13     2
9    7   14      1    10
5    6     8     11    15
12
-7370    -30457        7

9       13      12      6       11
2       16      7        10     3
14     15      1        4       8
5
-7370     -29826      9

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 [16], the wall-clock time for obtaining the output through JJJJ=-29826 was five minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Andre R. S. Amaral (2006), On the Exact Solution of a Facility Layout Problem. European Journal of Operational Research 173 (2006), pp. 508-518.

[2] Andre R. S. Amaral (2008), An Exact Approach to the One-Dimensional Facility Layout Problem. Operations Research, Vol. 56, No. 4 (July-August, 2008), pp. 1026-1033.

[3] Andre R. S. Amaral (2011), Optimal Solutions for the Double Row Layout Problem. Optimization Letters, DOI 10.1007/s11590-011-0426-8, published on line 30 November 2011, Springer-Verlag 2011.

[4] Andre R. S. Amaral (2012), The Corridor Allocation Problem. Computers and Operations Research 39 (2012), pp. 3325-3330.

[5] Andre R. S. Amaral (2013), A Parallel Ordering Problem in Facilities Layout. Computers and Operations Research, Vol. 40, Issue 12, December 2013, pp. 2930-2939.

[6] Miguel F. Anjos, Anthony Vannelli, Computing Globally Optimal Solutions for Single-Row Layout Problems Using Semidefinite Programming and Cutting Planes. INFORMS Journal on Computing, Vol. 20, No. 4, Fall 2008, pp. 611-617.

[7] Miguel F. Anjos (2012), FLPLIB–Facility Layout Database. Retrieved on September 25 2012 from http://www.gerad.ca/files/Sites/Anjos/indexFR.html

[8] Miguel F. Anjos, FLPLIB–Facility Layout Database. http://www.miguelanjos.com.

[9] Miguel Anjos.  QAP - A Quadratic Assignment Problem Library.  www.anjos.mgi.polymtl.ca/qaplib/data.d/sko49.dat

[10] Anja Fischer, Frank Fischer. Philipp Hungerlaender, A New Exact Approach to the Space-Free Double Row Layout Problem.
K. Doerner et al. (eds) Operations Research Proceedings 2015. Springer 2017.

[11] S. S. Heragu, A. Kusiak. Efficient Models for the Facility Layout Problem. European Journal of Operational Research 53 (1), 1991, pp. 1-13.

[12] Philipp Hungerlaender, Miguel F. Anjos (January 2012), A Semidefinite Optimization Approach to Free-Space Multi-Row Facility Layout. Les Cahiers du GERAD. Retrieved from http://www.gerad.ca/fichiers/cahiers/G-2012-03.pdf

[13] Robert F. Love, Jsun Yui Wong (1976), On Solving a One-Dimensional Space Allocation Problem with Integer Programming,  INFOR 14(2), pp. 139-143.

[14] 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.

[15] C. E. Nugent, T. E Vollmann, J. Ruml (1968), An Experimental Comparison of Techniques for the Assignment of Facilities to Locations. Operations Research, Vol. 16, pp. 150-173.

[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

[17] Jsun Yui Wong (2012, September 20). A General Nonlinear Integer/Discrete/Continuous Programming Solver Applied to the Corridor Allocation Problem with Fifteen Facilities, Fifth Edition. https://myblogsubstance.typepad.com/substance/2012/09/index.html/

[18] Ginger Yen (2008). Cutting-Plane Separation Strategies for Semidefinite Programming Models to Solve Single-Row Facility Layout Problems. A Master Thesis Presented to the University of Waterloo