Monday, May 8, 2017

Solving An Instance of a K=4 Parallel Ordering Problem of Layout of 23 Facilities

Jsun Yui Wong

Adapting to the computer program in Wong [12], the following computer program seeks to solve the parallel row ordering problem (PROP) of 23 facilities with the first three rows each with 6 facilities and the fourth row with 5 facilities; see Amaral [5].  The data can be found in Amaral [5] and Anjos [8].

0 REM DEFDBL A-Z

1 DEFINT I, J, K, X

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)

17 HR(1) = 5: HR(2) = 13: HR(3) = 9: HR(4) = 6: HR(5) = 5: HR(6) = 10: HR(7) = 5: HR(8) = 9: HR(9) = 9


18 HR(10) = 5: HR(11) = 8: HR(12) = 12: HR(13) = 8: HR(14) = 11: HR(15) = 11: HR(16) = 8: HR(17) = 10: HR(18) = 6: HR(19) = 8: HR(20) = 14


29 HR(21) = 12: HR(22) = 8: HR(23) = 11


31 FOR IL = 1 TO 23

    32 FOR JL = 1 TO 23

        33 READ HS(IL, JL)

    34 NEXT JL

35 NEXT IL


42 DATA 9999,3,2,0,0,2,10,5,0,5,2,5,0,0,2,0,5,6,3,0,1,10,0


43 DATA 3,9999,4,0,10,4,0,0,2,2,1,0,5,0,0,0,0,2,0,1,6,1,0


44 DATA 2,4,9999,3,4,0,5,5,5,1,4,1,0,4,0,4,0,6,3,2,5,5,2


45 DATA 0,0,3,9999,0,0,0,2,2,0,6,0,2,5,2,5,1,1,1,1,2,2,4


46 DATA 0,10,4,0,9999,5,2,0,0,0,0,2,0,0,0,0,2,1,0,0,2,0,5


47 DATA 2,4,0,0,5,9999,1,2,2,1,4,10,10,2,5,5,0,5,0,0,0,10,0


48 DATA 10,0,5,0,2,1,9999,10,10,5,10,10,6,0,0,10,2,1,10,1,5,5,2


49 DATA 5,0,5,2,0,2,10,9999,1,3,5,0,0,0,2,4,5,2,10,6,0,5,5


50 DATA 0,2,5,2,0,2,10,1,9999,10,2,1,5,2,0,3,0,2,0,0,4,0,5


51 DATA 5,2,1,0,0,1,5,3,10,9999,5,5,6,0,1,5,5,0,5,2,3,5,0


52 DATA 2,1,4,6,0,4,10,5,2,5,9999,0,0,1,2,1,0,2,0,0,0,6,6


53 DATA 5,0,1,0,2,10,10,0,1,5,0,9999,5,5,2,0,0,0,0,2,0,4,5


54 DATA 0,5,0,2,0,10,6,0,5,6,0,5,9999,2,0,4,2,2,1,0,6,2,1


55 DATA 0,0,4,5,0,2,0,0,2,0,1,5,2,9999,2,1,0,5,3,10,0,0,4


56 DATA 2,0,0,2,0,5,0,2,0,1,2,2,0,2,9999,4,5,1,0,1,0,5,0


57 DATA 0,0,4,5,0,5,10,4,3,5,1,0,4,1,4,9999,0,3,0,2,2,0,2


58 DATA 5,0,0,1,2,0,2,5,0,5,0,0,2,0,5,0,9999,2,2,0,0,0,6


59 DATA 6,2,6,1,1,5,1,2,2,0,2,0,2,5,1,3,2,9999,5,1,2,10,10


60 DATA 3,0,3,1,0,0,10,10,0,5,0,0,1,3,0,0,2,5,9999,0,5,5,1


61 DATA 0,1,2,1,0,0,1,6,0,2,0,2,0,10,1,2,0,1,0,9999,5,2,1


62 DATA 1,6,5,2,2,0,5,0,4,3,0,0,6,0,0,2,0,2,5,5,9999,4,0


63 DATA 10,1,5,2,0,10,5,5,0,5,6,4,2,0,5,0,0,10,5,2,4,9999,5


64 DATA 0,0,2,4,5,0,2,5,5,0,6,5,1,4,0,2,6,10,1,1,0,5,9999


88 FOR JJJJ = -32000 TO 32000



    89 RANDOMIZE JJJJ

    90 M = -1D+37

    91 FOR J44 = 1 TO 23


        93 A(J44) = J44

    94 NEXT J44


    111 REM  IF RND < 1 / 4 THEN IMAX = 4 ELSE IF RND < 1 / 3 THEN IMAX = 4 ELSE IF RND < 1 / 2 THEN IMAX = 4 ELSE IMAX = 4


    128 FOR I = 1 TO 5000



        129 FOR KKQQ = 1 TO 23

            130 X(KKQQ) = A(KKQQ)

        131 NEXT KKQQ

        133 III = 1 + FIX(RND * 23)

        134 JJJ = 1 + FIX(RND * 23)

        137 X(III) = A(JJJ)

        139 X(JJJ) = A(III)



        231 FOR J44 = 1 TO 23

            233 FOR J45 = 1 TO 23

                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 6

                254 C(ISE20) = .5 * HHR(Y(ISE20))

                258 FOR ISE2000 = ISE20 + 1 TO 6

                    259 C(ISE20) = C(ISE20) + HHR(Y(ISE2000))

                263 NEXT ISE2000

            269 NEXT ISE20

            386 FOR ISE20 = 7 TO 12

                387 C(ISE20) = .5 * HHR(Y(ISE20))

                308 FOR ISE2000 = ISE20 + 1 TO 12

                    389 C(ISE20) = C(ISE20) + HHR(Y(ISE2000))

                390 NEXT ISE2000

            391 NEXT ISE20




            396 FOR ISE20 = 13 TO 18

                397 C(ISE20) = .5 * HHR(Y(ISE20))

                398 FOR ISE2000 = ISE20 + 1 TO 18

                    399 C(ISE20) = C(ISE20) + HHR(Y(ISE2000))

                400 NEXT ISE2000

            401 NEXT ISE20



            403 FOR ISE20 = 19 TO 23

                404 C(ISE20) = .5 * HHR(Y(ISE20))

                405 FOR ISE2000 = ISE20 + 1 TO 23

                    406 C(ISE20) = C(ISE20) + HHR(Y(ISE2000))

                407 NEXT ISE2000

            408 NEXT ISE20

        409 NEXT J44



        601 FOR J77 = 1 TO 6


            605 IF X(J77) > 6 THEN 1670


        609 NEXT J77

        611 FOR J77 = 7 TO 12


            615 IF X(J77) > 12 THEN 1670


        619 NEXT J77

        621 FOR J77 = 13 TO 18


            622 IF X(J77) > 18 THEN 1670


        629 NEXT J77

        631 FOR J77 = 19 TO 23


            635 IF X(J77) > 23 THEN 1670


        639 NEXT J77


        811 PROD = 0

        812 FOR J44 = 1 TO 23

            813 FOR J45 = J44 + 1 TO 23

                814 PROD = PROD - HS(Y(J44), Y(J45)) * ABS(C(J44) - C(J45))

            815 NEXT J45

        816 NEXT J44

        1082 P = PROD

        1111 IF P <= M THEN 1670

        1452 M = P

        1453 FOR KLX = 1 TO 23

            1454 CC(KLX) = C(KLX)

            1455 A(KLX) = X(KLX)

        1456 NEXT KLX

        1559 IIMAX = IMAX

        1657 GOTO 128

    1670 NEXT I

    1891 PRINT A(1), A(2), A(3), A(4), A(5)

    1892 PRINT A(6), A(7), A(8), A(9), A(10)


    1893 PRINT A(11), A(12), A(13), A(14), A(15)


    1894 PRINT A(16), A(17), A(18), A(19), A(20), A(21), A(22), A(23)


    1991 PRINT CC(1), CC(2), CC(3), CC(4), CC(5)


    1992 PRINT CC(6), CC(7), CC(8), CC(9), CC(10)


    1993 PRINT CC(11), CC(12), CC(13), CC(14), CC(15)


    1994 PRINT CC(16), CC(17), CC(18), CC(19), CC(20), CC(21), CC(22), CC(23)

    1995 PRINT M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [11]. The output through JJJJ=-31993 is summarized below:

.
.
.
-8537          -32000

.
.
.
-8537          -31999

.
.
.
-8591         -31998

.
.
.
-8431          -31997

.
.
.
-8591          -31996

.
.
.
-8537          -31995

.
.
.
-8673          -31994

3             6           2          1               5
4             9           8         11            10
7           12         17         18             14
16         13         15          20            23
22         21         19
45         37.5      30.5       23            15.5
6.5        44         35.5      28.5          23.5
16.5        6         49         38.5          30
23         15          5.5       47.5          38
30         20          7
-8203          -31993

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 [11], the wall-clock time for obtaining the output through JJJJ=-31993 was 15 seconds.

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 www.gerad.ca/files/Sites/Anjos/indexFR.html

[8] Miguel F. Anjos, FLPLIB--Facility Layout Database.  www.miguelanjos.com.

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

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

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

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

No comments:

Post a Comment